Ship design drawing structured vector analysis method and intelligent question and answer method

By employing text semantic classification, an improved KD-tree index, and Canberra distance optimization matching, the problems of text primitive recognition and spatial relationship modeling in ship electrical installation drawings were solved, achieving high-precision drawing parsing and intelligent question answering, and improving information utilization efficiency.

CN120997870APending Publication Date: 2025-11-21SANYA SCI & EDUCATION INNOVATION PARK WUHAN UNIV OF TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511238022.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing methods for parsing ship electrical installation drawings suffer from insufficient semantic recognition capabilities of text primitives, inaccurate spatial relationship modeling, inability to remove duplicate entities, and information redundancy, resulting in low efficiency in drawing information retrieval.

Method used

By employing text semantic classification, improved KD tree spatial indexing, Canberra distance optimization matching, and graph semantic fine-tuning strategies, we can achieve automatic extraction of drawing structure information and semantic question-and-answer interaction. We construct a drawing semantic graph through preprocessing, semantic classification, deduplication, and image recognition fusion.

Benefits of technology

It improves the accuracy and interactivity of drawing analysis, enhances the semantic parsing accuracy of cable numbers, function identifiers and view numbers, reduces information redundancy, and strengthens the retrieval and intelligent processing capabilities of drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997870A_ABST
    Figure CN120997870A_ABST
Patent Text Reader

Abstract

The invention provides a ship design drawing structured vector analysis method and an intelligent question and answer method. The method comprises the following steps: constructing a drawing primitive initial data set; generating a semantic annotation entity set; mapping the semantic annotation entity set to a two-dimensional coordinate system to generate a relation annotation entity pair set; repeated entities with the same semantic content and the coordinate position error lower than a set threshold value are removed, and an effective entity relation set is constructed; converting the effective entity relationship set into a structured semantic relationship set; inputting the drawing primitive initial data set into a neural network target detection model to generate an image recognition entity set; and fusing the structured semantic relationship set and the image recognition entity set to construct a drawing semantic map, finely adjusting the large language model, and outputting a text question and answer result. According to the method, ship drawing automatic analysis and semantic question and answer efficient fusion are realized, and the structure understanding precision and the interaction response capability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent semantic recognition, and in particular to a ship design drawing structural vector analysis method and an intelligent question and answer method. BACKGROUND

[0002] In the ship engineering design process, the electric installation drawing is widely used in the design expression and construction guidance of the cable arrangement, control line, equipment interface and other modules as a key design result file. The current mainstream ship electric installation drawing is saved in a two-dimensional CAD (Computer Aided Design) format, which includes a large amount of text and graphic elements, such as cable numbers, function identifiers, view numbers, installation positions and structure symbols.

[0003] The traditional drawing analysis work mainly relies on manual reading and labeling of elements, which is time-consuming and prone to problems such as missed recognition and misinterpretation. Especially in large-scale drawing centralized management and information intelligent retrieval based on drawings, the existing manual experience-dependent method is difficult to support efficient application scenarios.

[0004] In the prior art, one method attempts to detect the target of the element graphic in the drawing through image recognition technology, thereby extracting the symbol information with geometric contour; another method extracts the text element content and spatial coordinates based on the vector structure of the CAD file, which is used to construct a simple structured index. These methods have certain effect in extracting part of the element information, but there are still obvious defects: 1. The text element often lacks semantic recognition ability and cannot accurately distinguish the semantic roles of cable numbers, function identifiers, view numbers, etc., resulting in invalid subsequent structure analysis; 2. Most of the existing spatial relationship modeling methods stop at the coordinate distance discrimination level and cannot fuse semantic types and directions for accurate pairing; 3. There are repeated entities in the drawing due to drawing redundancy or copying operation, and the existing method cannot effectively remove the repeated entities, causing information redundancy and graph pollution; 4. The image recognition result and the structured semantic data lack unified representation and fusion mechanism, which hinders the construction of drawing semantic graph and the implementation of semantic question and answer system. SUMMARY

[0005] In view of the technical problems existing in the prior art, the present application provides a ship design drawing structural vector analysis method and an intelligent question and answer method, which realizes the automatic extraction of drawing structure information and semantic question and answer interaction by using text semantic classification, improved KD (K-dimensional) tree spatial index, Canberra distance optimization matching and graph semantic fine-tuning strategy, and has the advantages of high analysis precision, complete structure restoration and strong interaction intelligence.

[0006] The present application provides a ship design drawing structural vector analysis method, comprising:

[0007] Preprocessing design drawing data of a ship, and constructing a primitive data set of the design drawing data of the ship;

[0008] Performing semantic classification on the text primitives in the primitive data set to obtain semantic entities corresponding to the text primitives, and labeling the text primitives with corresponding semantic entities and two-dimensional coordinates to obtain a semantic labeled entity set;

[0009] Obtaining nearest neighbor semantic entities of each semantic entity according to the two-dimensional coordinates corresponding to each semantic entity in the semantic labeled entity set, and generating a relationship labeled entity pair set according to the nearest neighbor semantic entities of each semantic entity;

[0010] Considering semantic entities with the same semantic content and a coordinate position error lower than a set threshold in the relationship labeled entity pair set as repeated entities, performing a deduplication process on the repeated entities, and constructing an effective entity relationship set after deduplication;

[0011] Converting the effective entity relationship set into a structured knowledge expression, and constructing a structured semantic relationship set according to a (subject, predicate, object) triple format;

[0012] Inputting the primitive data set into a neural network target detection model to generate an image recognition entity set;

[0013] Fusing the structured semantic relationship set and the image recognition entity set to construct a drawing semantic graph.

[0014] According to the ship design drawing structured vector analysis method provided by the application, the preprocessing includes primitive format analysis, layer separation, primitive type screening, invalid primitive elimination and coordinate unified standardization operation; and / or,

[0015] The primitive data set includes the primitive content and two-dimensional coordinates of each primitive in the line segment primitive, the multi-segment line primitive, the circular primitive and the text primitive; and / or,

[0016] The semantic entities include cable number text, function identification text, view number text and part area text.

[0017] According to the ship design drawing structured vector analysis method provided by the application, the text primitives in the primitive data set are classified to obtain semantic entities corresponding to the text primitives, which includes:

[0018] Extracting text primitives with a primitive type of TEXT or MTEXT from the primitive data set;

[0019] The text content of the text graph element is matched with regular expressions corresponding to each semantic entity in a preset regular expression rule set;

[0020] If the matching is successful, the semantic entity corresponding to the regular expression that matches successfully is taken as the semantic entity corresponding to the text graph element;

[0021] If the matching fails, the text content of the text graph element is matched with keywords corresponding to each semantic entity in a preset semantic dictionary rule set, and the semantic entity corresponding to the keyword that matches successfully is taken as the semantic entity corresponding to the text graph element.

[0022] According to the ship design drawing structured vector analysis method provided by the application, the regular expression corresponding to the cable number text includes a cable identification string, a segment of numbers, a capital letter, a connector and a segment of numbers which are spliced in sequence;

[0023] The regular expression corresponding to the view number text includes a view identification string and a segment of numbers which are spliced in sequence;

[0024] The regular expression corresponding to the function identification text includes a group of capital letters, a connector and a segment of numbers which are spliced in sequence.

[0025] According to the ship design drawing structured vector analysis method provided by the application, the nearest neighbor semantic entity of each semantic entity is obtained according to the two-dimensional coordinates corresponding to each semantic entity in the semantic annotation entity set, including:

[0026] The two-dimensional coordinates corresponding to each type of semantic entity are normalized;

[0027] The normalized two-dimensional coordinates of the function identification text, the view number text and the part region text are respectively taken as the division dimension, and the semantic type label code is taken as the index additional field to construct an improved KD tree structure containing a type index domain;

[0028] The normalized two-dimensional coordinates of each cable number text are respectively executed in each improved KD tree structure -neighbor search, from each improved KD tree structure, respectively obtain k candidate semantic entities closest to the Canberra distance of each cable number text, k is a positive integer.

[0029] According to the ship design drawing structured vector analysis method provided by the application, the calculation formula of the Canberra distance is:

[0030]

[0031]

[0032] wherein,​ is the cth cable number text is the Canberra distance between the jth candidate semantic entity in each improved KD tree structure , is the type weight coefficient set according to the semantic type of , is the two-dimensional coordinate of , is the two-dimensional coordinate of , is the direction sensitivity adjustment coefficient represents an activation function is the direction coupling adjustment function.

[0033] According to the ship design drawing structural vector analysis method provided by the application, the nearest neighbor semantic entity of each semantic entity is used to generate a set of relationship annotation entity pairs, including:

[0034] The nearest neighbor semantic entity of each cable number text is used as the associated target of each cable number text;

[0035] If the candidate semantic entity is a part area text, the relationship type between the candidate semantic entity and the corresponding cable number text is "positioned in";

[0036] If the candidate semantic entity is a view number text, the relationship type between the candidate semantic entity and the corresponding cable number text is "associated view";

[0037] According to the association type, each cable number text and its associated target are combined into a semantic annotation entity pair to generate a set of relationship annotation entity pairs.

[0038] According to the ship design drawing structural vector analysis method provided by the application, the semantic entities in the set of relationship annotation entity pairs with the same semantic content and the coordinate position error less than a set threshold are regarded as repeated entities, and the repeated entities are processed to remove the repeated entities, and an effective entity relationship set after removing the repeated entities is constructed, including:

[0039] The semantic entities in the set of relationship annotation entity pairs are compared with each other, and if the text content of two semantic entities is the same, the coordinate position error of the two semantic entities is calculated;

[0040] If the coordinate position error of the two semantic entities is less than or equal to a first preset threshold, the semantic entity with higher semantic type priority is retained, and the other semantic entity is proposed;

[0041] If the coordinate position error of the two semantic entities is greater than the first preset threshold and less than or equal to a second preset threshold, a fusion coordinate position is generated according to the coordinate positions of the two semantic entities, a fusion semantic entity is constructed according to the text content, semantic type and fusion coordinate position of one of the two semantic entities, and the fusion semantic entity is added to the set of relationship annotation entity pairs, and the first preset threshold is less than the second preset threshold.

[0042] If the coordinate position error of the two semantic entities is greater than the second preset threshold and less than or equal to a third preset threshold, the two semantic entities are retained, and a "to be manually reviewed" mark field is added to the two semantic entities, and the second preset threshold is less than the third preset threshold.

[0043] The application also provides an intelligent question and answer method based on the above-mentioned any ship design drawing structured vector analysis method, comprising:

[0044] The drawing semantic atlas is input into the large language model that has been fine-tuned to perform semantic understanding and representation optimization, and knowledge injection is achieved through atlas node attribute coding and relationship path embedding mechanisms in the drawing semantic atlas.

[0045] After inputting a natural language question into the large language model, entity positioning and relationship retrieval are performed, and a text question and answer result related to the drawing content is output.

[0046] The ship design drawing structured vector analysis method and the intelligent question and answer method provided by the application automatically classify and semantically annotate the text graphics in the graphics initial data set to obtain a semantic annotation entity set, replacing manual recognition methods to improve the accuracy and consistency of text graphics semantic analysis; geometric proximity relationships between multiple categories of semantic entities are constructed according to the two-dimensional coordinates corresponding to each semantic entity in the semantic annotation entity set to form a set of relationship annotation entity pairs, improving the precision and robustness of entity matching; a drawing semantic atlas is constructed by fusing the structured semantic relationship set and the image recognition entity set to obtain more rich semantic information of the ship design drawing. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0048] Figure 1 is a flowchart of the ship design drawing structured vector analysis method provided by the application;

[0049] Figure 2 is a flowchart of the structured vector analysis method for ship design drawings provided by the present application;

[0050] Figure 3 is a flowchart of the structured vector analysis method for ship design drawings provided by the present application;

[0051] Figure 4 is a flowchart of the structured vector analysis method for ship design drawings provided by the present application;

[0052] Figure 5 is a flowchart of the intelligent question and answer method provided by the present application. DETAILED DESCRIPTION

[0053] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0054] Based on the above background, there is still a lack of a complete drawing analysis method that can combine drawing vector structure and image recognition information, support semantic classification, spatial reasoning, entity deduplication and question and answer interaction. In particular, in ship electrical installation drawings, there is a clear action logic between cable number and functional module, and the drawing structure should support automatic construction of semantic relationship and mapping to knowledge expression structure to improve the utilization efficiency of drawing information and the level of engineering automation. Therefore, how to provide a structured vector analysis method for ship design drawings and an intelligent question and answer system is a problem that those skilled in the art need to solve.

[0055] The present application has the following advantages:

[0056] The present application realizes automatic classification and semantic annotation of cable number text, functional identification text, view number text and part area text in ship electrical installation design drawings, constructs a semantic classification function through a preset regular expression rule and a semantic dictionary rule, replaces manual recognition mode, and improves the accuracy and consistency of text graph semantic analysis.

[0057] The present application proposes a semantic entity spatial relationship inference method based on an improved KD tree, combines a normalized coordinate mapping and a Canberra distance calculation mechanism, constructs geometric proximity relationships between multiple categories of semantic entities, supports semantic type sensitivity, direction weight control and error threshold determination, and improves the accuracy and robustness of entity matching.

[0058] The application fuses the structured semantic relationship set and the image recognition entity set to construct a blueprint semantic atlas, uses a large language model to perform semantic reasoning and question and answer output on the atlas data after fine tuning, establishes a closed loop structure from blueprint data to semantic interaction, and enhances the retrievability and intelligent processing capability of blueprint structure information.

[0059] The following will be described Figure 1 A ship design blueprint structured vector analysis method is described, comprising:

[0060] Step 101, preprocessing the design blueprint data of the ship, and constructing a primitive data set of the design blueprint data of the ship;

[0061] The primitive data set of the design blueprint data of the ship is generated by preprocessing the collected design blueprint data of the ship.

[0062] Step 102, performing semantic classification on the text elements in the primitive data set of the design blueprint data of the ship to obtain the semantic entities corresponding to the text elements, and labeling the corresponding semantic entities and two-dimensional coordinates of the text elements to obtain a semantic labeled entity set;

[0063] Based on the primitive data set of the design blueprint data of the ship, the text element classification processing is performed, the text elements are divided into four types of semantic entities, i.e., cable number text, function identification text, view number text and part area text, by a preset semantic classification function, the text type and two-dimensional coordinates are labeled, and a semantic labeled entity set is generated.

[0064] Step 103, obtaining the nearest neighbor semantic entities of each semantic entity according to the two-dimensional coordinates corresponding to each semantic entity in the semantic labeled entity set, and generating a relationship labeled entity pair set according to the nearest neighbor semantic entities of each semantic entity;

[0065] The coordinates of the semantic entities in the semantic labeled entity set are mapped to a two-dimensional coordinate system, a spatial index structure is constructed by the coordinates of the semantic entities, an improved KD tree is used to perform nearest neighbor search, a preset number of nearest neighbor semantic entities are matched for each cable number text entity, the Canberra distance is calculated according to the type and coordinate position of the semantic entities, and a relationship labeled entity pair set is generated.

[0066] Step 104, regarding the semantic entities with the same semantic content and the coordinate position error lower than a set threshold in the relationship labeled entity pair set as repeated entities, performing de-duplication processing on the repeated entities, and constructing an effective entity relationship set after de-duplication;

[0067] The repeated entities in the relationship labeled entity pair set are removed, the entities with the same semantic content and the coordinate position error lower than a set threshold are regarded as repeated entities, only the unique identification entities are retained, and an effective entity relationship set after de-duplication is constructed.

[0068] Step 105, converting the effective entity relationship set into a structured knowledge expression, and constructing a structured semantic relationship set according to a (subject, predicate, object) triple format;

[0069] For example, the subject is the text content of the cable number, the object is the text content of the function identification, view number or part area, and the predicate is the pre-defined relationship type of acting on, being located at or being associated with a view.

[0070] The structured knowledge expression specifically includes: after completing entity extraction and relationship inference, a triple structure is used as the final knowledge representation form, which includes: a subject entity such as a cable number entity; a relationship type with a value range of "acting on", "being located at" or "being associated with a view"; and an object entity corresponding to a function, part or view entity.

[0071] For example, for the relationship between "FB1A-150" and "grounding column SW-11" appearing in the drawing, the corresponding triple representation is ("FB1A-150", "acting on", "grounding column SW-11"), and the structured representation can be directly used as input data for subsequent knowledge graph construction, realizing automatic mapping from CAD drawings to semantic graphs.

[0072] Step 106, inputting the initial data set of the drawing elements into a neural network target detection model to generate an image recognition entity set;

[0073] The initial data set of the drawing elements is input into the neural network target detection model to detect image targets of components with graphic features in the drawing, extract the type identification and drawing coordinate position of the image targets, and generate an image recognition entity set.

[0074] The neural network target detection model is a multi-stage detection network containing a convolution feature extraction layer, a region proposal generation module and a class prediction head. The neural network target detection model takes the layer image generated from the initial data set of the drawing elements as input, extracts image feature maps through multi-scale convolution processing, outputs the region frame coordinates and confidence scores of the component graphic targets in the initial data set of the drawing elements, and outputs the target class labels in the class prediction head according to the component image class set defined in the training samples, forming an image recognition entity set containing region frame coordinates, class labels and confidence scores.

[0075] Step 107, fusing the structured semantic relationship set and the image recognition entity set to construct a drawing semantic graph.

[0076] The semantic atlas of the drawing is constructed, each cable number text and the associated function identification text, view number text, part area text and image recognized component target are uniformly represented as an entity node in the atlas, the atlas edge connection relationship is constructed according to the three types of relationships of 'acting on', 'positioning' and 'associated view', and the atlas data structure based on the subject-predicate-object three tuple extension structure is formed.

[0077] In the embodiment, the text component in the initial component data set is automatically classified and semantically annotated to obtain a semantic annotation entity set, manual identification is replaced, and the accuracy and consistency of semantic analysis of the text component are improved; geometric proximity relationships between multi-class semantic entities are constructed according to two-dimensional coordinates corresponding to each semantic entity in the semantic annotation entity set, a relationship annotation entity pair set is formed, and the precision and robustness of entity matching are improved; and a drawing semantic atlas is constructed by fusing the structured semantic relationship set and the image recognition entity set, and more rich semantic information of the ship design drawing is obtained.

[0078] On the basis of the above-mentioned embodiments, the preprocessing in the embodiment includes component format analysis, layer separation, component type screening, invalid component rejection and coordinate unification and standardization operations; and / or,

[0079] The component content and two-dimensional coordinates of each component in the initial component data set include line segment components, multi-segment line components, circular components and text components; and / or,

[0080] The semantic entities include cable number texts, function identification texts, view number texts and part area texts.

[0081] On the basis of the above-mentioned embodiments, as Figure 2 indicated, the text component in the initial component data set is semantically classified to obtain the semantic entity corresponding to the text component, including:

[0082] The text component with the component type of TEXT or MTEXT is extracted from the initial component data set;

[0083] The text content of the text component is matched with regular expressions corresponding to each semantic entity in a preset regular expression rule set;

[0084] If the matching is successful, the semantic entity corresponding to the matched regular expression is taken as the semantic entity corresponding to the text component;

[0085] If the matching fails, the text content of the text component is matched with keywords corresponding to each semantic entity in a preset semantic dictionary rule set, and the semantic entity corresponding to the matched keyword is taken as the semantic entity corresponding to the text component.

[0086] Each text element is represented as a triple . Wherein, represents a text content string in the text element, represents a layer name to which the text element belongs, represents a two-dimensional coordinate position of the text element in the drawing.

[0087] A semantic classification function is constructed, and the semantic classification function is based on a preset regular expression rule set and a semantic dictionary rule set Each text content is identified by type.

[0088] The semantic dictionary rule set may include a function keyword table and a structure part keyword table. Wherein, the function keyword table matches function identification text, and the structure part keyword table matches part area text.

[0089] Each text content is sequentially executed to obtain a corresponding result When a certain regular expression is met, a corresponding semantic type is directly assigned; if any regular rule is not met, keyword matching is performed in and a matching type label is assigned.

[0090] The embodiment realizes automatic classification and semantic annotation of cable number text, function identification text, view number text and part area text in a ship electrical equipment design drawing. A semantic classification function is constructed by a preset regular expression rule and a semantic dictionary rule, replacing manual identification mode, and improving the accuracy and consistency of text element semantic analysis.

[0091] On the basis of the above embodiment, the regular expression corresponding to the cable number text in the embodiment includes a cable identification string, a segment of numbers, a capital letter, a connector and a segment of numbers which are sequentially spliced.

[0092] The regular expression corresponding to the view number text includes a view identification string and a segment of numbers which are sequentially spliced.

[0093] The regular expression corresponding to the function identification text includes a group of capital letters, a connector and a segment of numbers which are sequentially spliced.

[0094] The regular expression rule set specifically includes:

[0095] Cable number matching rule ;

[0096] View number matching rule ;

[0097] function identification matching rule .

[0098] According to the classification result, the text graph element is divided into four types of semantic entities: cable number text , function identification text , view number text , and part area text , and a semantic annotation entity set is constructed .

[0099] On the basis of the above embodiment, as Figure 3 indicated, in the embodiment, the nearest neighbor semantic entity of each semantic entity is obtained according to the two-dimensional coordinates corresponding to each semantic entity in the semantic annotation entity set, comprising:

[0100] The two-dimensional coordinates corresponding to each type of semantic entity are normalized;

[0101] The normalized two-dimensional coordinates of the function identification text, the view number text, and the part area text are taken as the division dimensions, and the semantic type label code is taken as the index additional field to construct an improved KD tree structure containing a type index domain;

[0102] The normalized two-dimensional coordinates of each cable number text are respectively executed in each improved KD tree structure -neighbor search to obtain candidate semantic entities with the closest Canberra distance to each cable number text from each improved KD tree structure, k being a positive integer.

[0103] All semantic entities in the semantic annotation entity set are divided into three types of semantic entity sets, namely, function identification type, view number type, and part area type.

[0104] The coordinate normalization processing is performed on each type of semantic entity set, and the minimum-maximum normalization method is adopted to perform linear mapping on and to generate normalized coordinates , and the normalized coordinates and the semantic type label code are combined as a triple node representation .

[0105] An improved KD tree structure containing a type index domain is constructed with the normalized coordinates as the division dimensions and the semantic type label code as the index additional field, the component with the maximum coordinate variance is used as the division dimension of each layer, the recursive node insertion construction operation is performed, and the type label, the graph element number, and the original coordinate reference pointer are stored in each node

[0106] Normalized coordinates of each cable number text entity Respectively in three types of improved KD tree -Nearest neighbor search, set the maximum tree depth limit and node access limit during retrieval, record the retrieval path and visited node coordinates;

[0107] From the three KD trees, the Canberra distance closest to the cable number text entity is obtained The candidate semantic entity, extract the original coordinates, type label and semantic content, and generate the relationship annotation entity pair set.

[0108] The improved KD tree in this embodiment introduces semantic type label additional index, coordinate normalization mechanism and three types of semantic grouping structure, supports the efficient retrieval and semantic matching of cable number text entity in multi-class entity index tree, compared with the limitation of traditional KD tree only supporting single class coordinate index, which can improve the spatial reasoning efficiency and semantic accuracy.

[0109] On the basis of the above embodiment, the calculation formula of the Canberra distance in this embodiment is:

[0110]

[0111]

[0112] Among them, is the Canberra distance between the cth cable number text and the jth candidate semantic entity in each improved KD tree structure, is the type weight coefficient set according to the semantic type of , the two-dimensional coordinates of , the two-dimensional coordinates of , is the direction sensitivity adjustment coefficient, represents the activation function, is the direction coupling adjustment function.

[0113] As shown in Figure 4 , let the coordinates of the cable number text entity be , and the coordinates of the candidate semantic entity be . According to the coordinates of the cable number text entity and the coordinates of the candidate semantic entity, the direction coupling adjustment function is constructed.

[0114] According to the semantic type of the candidate semantic entity, the type weight coefficient is set, for example, the function identification text is set to , and the view number text is set to , the part area text is set as .

[0115] Based on the candidate semantic entity and the cable number text entity, the Canberra distance function is improved, and the improved Canberra distance function is set as .

[0116] The distances calculated by all candidate semantic entities and cable number text entities in each KD tree are sorted in ascending order, and the candidate semantic entity corresponding to the minimum distance is selected as the association target.

[0117] In this embodiment, the improved Canberra distance function combines the semantic type weight and the direction coupling adjustment factor, comprehensively considers the type sensitivity and the spatial distribution characteristics in the entity pairing process, can distinguish the direction difference and accurately control the relationship judgment, and compared with the traditional Euclidean or standard Canberra distance, improves the accuracy and adaptability of semantic association inference.

[0118] On the basis of the above-mentioned embodiments, in this embodiment, the relationship annotation entity pair set is generated according to the nearest neighbor semantic entities of each semantic entity, including:

[0119] The nearest neighbor semantic entity of each cable number text is taken as the association target of each cable number text;

[0120] If the candidate semantic entity is a part area text, the relationship type between the candidate semantic entity and the corresponding cable number text is “positioned in”;

[0121] If the candidate semantic entity is a view number text, the relationship type between the candidate semantic entity and the corresponding cable number text is “associated view”;

[0122] According to the association type, each cable number text and its association target are combined into a semantic annotation entity pair to generate a relationship annotation entity pair set.

[0123] On the basis of the above-mentioned embodiments, in this embodiment, the semantic entities with the same semantic content and the coordinate position error less than a set threshold in the relationship annotation entity pair set are regarded as repeated entities, the repeated entities are processed to remove the repeated entities, and an effective entity relationship set after removing the repeated entities is constructed, including:

[0124] The semantic entities in the relationship annotation entity pair set are compared with each other, if the text content of two semantic entities is the same, the coordinate position error of the two semantic entities is calculated;

[0125] If the coordinate position error of the two semantic entities is less than or equal to a first preset threshold, the semantic entity with higher semantic type priority is retained, and the other semantic entity is proposed.​

[0126] If the coordinate position error of the two semantic entities is greater than the first preset threshold and less than or equal to a second preset threshold, a fusion coordinate position is generated according to the coordinate positions of the two semantic entities, a fusion semantic entity is constructed according to the text content, semantic type and the fusion coordinate position of one of the two semantic entities, and the fusion semantic entity is added to the set of relationship annotation entity pairs, and the first preset threshold is less than the second preset threshold;

[0127] If the coordinate position error of the two semantic entities is greater than the second preset threshold and less than or equal to a third preset threshold, the two semantic entities are retained, and a "to be manually reviewed" mark field is added to the two semantic entities, and the second preset threshold is less than the third preset threshold.

[0128] All entities in the semantic annotation entity set are compared in pairs, and if the following conditions are met , the coordinate position error is calculated , wherein , .

[0129] A set of coordinate error classification threshold values is set , satisfying , and repeated classification is performed according to the value of :

[0130] If , it is marked as "highly overlapping repetition";

[0131] If , it is marked as "local overlapping repetition";

[0132] If , it is marked as "near neighbor similar repetition";

[0133] If , it is determined as a non-repeated entity.

[0134] According to the semantic type of the entity in the semantic annotation entity set , the semantic type priority order is set as:

[0135]

[0136] The following processing operations are performed for different repetition classifications:

[0137] For the "highly overlapping repetition" entity pair, the entity with higher semantic type priority is retained, and the other entity is removed;

[0138] For the "local overlapping repetition" entity pair, a fusion coordinate position is generated, and the text content is , semantic type is , construct fusion entity , join result set;

[0139] For "neighbor similar repetition" entity pairs, while retaining With Add a "to be manually reviewed" label field to each entity.

[0140] For entity pairs that do not belong to the three types of repetition, keep them as they are without processing.

[0141] All processed entities are constructed into a set of effective entity relationships after deduplication.

[0142] The embodiment is based on the improved KD tree semantic entity space relationship inference method, which combines the normalized coordinate mapping and Canberra distance calculation mechanism to construct the geometric proximity relationship between multi-category semantic entities, supports semantic type sensitive, direction weight control and error threshold determination, and improves the accuracy and robustness of entity matching.

[0143] As shown in Figure 5 , the embodiment provides an intelligent question and answer method based on the above ship design drawing structured vector analysis method, comprising:

[0144] Step 501, input the drawing semantic graph into the large language model that has completed fine tuning for semantic understanding and representation optimization, realize knowledge injection through the graph node attribute coding and relationship path embedding mechanism in the drawing semantic graph;

[0145] Step 502, after inputting the natural language question to the large language model, entity positioning and relationship retrieval are performed, and a text question and answer result related to the drawing content is output.

[0146] The structured semantic relationship set and the image recognition entity set are fused to construct a drawing semantic graph, and the large language model after training is used for semantic understanding fine tuning of the graph data, input of natural language questions and execution of semantic retrieval and relationship reasoning, and output of a text question and answer result related to the drawing content.

[0147] The embodiment fuses the structured semantic relationship set and the image recognition entity set to construct a drawing semantic graph, and uses the large language model after fine tuning to perform semantic reasoning and question and answer output on the graph data, establishes a closed-loop structure from the drawing data to the semantic interaction, and enhances the retrievability and intelligent processing capability of the drawing structure information.

[0148] In order to verify the feasibility of the application in implementation, the application is applied to a ship design drawing centralized management and analysis scene, and the task target is to automatically analyze the structure, extract the semantic relationship and support the atlas question and answer of a batch of two-dimensional CAD drawings including cable arrangement, function wiring, equipment installation and control view. The original data includes 230 DWG format drawings, and a large number of cable number texts, function identification texts, view number texts, part area description texts and various graphical symbol components are distributed in the drawings, and there are obvious problems of repeated annotation, graphical element intensive interference and non-standard layer structure. The accuracy of traditional manual reading and script extraction method is less than 80%, the entity relationship is broken, and the efficiency of drawing information archiving and engineering interaction quality is seriously affected.

[0149] In the implementation process, first, the drawing data is imported through the drawing acquisition module, and the standardized drawing element initial data set is constructed after preprocessing. Then the element classification module classifies all the TEXT and MTEXT elements, and identifies four types of semantic entities of cable number, function identification, view number and part area. The classification operation is automatically completed by combining the regular matching and semantic dictionary mechanism. In the sample set, 6842 cable number entities, 4231 function identification entities, 3172 view number entities and 2565 part area entities are extracted, and the classification accuracy is evaluated by manual sampling to reach 96.7%.

[0150] The drawing structure is complex, the entity relationship is overlapped and dense, and the spatial relationship inference becomes a key step. The application constructs an improved KD tree structure, constructs three types of spatial indexes according to semantic types, combines normalized coordinates and direction adjustment coefficients, and uses an improved Canberra distance to calculate entity pairing. In actual processing, the system completes spatial matching of 30486 pairs of cable number entities and other semantic entities, and the pairing accuracy evaluation accuracy is 93.8%. Among them, the relationship type identification accuracy is 94.3% for acting relationship, 91.2% for position relationship and 92.7% for associated view relationship. In the repeated entity processing module, a three-section error judgment and fusion strategy is introduced, and 754 groups of repeated entities are detected, including 263 groups of high coincidence repetition, 316 groups of local overlap repetition and 175 groups of near neighbor similar repetition. Through the deduplication strategy, an effective entity set is constructed, and the data redundancy rate is reduced by 18.6%.

[0151] Under the support of the neural network target detection model, the input layer renders an image, and a region containing a component symbol is identified. The output image identifies an entity number accumulation of 6219, and the image target identification accuracy reaches 92.1%, which is improved by 13.5 percentage points compared with the traditional graph block matching mode. Finally, the structured semantic relationship set and the image recognition entity set are fused to construct a drawing semantic graph, and after the graph-driven large language model fine-tuning processing, a natural language question and answer system is constructed. The user inputs "FB1A-110 connected device" and "FB2C-305 view number" in the question and answer interface, and the system can give the correct answer within 1.3 seconds, with an answer accuracy of 94.6%, and the artificial review satisfaction score is 4.7 points, of which the full score is 5 points. Table 1 is the accuracy index and processing quantity statistics of the key processing links in the drawing set analysis process.

[0152] Table 1 Key processing index statistics table for structured analysis and intelligent question and answer of ship design drawings

[0153]

[0154] According to the data shown in Table 1, the performance and technical effects of the present application in the actual drawing analysis scene can be systematically analyzed.

[0155] In the text graph semantic classification stage, a total of 6842 cable number texts, 4231 function identification texts, 3172 view number texts, and 2565 part area texts are identified, and the overall classification accuracy is maintained above 94%, indicating that the semantic classification function based on regular expressions and semantic dictionaries has good adaptability and stability in structural electrical drawings. High recognition rate effectively ensures the data basis of the subsequent structure construction process.

[0156] In the spatial relationship inference process, the improved KD tree combines the Canberra distance to complete 30486 pairs of semantic entity pairing, and the pairing accuracy reaches 93.8%. In the further refined semantic relationship identification, the "acts on" relationship identification accuracy is 94.3%, the "position in" relationship is 91.2%, and the "associated view" relationship is 92.7%, which verifies that the multi-type spatial index and improved distance mechanism constructed by the present application still has high reliability under complex layout conditions.

[0157] For the redundant entity problem in the drawing, the three-section error threshold judgment mechanism proposed by the present application identifies 263 groups of high coincidence and repetition, 316 groups of local overlap and repetition, and 175 groups of near neighbor similar repetition. Through the fusion, elimination and marking strategy, effective entity deduplication is realized, the redundancy degree of the graph structure is reduced, and the entity data redundancy rate is reduced by 18.6%.

[0158] The image recognition part identifies 6219 graphic targets based on a neural network target detection model, with an accuracy of 92.1%, which is 13.5 percentage points higher than that of a traditional graphic element recognition method, and improves the coverage range and entity completeness of the atlas structure. In the verification of the question and answer system, the average response time of the system is 1.3 seconds after the user inputs a natural language question, the question and answer accuracy reaches 94.6%, and the artificial review satisfaction score is 4.7 out of 5, which reflects the practicability and response speed of the atlas-driven large language model in the drawing scenario.

[0159] Overall, the above data shows that the structured drawing analysis process proposed by the present application has high accuracy and engineering feasibility in text processing, spatial matching, duplicate removal, image recognition, and semantic question and answer in each link, and can effectively replace traditional manual reading methods to realize automatic structured and semantic understanding of drawing data.

[0160] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.​​

Claims

1. A method for structured vector analysis of ship design drawings, characterized in that, include: Preprocess the ship design drawing data to construct an initial dataset of graphic elements from the design drawing data; Semantic classification is performed on the text primitives in the initial dataset of primitives to obtain the semantic entities corresponding to the text primitives, and the semantic entities and two-dimensional coordinates of the text primitives are labeled to obtain a set of semantic labeled entities; The nearest neighbor semantic entity of each semantic entity is obtained based on the two-dimensional coordinates corresponding to each semantic entity in the semantic annotation entity set, and a set of relation annotation entity pairs is generated based on the nearest neighbor semantic entities of each semantic entity. Semantic entities with the same semantic content and coordinate position error below a set threshold in the relation-annotated entity pair set are considered duplicate entities. The duplicate entities are deduplicated to construct a set of valid entity relations after deduplication. The set of effective entity relations is converted into a structured knowledge representation, and a set of structured semantic relations is constructed based on the subject, predicate, and object triple format. The initial dataset of primitives is input into the neural network object detection model to generate a set of image recognition entities; The structured semantic relationship set and the image recognition entity set are fused together to construct a drawing semantic graph.

2. The structured vector analysis method for ship design drawings according to claim 1, characterized in that, The preprocessing includes primitive format parsing, layer separation, primitive type filtering, invalid primitive removal, and coordinate standardization; and / or, The initial dataset of primitives includes the primitive content and two-dimensional coordinates of each primitive in line segment primitives, polyline primitives, circular primitives, and text primitives; and / or, The semantic entities include cable number text, function identifier text, view number text, and location area text.

3. The structured vector analysis method for ship design drawings according to claim 2, characterized in that, Semantic classification is performed on the text primitives in the initial dataset of primitives to obtain the semantic entities corresponding to the text primitives, including: Extract text primitives of type TEXT or MTEXT from the initial primitive dataset; The text content of the text primitive is matched with the regular expression corresponding to each semantic entity in the preset regular expression rule set; If a match is successful, the semantic entity corresponding to the matching regular expression will be used as the semantic entity corresponding to the text primitive. If the match fails, the text content of the text element is matched with the keywords corresponding to each semantic entity in the preset semantic dictionary rule set, and the semantic entity corresponding to the successfully matched keyword is taken as the semantic entity corresponding to the text element.

4. The structured vector analysis method for ship design drawings according to claim 3, characterized in that, The regular expression corresponding to the cable number text includes a cable identification string concatenated sequentially, a number, a capital letter, a connector, and another number; The regular expression corresponding to the view number text includes a view identifier string concatenated sequentially and a number; The regular expression corresponding to the function identifier text includes a set of uppercase letters, a connector, and a string of numbers concatenated in sequence.

5. The structured vector analysis method for ship design drawings according to claim 2, characterized in that, Based on the two-dimensional coordinates corresponding to each semantic entity in the semantically labeled entity set, the nearest neighbor semantic entities of each semantic entity are obtained, including: Normalize the two-dimensional coordinates corresponding to various semantic entities; An improved KD tree structure containing a type index field is constructed by using the normalized two-dimensional coordinates of the function identifier text, view number text, and part area text as the division dimensions, and the semantic type label encoding as the index additional field. The normalized two-dimensional coordinates of each cable number text are executed in each improved KD-tree structure. - Nearest neighbor search: Obtain the Canberra distance closest to each cable number text from each improved KD tree structure. There are 10 candidate semantic entities, where k is a positive integer.

6. The structured vector analysis method for ship design drawings according to claim 5, characterized in that, The formula for calculating the distance to Canberra is: ; ; in, Text for the c-th cable number With the j-th candidate semantic entity in each improved KD-tree structure The distance between them to Canberra According to The semantic type sets the type weight coefficient. The two-dimensional coordinates are , The two-dimensional coordinates are , This is the direction sensitivity adjustment coefficient. This represents the activation function. This is the directional coupling adjustment function.

7. The structured vector analysis method for ship design drawings according to claim 5, characterized in that, Generate a set of relation-annotated entity pairs based on the nearest neighbor semantic entities of each semantic entity, including: The nearest neighbor semantic entity of each cable number text is used as the association target of each cable number text; If the candidate semantic entity is a part region text, then the relationship type between the candidate semantic entity and the corresponding cable number text is "located at"; If the candidate semantic entity is a view number text, then the relationship type between the candidate semantic entity and the corresponding cable number text is "associated view"; Based on the association type, each cable number text and its associated target are combined into semantically labeled entity pairs to generate a set of relationally labeled entity pairs.

8. The structured vector analysis method for ship design drawings according to claim 1, characterized in that, Semantic entities in the relation-annotated entity pair set that have the same semantic content and coordinate position error below a set threshold are considered duplicate entities. These duplicate entities are then deduplicated to construct a deduplicated set of valid entity relations, including: The semantic entities in the set of relation-labeled entities are compared pairwise. If the text content of two semantic entities is the same, the coordinate position error of the two semantic entities is calculated. If the coordinate position error between the two semantic entities is less than or equal to the first preset threshold, then the semantic entity with the higher semantic type priority among the two semantic entities is retained, and the other semantic entity is proposed. If the coordinate position error between the two semantic entities is greater than the first preset threshold and less than or equal to the second preset threshold, then a fused coordinate position is generated based on the coordinate positions of the two semantic entities. Based on the text content, semantic type, and fused coordinate position of one of the two semantic entities, a fused semantic entity is constructed and added to the relation annotation entity pair set. The first preset threshold is less than the second preset threshold. If the coordinate position error of the two semantic entities is greater than the second preset threshold and less than or equal to the third preset threshold, then the two semantic entities are retained, and a "awaiting manual review" marker field is added to the two semantic entities. The second preset threshold is less than the third preset threshold.

9. An intelligent question-answering method based on the structured vector analysis method for ship design drawings according to any one of claims 1-8, characterized in that, include: The semantic graph of the drawing is input into the finely tuned large language model for semantic understanding and representation optimization. Knowledge injection is achieved through the graph node attribute encoding and relation path embedding mechanism in the semantic graph of the drawing. After inputting a natural language question into the large language model, entity localization and relation retrieval are performed, and text-based question-and-answer results related to the drawing content are output.

Citation Information

Cited By

  • Document layout analysis and reconstruction method based on vector topology and conflict arbitration

    CN121683750A

  • Chemical PID drawing structured extraction method based on large language model

    CN122067269A

  • A Modeling Method for Offshore Substations Based on Intelligent Drawing Analysis

    CN122413769A

  • A marine booster station modeling method based on blueprint intelligent analysis

    CN122413769B