A method, medium, and equipment for identifying nuclear industry drawings.

By progressively identifying and masking information boxes, outer borders, component symbols, and text in nuclear industry drawings, and combining object detection and OCR technologies, the problem of misidentification caused by element interference in nuclear industry drawing recognition has been solved, improving the accuracy of drawing redrawing and enabling automatic answer provision.

CN121033892BActive Publication Date: 2026-07-17ZHENXI TECHNOLOGY (CHENGDU) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHENXI TECHNOLOGY (CHENGDU) CO LTD
Filing Date
2025-09-16
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies for nuclear industry drawing recognition suffer from misidentification due to interference from lines and symbols, reducing the accuracy of drawing redrawing, especially since component symbol detection models are prone to errors.

Method used

By identifying and masking the lower right corner information box, outer border, component symbols, and text in nuclear industry drawings, interference between elements is gradually eliminated. Target detection model, OCR technology, and component symbol detection model are used to obtain the preset information of each element. Combined with Hough transform to detect straight lines, a knowledge graph is constructed to improve recognition accuracy.

Benefits of technology

It effectively eliminates mutual interference between elements in nuclear industry drawings, improves the recognition accuracy of symbols, text and lines, increases the accuracy of redrawing drawings, and can automatically provide answers for users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033892B_ABST
    Figure CN121033892B_ABST
Patent Text Reader

Abstract

This application relates to the field of nuclear industry drawing recognition technology, and in particular to a method, medium, and device for recognizing nuclear industry drawings. The method includes: recognizing a lower right corner information box in a target nuclear industry drawing in an initial state; obtaining metadata based on the box; and masking the box to obtain a target nuclear industry drawing in a first state; recognizing the outer border of the drawing and masking it to obtain a target nuclear industry drawing in a second state; recognizing component symbols and text in the drawing; obtaining first preset information for each component symbol and second preset information for each text; and masking the component symbols and text to obtain a target nuclear industry drawing in a third state; recognizing lines in the drawing and obtaining third preset information for each line; and redrawing the nuclear industry drawing based on the metadata, component symbol information, text information, and line information. This invention improves the accuracy of nuclear industry drawing recognition and redrawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of nuclear industry drawing recognition technology, and in particular to a method, medium and equipment for recognizing nuclear industry drawings. Background Technology

[0002] Nuclear industry drawings, as the core carriers of nuclear facility design, construction, and operation, contain a wealth of critical information on equipment, piping, instrumentation, and electrical connections. Currently, a large number of historical drawings are still archived in paper or scanned image form, which cannot be directly understood and processed by computer systems, forming information silos. To redraw these drawings, it is necessary to first identify the information of all elements in the drawings, and then redraw the drawings based on the identified information. The redrawn drawings constitute editable digital assets.

[0003] However, the following situations arise during the recognition of nuclear industry drawings: engineering drawings are dense mixtures of text and graphics, with text, symbols, and lines overlapping each other. Directly applying OCR can lead to numerous misidentifications due to interference from lines and symbols. Furthermore, nuclear industry drawings contain a large number of specialized and abstract component symbols, which are diverse in form and easily confused with each other. Existing component symbol detection models may produce incorrect detections. These situations lead to misidentification of information, consequently reducing the accuracy of the final redrawn drawings. Therefore, improving the accuracy of nuclear industry drawing recognition, and consequently improving the accuracy of the redrawn drawings, is an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this invention is to provide a method, medium, and device for identifying nuclear industry drawings, so as to improve the accuracy of identifying nuclear industry drawings and thereby improve the accuracy of redrawn drawings.

[0005] According to a first aspect of the present invention, a method for identifying nuclear industry drawings is provided, the method comprising the following steps:

[0006] S100: Identify the lower right corner information box in the target nuclear industry drawing in the initial state, obtain the meta-information of the target industry drawing based on the lower right corner information box, and perform a masking operation on the lower right corner information box to obtain the target nuclear industry drawing in the first state.

[0007] S200: Identify the outer border of the target nuclear industry drawing in the first state, and cover the outer border of the target nuclear industry drawing in the first state to obtain the target nuclear industry drawing in the second state.

[0008] S300, identify the component symbols and text in the target nuclear industry drawing in the second state, obtain the first preset information of each component symbol and the second preset information of each text, and cover the component symbols and text in the target nuclear industry drawing in the second state to obtain the target nuclear industry drawing in the third state.

[0009] S400 identifies lines in a target nuclear industry drawing in the third state and obtains the third preset information for each line.

[0010] S500, redraw the nuclear industry drawings based on the metadata, the first preset information of each element symbol, the second preset information of each character, and the third preset information of each line.

[0011] According to a second aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for identifying nuclear industry drawings.

[0012] According to a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for identifying nuclear industry drawings.

[0013] Compared with the prior art, the present invention has at least the following beneficial effects:

[0014] This invention identifies the lower right corner information box in a target nuclear industry drawing in its initial state, obtains the metadata of the target nuclear industry drawing based on the lower right corner information box, and performs a masking operation on the lower right corner information box to obtain a target nuclear industry drawing in a first state; identifies the outer border in the target nuclear industry drawing in the first state and masks the outer border in the target nuclear industry drawing in the first state to obtain a target nuclear industry drawing in a second state; identifies the component symbols and text in the target nuclear industry drawing in the second state, obtains the first preset information of each component symbol and the second preset information of each text, and masks the component symbols and text in the target nuclear industry drawing in the second state to obtain a target nuclear industry drawing in a third state; identifies the lines in the target nuclear industry drawing in the third state and obtains the third preset information of each line. As can be seen, the present invention sequentially identifies the lower right corner information box, outer border, component symbols and text, and lines in the target nuclear industry drawing. Compared with the existing technology that directly uses OCR to identify nuclear industry drawings, the present invention can effectively eliminate the mutual interference between different elements and provide a better and cleaner input environment for the identification of each type of element, thereby improving the accuracy of symbol recognition, text recognition and line recognition, and thus improving the accuracy of the subsequently redrawn nuclear industry drawings. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a method for identifying nuclear industry drawings provided in Embodiment 1 of the present invention. Detailed Implementation

[0017] 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, and 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.

[0018] Example 1:

[0019] According to this embodiment, as Figure 1 As shown, a method for identifying nuclear industry drawings is provided, the method comprising the following steps:

[0020] S100: Identify the lower right corner information box in the target nuclear industry drawing in the initial state, obtain the meta-information of the target industry drawing based on the lower right corner information box, and perform a masking operation on the lower right corner information box to obtain the target nuclear industry drawing in the first state.

[0021] In this embodiment, the target nuclear industry drawing is the nuclear industry drawing to be processed, and the target nuclear industry drawing is in image format. The target and industry drawing in its initial state is also the original target nuclear industry drawing, which has not undergone subsequent masking operations. The lower right corner of the target nuclear industry drawing usually contains an information box that records metadata such as drawing number, name, size, and scale.

[0022] As a specific implementation, an object detection model is used to identify the lower right corner information box in the target nuclear industry drawing in its initial state. Those skilled in the art will understand that the object detection model is prior art, and its structure and training process are also prior art, and will not be elaborated here; optionally, the object detection model is Faster R-CNN or YOLO. It should be noted that the nuclear industry drawing used to train the object detection model is not subject to outer border masking. The object detection model can quickly locate the information box based on the outer border. In this embodiment, the information box recognition operation is performed before masking the outer border, which improves the accuracy of information box recognition.

[0023] As a specific implementation method, after identifying the information box in the lower right corner of the target nuclear industry drawing in its initial state, the content of the information box is parsed based on OCR technology to obtain the metadata of the target industry drawing.

[0024] In one specific implementation, S100 includes the following steps for covering the lower right corner information box:

[0025] S110: Determine whether there is a horizontal line segment in the target nuclear industry drawing in the initial state that is connected to the bottom edge of the lower right corner information box. If so, retain the bottom edge when performing the cover operation on the lower right corner information box; otherwise, proceed to S120.

[0026] In this embodiment, if there is a horizontal line segment in the target nuclear industry drawing in the initial state that is connected to the bottom edge of the lower right corner information box, it is determined that the bottom edge of the lower right corner information box is connected to the outer frame. In this case, when performing a masking operation on the lower right corner information box, preserving the bottom edge can ensure the integrity of the outer frame.

[0027] S120, determine whether there is a vertical line segment in the target nuclear industry drawing in the initial state that connects to the right side of the lower right corner information box. If there is, retain the right side when performing the masking operation on the lower right corner information box; otherwise, perform the masking operation on the entire lower right corner information box.

[0028] In this embodiment, if there is a horizontal line segment in the target nuclear industry drawing in the initial state that is connected to the right side of the lower right corner information box, it is determined that the right side of the lower right corner information box is connected to the outer frame. In this case, when the lower right corner information box is covered, retaining the right side can ensure the integrity of the outer frame.

[0029] In this embodiment, if the target nuclear industry drawing in the initial state contains a horizontal line segment connected to the bottom edge of the lower right corner information box and a vertical line segment connected to the right side of the lower right corner information box, then the bottom edge and the right side are retained when the lower right corner information box is covered.

[0030] Based on S110-S120, it is possible to cover the lower right corner information box of the target nuclear industry drawing in its initial state (that is, cover the lower right corner information box in the target nuclear industry drawing), and also ensure that the covering operation will not affect the outer border, thus ensuring the integrity of the outer border and facilitating the accurate identification of the outer border in the future.

[0031] S200: Identify the outer border of the target nuclear industry drawing in the first state, and cover the outer border of the target nuclear industry drawing in the first state to obtain the target nuclear industry drawing in the second state.

[0032] In this embodiment, the target nuclear industry drawing in the first state is the target nuclear industry drawing obtained after covering the information box in the lower right corner of the target nuclear industry drawing in the initial state.

[0033] As one specific implementation, the process of identifying the outer border in a target nuclear industry drawing in its first state includes:

[0034] S210, perform line identification in the preset upper and lower regions of the target nuclear industry drawing in the first state. If there is a line whose length differs from the length of the target nuclear industry drawing in the first state by less than or equal to a preset length difference threshold, then determine that the line is the upper or lower outer border.

[0035] In one specific implementation, the upper region is preset to be a top preset ratio (which can be an empirical value, such as 10%) region, and the lower region is preset to be a bottom preset ratio (which can be an empirical value, such as 10%) region.

[0036] As a specific implementation, the preset length difference threshold is an empirical value, for example, the preset length difference threshold is the product of 5% and the length of the target nuclear industry drawing in the first state.

[0037] As a specific implementation, the Hough transform is used to detect whether a straight line exists in a preset upper region and a preset lower region; those skilled in the art will know that the process of using the Hough transform to detect a straight line is prior art, and will not be described in detail here.

[0038] S220, perform line recognition in the preset left and preset right regions of the target nuclear industry drawing in the first state. If there is a line whose length differs from the width of the target nuclear industry drawing in the first state by less than or equal to a preset width difference threshold, then determine that the line is the left or right outer border.

[0039] In one specific implementation, the left region is preset to a preset left ratio (which can be an empirical value, such as 10%) region, and the right region is preset to a preset right ratio (which can be an empirical value, such as 10%) region.

[0040] As a specific implementation, the preset width difference threshold is an empirical value, for example, the preset width difference threshold is the product of 5% and the width of the target nuclear industry drawing in the first state.

[0041] As a specific implementation, the Hough transform is used to detect whether a straight line exists in a preset left region and a preset right region; those skilled in the art will know that the process of using the Hough transform to detect a straight line is prior art, and will not be described in detail here.

[0042] Based on S210-S220, the outer border can be quickly identified with relatively low computing power; covering the outer border can simplify the subsequent process of identifying symbols and lines.

[0043] S300, identify the component symbols and text in the target nuclear industry drawing in the second state, obtain the first preset information of each component symbol and the second preset information of each text, and cover the component symbols and text in the target nuclear industry drawing in the second state to obtain the target nuclear industry drawing in the third state.

[0044] In this embodiment, the target nuclear industry drawing in the second state is the target nuclear industry drawing obtained after covering the outer border of the target nuclear industry drawing in the first state.

[0045] As one specific implementation, the first preset information includes location information and type; identifying component symbols in the target nuclear industry drawing in the second state, and obtaining the first preset information for each component symbol includes:

[0046] S310, using a trained component symbol detection model to detect component symbols in the target nuclear industry drawing in the second state, and obtaining a position and type probability list for each component symbol in the target nuclear industry drawing in the second state; the type probability list includes the correspondence between component symbol type and probability.

[0047] As a specific implementation, the component symbol detection model adopts existing target detection models, such as YOLO or RetinaNet. The structure and training process of the target detection model are existing technologies. For example, during the training process of the component symbol detection model, the component symbols in each nuclear industrial drawing in the training set are labeled so that the component symbol detection model can learn the knowledge of component symbols and have the function of recognizing component symbols.

[0048] In this embodiment, the target nuclear industry drawing in the second state is input into the trained component symbol detection model to obtain the bounding box (position) and type probability list of each component (e.g., gate valve: 90%, ball valve: 8%, etc.).

[0049] S320: Obtain the number of other probabilities in the candidate element symbol type probability list whose difference from the maximum probability is less than or equal to a preset probability threshold. If the number is 0, then determine the type corresponding to the maximum probability in the candidate element symbol type probability list as the type of the candidate element symbol; otherwise, proceed to S330; the candidate element symbol is any element symbol in the target nuclear industry drawing in the second state.

[0050] In this embodiment, the preset probability threshold is an empirical value, such as 2%, 5%, or 10%.

[0051] In this embodiment, if the number of other probabilities in the candidate component symbol type probability list whose difference from the maximum probability is less than or equal to the preset probability threshold is 0, it indicates that the component symbol detection model is relatively certain in its judgment of the type of the candidate component symbol; otherwise, it indicates that the component symbol detection model is relatively ambiguous in its judgment of the type of the candidate component symbol, and then proceeds to S330.

[0052] S330, obtain the component symbols in the target nuclear industry drawing in the second state that have a direct connection relationship with the candidate component symbols, and obtain the probability of the candidate component symbol being each specified type according to the component symbols with direct connection relationship and the preset connection relationship knowledge base; the specified type is the type corresponding to the probability in the type probability list of candidate component symbols whose difference from the maximum probability is less than or equal to a preset probability threshold; the preset connection relationship knowledge base includes the probability of direct connection between different component symbols.

[0053] In this embodiment, if the number of other probabilities in the candidate component symbol type probability list whose difference from the maximum probability is less than or equal to a preset probability threshold is greater than 0, the probability of the candidate component symbol being of each specified type is calculated using a preset connection relationship knowledge base and component symbols in the target nuclear industry drawing in the second state that have a direct connection relationship with the candidate component symbol. The preset connection relationship knowledge base is a database storing the connection probabilities between symbols (e.g., P(pump|valve) = 0.8, indicating that the probability of a pump and valve being directly connected is 0.8), which can be constructed by domain experts or through statistical learning from labeled data.

[0054] In this embodiment, "directly connected" means that two component symbols are connected only by a line, and there are no other component symbols between them. It should be noted that if the number of other probabilities in the candidate component symbol type probability list that differ from the maximum probability by less than or equal to a preset probability threshold is greater than 0, the steps of covering the component symbols in the target nuclear industry drawing in the second state and subsequent line recognition can be performed first. Based on the line recognition, the type of the component symbol directly connected to the candidate component symbol is determined, and then steps S330-S340 are executed to obtain the type of the candidate component.

[0055] It should be noted that if the type of a component symbol that is directly related to the candidate component symbol in the target nuclear industry drawing in the second state cannot be determined, as an optional specific implementation, a preset abnormal information (including the position of the candidate component symbol) is issued to remind manual determination of the type of the candidate component symbol.

[0056] In one specific implementation, if the number of component symbols in the target nuclear industry drawing in the second state that are directly connected to the candidate component symbols is Q, and Q≥2, then the probability of a candidate component symbol being directly connected to each of the Q component symbols when it is any specified type of component symbol stored in the preset connection relationship knowledge base is multiplied by the probability that the candidate component symbol is of that specified type. The resulting product is determined as the probability that the candidate component symbol is of that specified type. If Q=0, then the type corresponding to the highest probability in the candidate component symbol type probability list is determined as the type of the candidate component symbol; if Q=1, then the probability that a candidate component symbol being directly connected to any specified type of component symbol stored in the preset connection relationship knowledge base is directly connected to the component symbol (i.e., the component symbol that is directly connected to the candidate component symbol) is determined as the probability that the candidate component symbol is of that specified type.

[0057] S340, determine the confidence level of the candidate element symbol as each specified type based on the probability of the candidate element symbol being each specified type and the probability of each specified type in the type probability list of the candidate element symbol, and determine the specified type with the highest confidence level as the type of the candidate element symbol; the probability of the candidate element symbol being any specified type is positively correlated with the confidence level of the candidate element symbol being that specified type, and the probability of any specified type in the type probability list of the candidate element symbol is positively correlated with the confidence level of the candidate element symbol being that specified type.

[0058] In one specific implementation, the confidence level of a candidate element symbol being of any specified type is the product of the probability of the candidate element symbol being of that specified type and a first preset weight, plus the product of the probability of that specified type in the type probability list of candidate element symbols and a second preset weight. The sum of the first preset weight and the second preset weight is 1, and both the first preset weight and the second preset weight are greater than 0. Optionally, the first preset weight and the second preset weight are empirical values, for example, both the first preset weight and the second preset weight are 0.5; or the first preset weight is 0.4 and the second preset weight is 0.6.

[0059] Based on S310-S340, this embodiment can determine the position and type of component symbols. In particular, when the symbol detection model is ambiguous in judging the type of component symbols, this embodiment can make further inferences based on the connection relationship of component types, thereby improving the accuracy of obtaining the type of component symbols.

[0060] As a specific implementation, S300 further includes: using a text detection model to identify the location of text regions in the target nuclear industry drawing in the second state, and using a text recognition model to obtain the content of each text region.

[0061] This embodiment identifies text in the target nuclear industry drawings in the second state, and can identify text more accurately.

[0062] In one specific implementation, the second preset information includes content and location coordinates.

[0063] Those skilled in the art will know that the process of identifying text in drawings is prior art. Optionally, a text detection model may be used to identify the location of text regions in a target nuclear industry drawing in a second state, and the content of each text region may be obtained using a text recognition model.

[0064] Those skilled in the art will know that a text detection model can be used to identify the bounding box coordinates of a text region. Optionally, the text recognition model can be an existing TrOCR or PP-OCR recognition module; the position coordinates of the bounding box are determined as the position coordinates of the corresponding text region.

[0065] S400 identifies lines in a target nuclear industry drawing in the third state and obtains the third preset information for each line.

[0066] In this embodiment, the target nuclear industry drawing in the third state is the target nuclear industry drawing obtained after masking the component symbols and text in the target nuclear industry drawing in the second state.

[0067] This embodiment identifies lines in target nuclear industry drawings in a third state without component symbols and text, making line identification easier and more accurate.

[0068] In one specific implementation, the third preset information includes position coordinates, line width, and line type.

[0069] Those skilled in the art will recognize that the process of identifying lines in a drawing is prior art. Optionally, a line detection model can be used to obtain the position coordinates of each line and the line width and line type of each line.

[0070] Those skilled in the art will understand that the process of obtaining the position and width of lines is prior art; optionally, the line detection model is the existing L-CNN model, which can detect each line and output the position coordinates of each line. For any detected line, the line width (i.e., the number of pixels in the vertical direction of the line) is calculated using pixel statistics, and solid lines, dashed lines, etc. are classified according to the dashed line pattern (calculating the interval ratio).

[0071] S500, redraw the nuclear industry drawings based on the metadata, the first preset information of each element symbol, the second preset information of each character, and the third preset information of each line.

[0072] Those skilled in the art will recognize that the process of redrawing nuclear industry drawings based on information extracted from individual elements is prior art. Optionally, S500 includes:

[0073] S510, Create a canvas based on the drawing dimensions in the metadata.

[0074] S520, draw lines on the canvas according to the third preset information of each line.

[0075] S530, insert a component symbol on the canvas according to the first preset information of each component symbol.

[0076] S540, Write text on the canvas according to the second preset information of each character.

[0077] S550, write the metadata into the information box in the lower right corner of the canvas.

[0078] S560 determines the final generated canvas as a redrawn nuclear industry blueprint.

[0079] As one specific implementation method, the redrawn nuclear industry drawings are in DXF format.

[0080] Based on S510-S560, it is possible to redraw nuclear industry drawings.

[0081] This embodiment sequentially identifies the lower right corner information box, outer border, component symbols, text, and lines in the target nuclear industry drawing. Compared with the existing method of directly using OCR to recognize nuclear industry drawings, this embodiment can effectively eliminate the mutual interference between different elements and provide a better and cleaner input environment for the recognition of each type of element. This is conducive to improving the accuracy of symbol recognition, text recognition, and line recognition, and thus improving the accuracy of the subsequently redrawn nuclear industry drawings.

[0082] Example 2:

[0083] Compared to Embodiment 1, this embodiment, based on Embodiment 1, further includes a process for automatically providing answers to users based on the target nuclear industry drawing and its corresponding document content. This process includes:

[0084] S600, construct a first knowledge graph of the target nuclear industry drawing based on the first preset information of the component symbols, the second preset information of the text, and the third preset information of the lines; the first knowledge graph includes the correspondence between component symbols and text, as well as the connection relationship between component symbols.

[0085] As one specific implementation, S600 includes:

[0086] S610, for any text, obtain the distance between the text box corresponding to the text and the component symbol box corresponding to each component symbol.

[0087] In this embodiment, the distance between the text box corresponding to any text and the element symbol box corresponding to any element symbol is the minimum distance between the text box corresponding to the text and the file symbol box corresponding to the element symbol.

[0088] S620, the component symbol corresponding to the component symbol box with the smallest distance is determined as the component symbol corresponding to the text, and the correspondence between component symbols and text is constructed to form the node attributes in the first knowledge graph.

[0089] In this embodiment, for any text, after obtaining the distance between the text box corresponding to the text and the component symbol box corresponding to each component symbol, the component symbol corresponding to the component symbol box with the smallest distance to the text box corresponding to the text is determined as the component symbol corresponding to the text. Thus, matching text and component symbols in the target nuclear industry drawing can be achieved.

[0090] In this embodiment, for any text, a correspondence is established between the text and the corresponding component symbol. In the first knowledge graph, the component symbol is a node, and the text corresponding to the component symbol is the attribute of the component symbol (the relationship between the component symbol and the attribute can also be stored through edges).

[0091] Based on S610-S620, the construction of nodes and node attributes in the first knowledge graph can be realized.

[0092] As one specific implementation, S600 includes:

[0093] S601, for any line, determine which element symbol box the start and end points of the line fall into or intersect with based on the coordinates of the start and end points of the line, and determine the element symbol box to which the start point of the line falls or intersects with the line as the first element symbol connected to the line, and determine the element symbol box to which the end point of the line falls or intersects with the line as the second element symbol connected to the line.

[0094] In this embodiment, if the start or end point of a line does not fall within any component symbol box and does not intersect with any component symbol box, the line is marked as an invalid line, a preset warning message is issued, and manual inspection is required.

[0095] S602, the connection relationship between the first element symbol and the second element symbol connected by the line is taken as an edge in the first knowledge graph, and the attribute of the edge is the information of the line.

[0096] Based on S601-S602, the construction of edges and edge attributes in the first knowledge graph can be realized.

[0097] S700, construct a second knowledge graph of the target nuclear industry drawing based on the target document; the target document is the explanatory document corresponding to the target nuclear industry drawing.

[0098] In this embodiment, the explanatory document corresponding to the target nuclear industry drawing is the instruction manual of the target nuclear industry drawing (including the parameters of the components, the connection relationship between the components, etc.). The first knowledge graph can be supplemented and corrected based on the explanatory document corresponding to the target nuclear industry drawing.

[0099] As one specific implementation, S700 includes:

[0100] S710 uses a named entity recognition model to identify entities in a target document that belong to the nuclear industry.

[0101] In this embodiment, the named entity recognition model has the ability to identify entities belonging to the nuclear industry from text, such as equipment names (e.g., main pumps, regulators, etc.) and component numbers (e.g., 1ELE-001). As a specific implementation, the named entity recognition model uses existing pre-trained language models (e.g., BERT, RoBERTa, ERNIE3.0, etc.) and fine-tunes the model on a self-built nuclear industry dataset, with the optimization objectives being entity boundary localization and entity type classification; during the inference phase, document sentences are input into the model, and the model outputs the entities and their types in each sentence.

[0102] S720 uses relation extraction techniques to extract relationships between entities from sentences in a target document.

[0103] In this embodiment, relation extraction technology is used to extract relationships between entities from sentences based on predefined or machine learning-derived relation patterns. As a specific implementation, a nuclear industry relation dataset is constructed, including defining domain relation types (such as material, parameter, function, connection, etc.). For example, for the sentence "The material of the pump is stainless steel," entity pairs (pump, stainless steel) and the relation (material is) are labeled. During model training, a named entity recognition model is first used to identify entities belonging to the nuclear industry domain in the sentence. Then, a BERT-based relation classification model (such as RE-BERT) is used, with the input being the sentence + entity pairs, and the output being the relation type. In the inference phase, the identified entity pairs belonging to the nuclear industry domain in the sentence are combined with the sentence input to the relation classification model, and the output is the relation between the entity pairs.

[0104] S730 constructs a second knowledge graph based on the extracted entities and the relationships between them.

[0105] In one specific implementation, the entities identified in S710 are used as nodes; the relationships extracted in S720 are used as edges to connect the corresponding entity nodes; thus, a second knowledge graph can be constructed.

[0106] Based on S710-S730, it is possible to construct a second knowledge graph corresponding to the explanatory documents of the target nuclear industry drawings.

[0107] S800 generates a nuclear industry knowledge base with a large language model based on the first and second knowledge graphs of the target nuclear industry drawings and the preset knowledge of the nuclear industry.

[0108] As one specific implementation, S800 includes:

[0109] S810, the first knowledge graph and the second knowledge graph are fused and mutually corrected to obtain a merged knowledge graph; the mutual correction includes: for any element symbol node in the first knowledge graph, obtaining other element symbol nodes connected to the element symbol node in the first knowledge graph and the second knowledge graph respectively; if the other element symbol nodes connected to the element symbol node in the first knowledge graph and the second knowledge graph are inconsistent, a preset warning message is issued.

[0110] In this embodiment, the fusion of the first knowledge graph and the second knowledge graph includes entity alignment and merging. The goal of entity alignment is to identify the same entity in the first and second knowledge graphs. The identification process includes comparing the attribute similarity (such as name, parameters, etc., which can be calculated using text similarity or cosine similarity) and connection relationship similarity between the two entities (the proportion of identical connections can be determined as connection relationship similarity; for example, if pump D in the first knowledge graph connects to valve B and container C, and pump D in the second knowledge graph connects to valve B and container E, then the connection relationship similarity is 1 / 2). The similarity between the two entities is determined based on the attribute similarity and connection relationship similarity (the average of attribute similarity and connection relationship similarity can be taken). Those skilled in the art know that existing knowledge fusion tools (such as Falcon and LIMES) can achieve automatic alignment. Optionally, the alignment threshold is set to 0.9, that is, two entities with a similarity greater than or equal to 0.9 are determined to be the same entity. Entity merging refers to merging the relationships of the same entity in the first and second knowledge graphs after entity alignment (e.g., in the first knowledge graph, pump D-parameter-flow rate 50m³ / h, and in the second graph, pump D-material-stainless steel, are merged into two types of edges of the same pump D node). If the same entity pair has the same relationship (e.g., both the first and second knowledge graphs have pump D-material-stainless steel), one edge is retained and the edge attributes are merged.

[0111] In this embodiment, based on mutual correction, conflict detection and reminders for targeted manual correction can be achieved, resulting in a merged knowledge graph with a large amount of information and high accuracy.

[0112] S820: Construct a basic knowledge graph based on the preset knowledge of the nuclear industry, and merge the basic knowledge graph with the merged knowledge graph to form a nuclear industry knowledge base.

[0113] In this embodiment, the pre-defined knowledge of the nuclear industry is the general common sense / standards in the nuclear industry field, which can come from industry standards, textbooks, and authoritative manuals.

[0114] In this embodiment, the process of constructing a basic knowledge graph based on the preset knowledge of the nuclear industry is similar to the process of constructing a second knowledge graph of the target nuclear industry drawings based on the target document, and will not be described again here.

[0115] In this embodiment, during the process of merging the basic knowledge graph with the merged knowledge graph, the general entities of the basic knowledge graph (such as centrifugal pumps) and the specific entities of the merged graph (such as pump D, which is a centrifugal pump) are aligned vertically (i.e., pump D is an instance of a centrifugal pump). The general relationships of the basic knowledge graph are added to the specific entities of the merged graph (e.g., centrifugal pump-common materials-stainless steel is added to pump D-common materials-stainless steel).

[0116] Based on S810-S820, this embodiment integrates the first knowledge graph (drawings), the second knowledge graph (documents), and nuclear industry preset knowledge to form a complete and relatively accurate knowledge base, providing data support for large language model question answering.

[0117] As a specific implementation method, a knowledge graph is also established based on other nuclear industry drawings and corresponding explanatory documents, and this established knowledge graph is also integrated into the nuclear industry knowledge base, thereby increasing the knowledge included in the nuclear industry knowledge base.

[0118] S900: Obtain the question input by the target user into the large language model, and use the large language model to query the answer corresponding to the question from the nuclear industry knowledge base.

[0119] As one specific implementation, S900 includes:

[0120] S910, Analyze the question input by the target user into the large language model, and determine whether the question includes multiple steps, multiple query entities or preset keywords.

[0121] As one specific implementation, the user input question is a basic question about the nuclear industry or a question about target nuclear industry drawings or other nuclear industry drawings.

[0122] As a specific implementation method, a large language model is invoked, and analysis is guided by prompt words. For example, prompt words include:

[0123] Please analyze the following question: {User Question}. You need to determine: 1. Whether it contains multiple query entities (e.g., multiple component names); 2. Whether it contains multiple query steps; 3. Whether it contains keywords (e.g., and, etc.). Output the analysis results.

[0124] S920, if so, then the problem is decomposed into several subproblems.

[0125] As a specific implementation method, the large language model is guided to decompose the problem into sub-problems when the above judgment result contains at least one "yes". For example, the prompt "Please decompose the above problem into independent sub-problems, and each sub-problem only queries one information point" can be used to guide the large model to decompose the problem into sub-problems.

[0126] In this embodiment, S920 further includes: if not, then using a large language model to directly obtain the answer to the question.

[0127] S930: Use a large language model to obtain the answer to each sub-question separately, and combine the answers to all sub-questions to obtain the answer to the question.

[0128] As a specific implementation, a large language model is used to integrate the results of all sub-questions into a natural language answer. For example, the large language model can be used to integrate the results of all sub-questions into a natural language answer by prompting the words "Please integrate the answers to the following sub-questions into a coherent answer".

[0129] Based on S910-S930, the answer to the user input question can be obtained. For complex user input questions (including multiple steps, multiple entities or preset keywords), the questions are first broken down before being answered, and then the answers are synthesized, which can improve the comprehensiveness and accuracy of the response to complex user input questions.

[0130] In addition to the advantages of Embodiment 1, this embodiment also generates a nuclear industry knowledge base based on the target nuclear industry drawings, corresponding explanatory documents, and preset knowledge of the nuclear industry. Based on this nuclear industry knowledge base, the large model can accurately answer user-inputted questions related to the nuclear industry. Compared with the existing technology of manually consulting drawings and explanatory documents, this embodiment realizes the automatic provision of answers to users based on nuclear industry drawings and corresponding document content.

[0131] Example 3:

[0132] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps:

[0133] S100: Identify the lower right corner information box in the target nuclear industry drawing in the initial state, obtain the meta-information of the target industry drawing based on the lower right corner information box, and perform a masking operation on the lower right corner information box to obtain the target nuclear industry drawing in the first state.

[0134] S200: Identify the outer border of the target nuclear industry drawing in the first state, and cover the outer border of the target nuclear industry drawing in the first state to obtain the target nuclear industry drawing in the second state.

[0135] S300, identify the component symbols and text in the target nuclear industry drawing in the second state, obtain the first preset information of each component symbol and the second preset information of each text, and cover the component symbols and text in the target nuclear industry drawing in the second state to obtain the target nuclear industry drawing in the third state.

[0136] S400 identifies lines in a target nuclear industry drawing in the third state and obtains the third preset information for each line.

[0137] S500, redraw the nuclear industry drawings based on the metadata, the first preset information of each element symbol, the second preset information of each character, and the third preset information of each line.

[0138] Example 4:

[0139] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:

[0140] S100: Identify the lower right corner information box in the target nuclear industry drawing in the initial state, obtain the meta-information of the target industry drawing based on the lower right corner information box, and perform a masking operation on the lower right corner information box to obtain the target nuclear industry drawing in the first state.

[0141] S200: Identify the outer border of the target nuclear industry drawing in the first state, and cover the outer border of the target nuclear industry drawing in the first state to obtain the target nuclear industry drawing in the second state.

[0142] S300, identify the component symbols and text in the target nuclear industry drawing in the second state, obtain the first preset information of each component symbol and the second preset information of each text, and cover the component symbols and text in the target nuclear industry drawing in the second state to obtain the target nuclear industry drawing in the third state.

[0143] S400 identifies lines in a target nuclear industry drawing in the third state and obtains the third preset information for each line.

[0144] S500, redraw the nuclear industry drawings based on the metadata, the first preset information of each element symbol, the second preset information of each character, and the third preset information of each line.

[0145] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0146] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims

1. A method for identifying nuclear industry drawings, characterized in that, The method includes the following steps: S100, identify the lower right corner information box in the target nuclear industry drawing in the initial state, obtain the meta-information of the target industry drawing based on the lower right corner information box, and perform a masking operation on the lower right corner information box to obtain the target nuclear industry drawing in the first state. S200, identify the outer border of the target nuclear industry drawing in the first state, and cover the outer border of the target nuclear industry drawing in the first state to obtain the target nuclear industry drawing in the second state. S300, identify the component symbols and text in the target nuclear industry drawing in the second state, obtain the first preset information of each component symbol and the second preset information of each text, and cover the component symbols and text in the target nuclear industry drawing in the second state to obtain the target nuclear industry drawing in the third state. S400 identifies lines in a target nuclear industry drawing in the third state and obtains third preset information for each line; S500, redraw the nuclear industry drawings based on the metadata, the first preset information of each element symbol, the second preset information of each text, and the third preset information of each line; The first preset information includes location information and type; S300 includes: S310, using a trained component symbol detection model to detect component symbols in the target nuclear industry drawing in the second state, and obtaining a position and type probability list for each component symbol in the target nuclear industry drawing in the second state; the type probability list includes the correspondence between component symbol type and probability; S320: Obtain the number of other probabilities in the candidate element symbol type probability list whose difference from the maximum probability is less than or equal to a preset probability threshold. If the number is 0, then determine the type corresponding to the maximum probability in the candidate element symbol type probability list as the type of the candidate element symbol; otherwise, proceed to S330; the candidate element symbol is any element symbol in the target nuclear industry drawing in the second state. S330: Obtain the component symbols in the target nuclear industry drawing in the second state that are directly connected to the candidate component symbols, and obtain the probability of the candidate component symbol being each specified type according to the component symbols with direct connections and the preset connection relationship knowledge base; the specified type is the type corresponding to the probability in the type probability list of candidate component symbols whose difference from the maximum probability is less than or equal to a preset probability threshold; the preset connection relationship knowledge base includes the probability of direct connection between different component symbols; wherein, if the number of component symbols directly connected to the candidate component symbols is Q, and Q≥2, then multiply the probability of the candidate component symbol being any specified type of component symbol stored in the preset connection relationship knowledge base by the probability of direct connection between each of the Q component symbols, and determine the product as the probability of the candidate component symbol being that specified type; S340, determine the confidence level of the candidate element symbol as each specified type based on the probability of the candidate element symbol being each specified type and the probability of each specified type in the type probability list of the candidate element symbol, and determine the specified type with the highest confidence level as the type of the candidate element symbol; the probability of the candidate element symbol being any specified type is positively correlated with the confidence level of the candidate element symbol being that specified type, and the probability of any specified type in the type probability list of the candidate element symbol is positively correlated with the confidence level of the candidate element symbol being that specified type.

2. The method for identifying nuclear industry drawings according to claim 1, characterized in that, In S100, the operation of covering the lower right corner information box includes: S110: Determine whether there is a horizontal line segment in the target nuclear industry drawing in the initial state that is connected to the bottom edge of the lower right corner information box. If so, retain the bottom edge when performing the cover operation on the lower right corner information box; otherwise, proceed to S120. S120, determine whether there is a vertical line segment in the target nuclear industry drawing in the initial state that connects to the right side of the lower right corner information box. If there is, retain the right side when performing the masking operation on the lower right corner information box; otherwise, perform the masking operation on the entire lower right corner information box.

3. The method for identifying nuclear industry drawings according to claim 2, characterized in that, The process of identifying the outer border of a target nuclear industry drawing in its first phase includes: S210, perform line recognition in the preset upper and lower regions of the target nuclear industry drawing in the first state. If there is a line whose length differs from the length of the target nuclear industry drawing in the first state by less than or equal to a preset length difference threshold, then determine that the line is the upper and lower outer border. S220, perform line recognition in the preset left and preset right regions of the target nuclear industry drawing in the first state. If there is a line whose length differs from the width of the target nuclear industry drawing in the first state by less than or equal to a preset width difference threshold, then determine that the line is the left or right outer border.

4. The method for identifying nuclear industry drawings according to claim 1, characterized in that, The S500 includes: S510, Create a canvas based on the drawing dimensions in the metadata; S520, Draw lines on the canvas according to the third preset information of each line; S530, insert the element symbol on the canvas according to the first preset information of each element symbol; S540, Write text on the canvas according to the second preset information of each text; S550, write the metadata into the information box in the lower right corner of the canvas; S560 determines the final generated canvas as a redrawn nuclear industry blueprint.

5. The method for identifying nuclear industry drawings according to claim 1, characterized in that, The third preset information includes location coordinates, line width, and line type.

6. The method for identifying nuclear industry drawings according to claim 5, characterized in that, The second preset information includes content and location coordinates.

7. The method for identifying nuclear industry drawings according to claim 6, characterized in that, S300 includes: using a text detection model to identify the location of text regions in a target nuclear industry drawing in a second state, and using a text recognition model to obtain the content of each text region.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the nuclear industry drawing identification method as described in any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the nuclear industry drawing identification method as described in any one of claims 1 to 7.