Drawing automatic auditing method and device and electronic equipment

By parsing CAD vector files and process card files to generate feature tensors, and using multi-head cross-attention neural networks and knowledge graphs for automatic review, the problems of low efficiency and high miss rate of manual review are solved, and efficient and automatic drawing review is achieved.

CN122116405APending Publication Date: 2026-05-29CHENGDU DAWEI SMART MFG CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU DAWEI SMART MFG CO LTD
Filing Date
2026-02-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In the discrete manufacturing industry of leather and sheet materials, the review of engineering drawings and process cards relies on manual comparison, resulting in low review efficiency, high omission rate and high rule maintenance cost, making it impossible to form a closed loop of continuous optimization.

Method used

By acquiring CAD vector files and process card files, geometric feature tensors and process feature tensors are generated through parsing. End-to-end fusion learning is performed using a multi-head cross-attention neural network, and natural language explanations are generated by combining the geometry-process knowledge graph. User correction commands are received in the CAD interactive interface to achieve online fine-tuning.

Benefits of technology

It improved the efficiency of drawing review, reduced the rate of missed judgments, and made the rule maintenance cost close to zero, thus realizing the automation and continuous optimization of drawing review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122116405A_ABST
    Figure CN122116405A_ABST
Patent Text Reader

Abstract

The application provides a kind of drawing automatic auditing method, device and electronic equipment.The method is by simultaneously sending CAD vector geometric feature tensor G and the process feature tensor P of process card file into multi-head cross attention network, realize the joint modeling of millimeter level geometric precision and natural language process constraint, both can realize the automatic auditing of drawing, improve the problem of low efficiency, high rate of missed judgment of manual auditing drawing, also can completely get rid of the path dependence of traditional OCR and rule base.And adopt the strategy of elastic weight consolidation, only fine-tune network last two layers, continuously absorb user correction instruction, further reduce the rate of missed judgment of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of drawing review, and more specifically, to an automatic drawing review method, apparatus, and electronic equipment. Background Technology

[0002] In discrete manufacturing industries such as leather and sheet metal, engineering drawings and process cards are maintained independently by the design and process departments, respectively. Drawings use CAD vector format to represent geometric elements such as holes, slots, and bending lines; process cards specify parameters such as material thickness, upper limit of punching dies, environmental protection level, and material utilization rate in Excel / JSON format. Currently, the review process still relies on manual comparison: manual verification of geometric dimensions across drawings; manual judgment of compliance against process cards; verbal or email feedback and modifications upon discovery of conflicts, without leaving a trace; and frequent changes in rules with process upgrades, requiring manual updates.

[0003] Therefore, relying on manual review of drawings leads to low review efficiency, high omission rate, high rule maintenance cost, and the inability to form a closed loop of continuous optimization. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide an automatic drawing review method, apparatus and electronic device to improve the technical problems of low efficiency and high omission rate of manual drawing review.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: Firstly, this application provides a method for automatic drawing review, including: S1. Obtain the CAD vector file to be reviewed and its corresponding process card file; S2. Parse the geometric primitives in the CAD vector file to generate a geometric feature tensor G; S3. Parse the process parameters in the process card file and generate the process feature tensor P; S4. Input the geometric feature tensor G and the process feature tensor P into a multi-head cross-attention neural network and output the anomaly probability vector A. S5. Based on the anomaly probability vector A, locate the abnormal graphic elements and abnormal process fields, and generate an anomaly list L; S6. Call the pre-built geometry-process knowledge graph to generate natural language explanation text E for the anomaly list L; S7. Visualize the anomaly list L and the explanatory text E on the CAD interactive interface, and receive user correction instructions; S8. Using the correction instructions and the corresponding {G, P, A} as incremental samples, fine-tune the multi-head cross-attention neural network online.

[0006] Optionally, S2 includes: The vector parsing engine is used to read line segments, arcs, circles, and polylines from the CAD vector file. Perform topological reconstruction on the line segments, arcs, circles, and polylines to obtain closed contours; Extract the geometric parameters of each closed contour and encode the geometric parameters into a geometric feature tensor G, wherein the geometric parameters include at least primitive type, center coordinates, size and layer identifier.

[0007] Optionally, S3 includes: The BERT-BiLSTM-CRF cascade model was used to perform sequence annotation on the process card file and extract numerical process parameters. The numerical process parameters are normalized and mapped to a unified dimension to generate a process feature tensor P, wherein the numerical process parameters include at least material thickness, upper limit of punching die, environmental protection level and material utilization rate.

[0008] Optionally, the multi-head cross-attention neural network includes: A graph neural network encoder is used to aggregate the adjacency relationships of geometric primitives and output geometric embeddings. The Transformer encoder is used to encode global features of process parameters and outputs process embeddings. A K-head cross-attention layer, where K is an integer from 4 to 8, is used to fuse the geometric embedding and the process embedding; The feedforward decoding layer is used to output the anomaly probability vector A.

[0009] Optionally, the graph neural network encoder is selected from GraphSAGE or GAT, and the hidden layer dimension is set to 64-256.

[0010] Optionally, S5 includes: Calculate the attention weight matrix W; Mark the process field corresponding to the maximum value in each row of matrix W as an abnormal process field, and mark the element index corresponding to the maximum value in each column as an abnormal element, so as to generate an abnormal list L.

[0011] Optionally, S6 includes: Use SPARQL to query a pre-built geometry-process knowledge graph to obtain the RDF triples corresponding to the anomaly list L; The RDF triples are filled into a preset natural language template to generate a natural language interpretation text E.

[0012] 8. The method according to claim 1, wherein step S8 comprises: The correction instructions and their corresponding {G, P, A} are stored in the experience replay buffer, with the buffer capacity set to 500-2000 entries. When the number of samples in the buffer reaches 100, it is 1×10 -5 Up to 1×10 -3 The learning rate is used to fine-tune the parameters of the last two layers of the multi-head cross-attention neural network; A flexible weight consolidation strategy is adopted, wherein the flexible weight consolidation coefficient λ ranges from 10. 3 Up to 10 5 To suppress catastrophic forgetting.

[0013] Secondly, embodiments of this application provide an automatic drawing review device, comprising: The file acquisition module is used to acquire the CAD vector files to be reviewed and their corresponding process card files. The vector parsing module is used to parse the geometric primitives in the CAD vector file and generate a geometric feature tensor G. The process coding module is used to parse the process parameters in the process card file and generate a process feature tensor P; The fusion review module is used to input the geometric feature tensor G and the process feature tensor P into a multi-head cross-attention neural network and output an anomaly probability vector A. The anomaly localization module is used to locate abnormal graphic elements and abnormal process fields based on the anomaly probability vector A, and generate an anomaly list L; An explanation generation module is used to call a pre-built geometry-process knowledge graph to generate natural language explanation text E for the anomaly list L; The interactive correction module is used to visualize the anomaly list L and the explanatory text E on the CAD interactive interface and to receive user correction instructions. An online learning module is used to fine-tune the multi-head cross-attention neural network online by using the correction instructions and the corresponding {G, P, A} as incremental samples.

[0014] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a computer program, and the processor executing the program to implement the method described in the first aspect.

[0015] In the method described in the first aspect above, the following can be understood: This application provides an automated drawing review method that simultaneously acquires CAD vector files and their corresponding process card files, unifying the two previously separate data sources into a unified processing flow. This eliminates the obstacle of manually switching between the two documents for comparison. It directly parses CAD vector primitives and generates a geometric feature tensor G, preserving the original vector accuracy and avoiding pixel-level errors associated with OCR. By parsing the process card file and generating a process feature tensor P, it quantifies natural language constraints into computable dimensions. An end-to-end fusion learning of the geometric feature tensor G and the process feature tensor P is performed using a multi-head cross-attention neural network, replacing manually written "aperture-mold upper limit" rules. This expands the coverage of coupling relationships from "human-enumerable" to "data-coverable," bringing rule maintenance costs close to zero. Based on an attention weight matrix, it performs bidirectional localization of abnormal primitives and abnormal process fields, improving localization accuracy from manual visual inspection to the maximum weight value. Finally, it calls a geometry-process knowledge graph to generate natural language explanation text E, transforming "dimensional deviation" into something like "aperture 3.2 mm is greater than the mold upper limit of 3.0 mm." The system provides readable information ("mm"); receives user correction instructions through the CAD interactive interface; and structurally saves each manual decision. It utilizes incremental samples for online network fine-tuning and employs an elastic weight consolidation strategy to prevent catastrophic forgetting, allowing the model to continuously evolve with the accumulation of correction data. This application effectively improves the efficiency of drawing review and reduces the rate of missed judgments.

[0016] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, embodiments of this application are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A structural block diagram of an automatic drawing review device provided in this application embodiment; Figure 2 A flowchart illustrating an automatic drawing review method provided in this application embodiment; Figure 3 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0022] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.

[0023] This application provides a technical solution, including: an automatic drawing review method, apparatus, and electronic equipment. The technical solution provided by this application will be described below with reference to the accompanying drawings.

[0024] Please see Figure 1 First, this application introduces an automatic drawing review device provided in its embodiments, which includes: The file acquisition module 100 is used to acquire the CAD vector file to be reviewed and its corresponding process card file; Vector parsing module 200 is used to parse geometric primitives in CAD vector files and generate geometric feature tensors G. The process coding module 300 is used to parse the process parameters in the process card file and generate the process feature tensor P. The fusion review module 400 is used to input the geometric feature tensor G and the process feature tensor P into a multi-head cross-attention neural network and output an anomaly probability vector A. Anomaly localization module 500 is used to locate abnormal graphic elements and abnormal process fields based on the anomaly probability vector A, and generate an anomaly list L. The explanation generation module 600 is used to call the pre-built geometry-process knowledge graph to generate natural language explanation text E for the anomaly list L; The interactive correction module 700 is used to visualize the exception list L and the explanatory text E on the CAD interactive interface and to receive user correction instructions. The online learning module 800 is used to fine-tune the multi-head cross-attention neural network online by taking the correction instructions and the corresponding {G, P, A} as incremental samples.

[0025] It should be noted that each module communicates with the memory, processor, and external CAD workstation via a high-speed system bus.

[0026] For example, the file acquisition module may have a gigabit Ethernet interface and a USB 3.0 port, supporting batch import of files in formats such as DWG / DXF / JSON / Excel. The file acquisition module can use an open-source CAD parsing library (such as libopencad) and an open-source parsing software development kit (SDK) to complete file integrity verification, then store the CAD vector files in the original file buffer 110A and the process card files in the original file buffer 110B.

[0027] The vector parsing module may include a primitive reading subunit 102A, a topology reconstruction subunit 102B, and a tensor quantization subunit 102C. The primitive reading subunit 102A is used to call the software development kit (Teigha / RealDWG SDK) of a commercial CAD parsing engine to read line segments, arcs, circles, and polylines. The topology reconstruction subunit 102B, based on the Topology Wire (TopoDS_Wire) and Topology Face (TopoDS_Face) interfaces of the open-source geometric modeling kernel (OpenCASCADE), closes discrete edges into holes, slots, and external contours. The tensor quantization subunit 102C encodes the geometric parameters (such as type, center coordinates, dimensions, and layer ID) of each closed contour into N×d values. G The geometric feature tensor G is stored in the tensor buffer 110C.

[0028] The process coding module can utilize multi-core CPU parallelism and has at least 32GB of memory. The process coding module may include a text parsing subunit 103A and a normalization subunit 103B. The text parsing subunit 103A integrates HuggingFace's BERT-base-Chinese (Chinese pre-trained language model), BiLSTM (Bidirectional Long Short-Term Memory), and CRF (Conditional Random Field) inference engine to extract material thickness, mold upper limit, environmental protection level, and material utilization rate from Excel / JSON. The normalization subunit 103B maps the numerical field Min-Max to [0,1], generating a 1×d... P The process feature tensor P is stored in the tensor buffer 110D.

[0029] The fusion auditing module may include a graph neural network subunit 104A, a transformer subunit 104B, and a cross-attention subunit 104C. The graph neural network subunit 104A is either GraphSAGE or GAT, with a hidden layer dimension of 128, outputting a 128-dimensional geometric embedding. The transformer subunit 104B has 6 layers of a transformer network, outputting a 128-dimensional process embedding. The cross-attention subunit 104C has multi-head attention, outputting an anomaly probability vector A, which is stored in the anomaly buffer 110E.

[0030] The anomaly localization module can be executed on a single CPU core and includes a weighted backtracking subunit 105A and a list generation subunit 105B. The weighted backtracking subunit 105A calculates the attention weight matrix W to locate the abnormal process field and abnormal primitive corresponding to the maximum row / column value. The list generation subunit 105B generates an anomaly list L in JSON format, which is then sent to the interpretation and generation module via a bus.

[0031] The explanation generation module can use a 1TB SSD cache to store the knowledge graph. The explanation generation module can include a graph query subunit 106A and a template filling subunit 106B. The graph query subunit 106A uses the SPARQL endpoint (SPARQL is a protocol) provided by Apache Jena Fuseki (an open-source RDF server) to query RDF triples. The template filling subunit 106B fills the query results into a preset natural language template, outputs the explanation text E, and stores it in the text cache 110F.

[0032] The interactive correction module's human-machine interface uses Qt-based graphical controls and embeds the AutoCAD.NET API. This module includes a visualization subunit 107A and a command receiving subunit 107B. The visualization subunit 107A highlights abnormal primitives in the AutoCAD viewport and displays an explanatory text E in a pop-up dialog box. The command receiving subunit 107B captures user commands for "one-click correction" or "manual dimension change," packages the new geometric / manufacturing values ​​along with the original {G,P,A} values ​​into an incremental sample, and transmits it to the online learning module.

[0033] The online learning module can utilize dedicated GPU memory with a capacity of at least 24 GB for fine-tuning. The online learning module may include an experience replay subunit 108A and a fine-tuning subunit 108B. The experience replay subunit 108A has a circular buffer with a capacity of 1024 records, managing incremental samples in FIFO (First-In, First-Out) mode. FIFO is a data management strategy where the earliest written sample is removed or overwritten first, ensuring that the latest manually corrected data is always used during incremental learning. The fine-tuning subunit 108B is used when the number of samples is ≥100, employing the AdamW optimizer and a learning rate of 5×10⁻⁶. -4 λ=1×10 4 The elastic weight consolidation strategy only updates the parameters of the last two layers of the fusion audit module; after the update is completed, the new weights are immediately written back to the model parameter area 110G. The AdamW optimizer separates regularization (weight decay) from gradient updates based on the traditional Adam, preventing overfitting with large weights, and is widely used for fine-tuning in deep learning.

[0034] It should be noted that λ is the weight decay coefficient, which represents the strength of regularization. A larger λ results in a heavier penalty for perturbations of old parameters, making the network more "conservative"; a smaller λ allows for larger parameter updates, making the network more "flexible." For example, λ can be set to 1 × 10⁻⁶. 4 This indicates a moderately strong retention rate for older tasks. The learning rate refers to the "learning step size" or "step factor." In the AdamW optimizer, the learning rate is 5 × 10⁻⁶ for example. -4 The learning rate represents the relative magnitude of the advance along the gradient direction during each parameter update, and can be used to determine the convergence speed and stability. A large learning rate indicates fast convergence but a tendency to oscillate; a small learning rate indicates slow convergence but greater stability.

[0035] The automatic drawing review device provided in this embodiment utilizes a file acquisition module to simultaneously access CAD vectors and process cards, eliminating the obstacle of manual comparison between the two documents. The vector parsing module directly reads the original vector primitives and generates geometric feature tensors, avoiding OCR errors. The process encoding module quantizes the text process card into process feature tensors, aligning heterogeneous data in a unified tensor space for the first time. The fusion review module uses a multi-head cross-attention network to learn geometric-process coupling constraints in one go, replacing easily invalidated manual rules. The anomaly localization module maps anomalies to both primitives and process fields simultaneously through attention weight backtracking, improving localization accuracy from human-eye level to maximum weight. The explanation generation module calls a knowledge graph to output natural language explanations, eliminating the need for manual template writing. The interactive correction module structurally saves each manual click as an incremental sample. The online learning module uses the AdamW optimizer and elastic weight consolidation strategy to fine-tune only the last two layers, achieving "learning while reviewing." As corrected samples accumulate, the overall review time of the device gradually shortens, the false negative rate gradually decreases, and no further manual rule maintenance is required, thus solving the problems of low efficiency, rule invalidation, and insufficient knowledge accumulation raised in the background technology in one go.

[0036] Please see Figure 2 In some embodiments, this application provides an automatic drawing review method, including: S1. Obtain the CAD vector file to be reviewed and its corresponding process card file.

[0037] In this embodiment, a CAD vector file in dwg format and an .xlsx process card file in the same directory are first read in simultaneously through a standard file interface. The two files constitute all the inputs required for step S1.

[0038] S2. Parse the geometric primitives in the CAD vector file and generate the geometric feature tensor G.

[0039] The CAD vector file is read using the file stream provided by the operating system, and basic geometric information is extracted from each entity, including but not limited to entity type, center coordinates, dimension values, and layer identifiers. The extracted information is then arranged in a fixed order to form a two-dimensional array, which is the geometric feature tensor G.

[0040] S3. Parse the process parameters in the process card file and generate the process feature tensor P.

[0041] The process card document is parsed to extract numerical fields relevant to the audit. The extracted results are normalized and arranged in a fixed order to form a one-dimensional array, which is the process feature tensor P.

[0042] S4. Input the geometric feature tensor G and the process feature tensor P into the multi-head cross-attention neural network, and output the anomaly probability vector A.

[0043] The geometric feature tensor G and the process feature tensor P are directly fed into a multi-head cross-attention neural network. The network only performs forward propagation and outputs an anomaly probability vector A, whose length is the same as the number of rows in the geometric feature tensor G, and each element corresponds to the anomaly probability of a geometric entity.

[0044] S5. Based on the anomaly probability vector A, locate the abnormal graphic elements and abnormal process fields, and generate an anomaly list L.

[0045] Set a uniform threshold (e.g., 0.5) for the anomaly probability vector A, and record the indexes of elements that exceed the threshold to form an anomaly list L; the list also indicates the geometric entity corresponding to the index and its associated process field.

[0046] S6. Call the pre-built geometry-process knowledge graph to generate natural language explanation text E for the exception list L.

[0047] Using the anomaly list L as the query key, the pre-stored geometry-process knowledge graph is accessed. The query interface provided by the graph database is used to return explanatory information, and the results are mapped into natural language sentences to obtain the explanatory text E.

[0048] S7. Visualize the exception list L and explanation text E on the CAD interactive interface, and receive user correction instructions.

[0049] In the graphical interface built into the CAD software, the geometric entities in the exception list L are highlighted, and the explanatory text E is presented in a pop-up window; the interface provides two interactive buttons, "Accept" or "Manually Modify", to capture the user's selection.

[0050] S8. Use the correction instructions and the corresponding {G, P, A} as incremental samples to fine-tune the multi-head cross-attention neural network online.

[0051] The user-confirmed geometric values, process values, and the original {G, P, A} are combined to form incremental samples and stored in a buffer. When the number of samples in the buffer reaches a preset threshold, the optimizer is used to update the parameters of the multi-head cross-attention neural network. After the update is completed, the original weights are immediately overwritten.

[0052] The technical solution provided in this application simultaneously acquires CAD vector files and their corresponding process card files, unifying the two previously separate data sources into the subsequent processing flow, eliminating the obstacle of manually switching between the two documents for comparison; it directly parses CAD vector primitives and generates geometric feature tensors G, preserving the original vector accuracy and avoiding pixel-level errors caused by OCR methods; by parsing process card files and generating process feature tensors P, it quantifies natural language constraints into computable dimensions; through a multi-head cross-attention neural network, it performs end-to-end fusion learning of geometric feature tensors G and process feature tensors P, replacing manually written "aperture-mold upper limit" rules, expanding the coverage of coupling relationships from "human-enumerable" to "data-coverable," and reducing rule maintenance costs to near zero; based on the attention weight matrix, it performs bidirectional positioning of abnormal primitives and abnormal process fields, improving positioning accuracy from manual visual inspection to the maximum weight value; and it calls the geometry-process knowledge graph to generate natural language explanation text E, transforming "dimensional deviation" into something like "aperture 3.2 mm is greater than the mold upper limit of 3.0 mm." The system provides readable information ("mm"); receives user correction instructions through the CAD interactive interface; and structurally saves each manual decision. It utilizes incremental samples for online network fine-tuning and employs an elastic weight consolidation strategy to prevent catastrophic forgetting, allowing the model to continuously evolve with the accumulation of correction data. This application effectively improves the efficiency of drawing review and reduces the rate of missed judgments.

[0053] In some embodiments, step S2 includes: S21. Use the vector parsing engine to read line segments, arcs, circles, and polylines from CAD vector files.

[0054] For example, the dwg file to be reviewed is opened using libopencad or the Teigha SDK, and read completely into the memory buffer via file I / O stream. Then, the traversal interface of the vector parsing engine is called to sequentially identify and store the original geometric information (such as start point, end point, radius, angle, etc.) of all line segments, arcs, circles, and polylines.

[0055] S22. Perform topological reconstruction on line segments, arcs, circles, and polylines to obtain closed contours.

[0056] The geometric elements obtained from the preceding steps are fed into the TopoDS class of the open-source geometry kernel OpenCASCADE. Topological lines (TopoDS_Wire) are used to connect the end segments with common endpoints. The face constructor (BRepBuilderAPI_MakeFace) is used to convert the closed Wire into a topological face (TopoDS_Face), thereby obtaining a closed profile (hole, slot, shape, etc.).

[0057] S23. Extract the geometric parameters of each closed contour and encode the geometric parameters into a geometric feature tensor G, wherein the geometric parameters include at least primitive type, center coordinates, size and layer identifier.

[0058] For example, primitive types include holes, slots, bends, or shapes; the center coordinates are the centroid of the surface (X, Y, Z); the dimensions are the length and width of the smallest bounding rectangle, or the diameter of a circle; the layer identifier is the layer name read from the CAD layer table and encoded as an integer. These seven parameters are concatenated in a fixed order to form a geometric feature tensor G with dimensions N×7, where N is the number of closed contours; all tensor elements are 32-bit floating-point numbers, which can be directly fed into subsequent neural networks.

[0059] In this embodiment, through sequential processing of vector analysis, topology reconstruction, parameter extraction, and tensor quantization, the device can obtain a geometric feature tensor G with millimeter-level precision without any bitmap conversion. Compared with the pixel error generated by the OCR method used in related technologies, the only source of error is the original CAD tolerance, and the positioning accuracy is reduced from the pixel level to the vector level, providing high-fidelity input for subsequent fusion review.

[0060] In some embodiments, step S3 includes: S31. The process card file is sequence-annotated using the BERT-BiLSTM-CRF cascade model to extract numerical process parameters.

[0061] The process card file (xlsx, json, or xml) is read into the memory buffer via standard file I / O or RESTful interface. The BERT-base-Chinese pre-trained model is called to encode the process card text to obtain context-sensitive character vectors. The character vector sequence is fed into a BiLSTM network to capture contextual dependencies. Finally, the CRF layer performs global optimal path decoding to output a labeled sequence containing four fields: "material thickness, punching die upper limit, environmental protection level, and material utilization rate".

[0062] S32. Normalize the numerical process parameters and map them to a unified dimension to generate a process feature tensor P, wherein the numerical process parameters include at least material thickness, upper limit of punching die, environmental protection level and material utilization rate.

[0063] Based on the annotation results, the corresponding values ​​are extracted using regular expressions or string-to-number conversion functions; the extracted values ​​are then normalized using Min-Max to map them to the [0,1] interval, forming a 1×4 process feature tensor P. The 1×4 represents a tensor with "1 row and 4 columns" to store 4 process values ​​at the same time.

[0064] For example, suppose the following parameters are extracted: material thickness is 2 mm, mold upper limit is 3 mm, environmental protection level is A1, and material utilization rate is 80%. The Min-Max process involves finding the minimum value Min and the maximum value Max for each field in the training set; for example, if thickness Min = 0.5 mm and Max = 5 mm, then 2 mm is normalized to (2-0.5) / (5-0.5) = 0.33. After normalization, we get [0.33, 0.60, 0.20, 0.80], and the shape is a 1×4 process feature tensor P.

[0065] The technical solution of this embodiment uses a pipeline of "BERT-BiLSTM-CRF cascade and Min-Max normalization" to convert natural language process cards into numerical tensors with uniform dimensions within milliseconds. This avoids errors caused by human misreading or inconsistent units, and provides highly consistent and directly calculable process input for subsequent geometry-process fusion review.

[0066] In some embodiments, the multi-head cross-attention neural network includes: a graph neural network encoder, a Transformer encoder, a K-head cross-attention layer, and a feedforward decoding layer. The graph neural network encoder, Transformer encoder, K-head cross-attention layer, and feedforward decoding layer are connected in series.

[0067] The graph neural network encoder aggregates the adjacency relationships of geometric primitives and outputs geometric embeddings. For example, the input geometric feature tensor G is processed using GraphSAGE (Graph Sampling and Aggregation Network) or GAT (Graph Attention Network) to aggregate the features of each hole / slot node and its neighboring nodes, outputting a sequence of geometric embedding vectors with a dimension of 128.

[0068] A Transformer encoder is used to encode global features of process parameters and output a process embedding. For example, the input process feature tensor P is used to map the 4-dimensional process features into a 128-dimensional global process embedding vector using a 6-layer Transformer.

[0069] A K-head cross-attention layer, where K is an integer from 4 to 8, is used to fuse geometric embeddings and process embeddings. For example, setting K=6, the association weight between each geometric node and the global process constraint is calculated through a multi-head attention mechanism, and the weighted fused feature sequence is output.

[0070] The feedforward decoding layer is used to output the anomaly probability vector A. For example, a two-layer fully connected network and sigmoid activation are used to map the fused feature sequence into the anomaly probability vector A, whose length is consistent with the number of geometric nodes, and each element 0-1 represents the anomaly probability of the corresponding primitive.

[0071] This embodiment utilizes a cascaded structure of "graph neural network, Transformer, and K-head cross-attention." For the first time, the device performs end-to-end learning of discrete geometric nodes and global process constraints within the same tensor space. It can capture complex coupling relationships such as "aperture-mold upper limit" and "thickness-environmental protection level" without any explicit rules. K-head attention provides fine-grained weights, improving anomaly location accuracy from the level of human experience to the level of maximum weight. Furthermore, it can output a complete anomaly probability vector with only one forward propagation during the inference stage, reducing the review time from minutes to seconds.

[0072] Furthermore, the graph neural network encoder is selected from GraphSAGE or GAT, with the hidden layer dimension set to 64-256. In this embodiment, the output geometric feature tensor G is directly fed into the graph neural network encoder. This encoder can be implemented using either GraphSAGE (Graph Sampling and Aggregation Network) or GAT (Graph Attention Network). Regardless of whether GraphSAGE or GAT is used, a uniform hidden layer dimension is set, ranging from 64, 128, 192, or 256. This dimension determines the balance between the expressive power of the node embeddings and the computational cost.

[0073] If using GraphSAGE: sample a fixed number of neighboring nodes for each hole / slot node, concatenate the features of the neighboring nodes with the features of the current node after mean pooling, and output a 128-dimensional embedding.

[0074] If GAT is used: weights are assigned to neighboring nodes through a multi-head attention mechanism, and the weights are normalized by the softmax function and then summed in a weighted manner, which also outputs a 128-dimensional embedding.

[0075] The encoder outputs a geometric embedding tensor of dimension N×128, where N is the number of geometric nodes, which can be directly used as the query vector input for the subsequent multi-head cross-attention network.

[0076] In some embodiments, step S5 includes: S51. Calculate the attention weight matrix W.

[0077] After completing the multi-head cross-attention calculation, the cross-modal attention weight matrix W is obtained. The formula for calculating the attention weight matrix W is: W∈ℝ^{N×d p}; Where N is the number of geometric nodes, d p Let ℝ be the dimension of the process features, and ℝ be the set of real numbers, ℝ^{N×d} p} then represents N rows d p A column of real numbers.

[0078] S52. Mark the process field corresponding to the maximum value in each row of matrix W as an abnormal process field, and mark the element index corresponding to the maximum value in each column as an abnormal element, so as to generate an abnormal list L.

[0079] Find the maximum value index along the row direction of matrix W to obtain the index of the most relevant process field corresponding to each geometric node; the process field pointed to by this index is marked as an abnormal process field.

[0080] Find the maximum index along the column direction of matrix W to obtain the index of the most relevant geometric node for each process field; the primitive pointed to by this index is marked as an abnormal primitive.

[0081] Write the two types of indexes mentioned above into a JSON structure, with fields including "abnormal element ID", "abnormal process field ID", and "abnormal probability value", to form an abnormal list L.

[0082] This embodiment utilizes the bidirectional mapping of row and column maximum values ​​of the attention weight matrix, enabling the device to simultaneously lock abnormal primitives and abnormal process fields after one forward propagation, without the need for additional rules or manual judgment; the positioning accuracy is improved from pixel-level / experience-level to the maximum value level of attention weight (error < 1 pixel), and the review time is shortened from minutes to seconds.

[0083] In some embodiments, step S6 includes: S61. Use SPARQL to query the pre-built geometry-process knowledge graph to obtain the RDF triples corresponding to the anomaly list L.

[0084] Before starting the device, maintenance personnel complete the initialization using a graph database management tool (such as Apache Jena TDB or Neo4jDesktop): Ontology definition: Create URIs for geometric entities such as "hole", "groove", and "shape"; create URIs for process constraints such as "mold upper limit" and "environmental protection level".

[0085] Rule entry: Common rules such as "If the aperture of 3.2mm is greater than the mold upper limit of 3.0mm, an error will be obtained" are written in the form of triples; each rule is accompanied by a natural language template, such as "Aperture {size} exceeds the mold upper limit {limit}".

[0086] Version maintenance: The map files (ttl or nt) are stored on the local SSD, supporting appending / rollback, and can be updated without system downtime.

[0087] In summary, for example: Subject: Geometric entity (hole, slot, shape); Predicate: Relationship type (exceeds, below, violates); Object: Process constraints (mold upper limit, material thickness, environmental protection level).

[0088] The map is persisted in TTL or NT format for runtime access.

[0089] S62. Fill the RDF triples into the preset natural language template to generate the natural language interpretation text E.

[0090] Specifically, after the exception list L is generated, the device automatically converts the "exception fields" in the list into SPARQL variables; it calls the REST interface provided by the graph database to submit a single query, and the interface returns a set of matching RDF triples within milliseconds; the system parses the returned results, replacing placeholders such as {size} and {limit} with the actual values ​​in L, resulting in a complete natural language sentence. The explanatory text E is temporarily stored in a memory buffer in JSON format, and then sent to the interactive correction module via the system bus for subsequent visualization.

[0091] Because each error reason originates from pre-validated triples, the accuracy is nearly 100%, eliminating omissions or ambiguities caused by manually written templates. Furthermore, a single SPARQL query is very fast, achieving a speed of less than 50ms, ensuring users can "make changes and resolve them instantly" on the CAD interface, minimizing perceived waiting time. If new process constraints are added, only triples need to be added to the diagram; no code or rules need to be modified, giving the device a continuously evolving knowledge base. Even ordinary staff without algorithmic knowledge can update the knowledge.

[0092] In some embodiments, step S8 includes: S81. Store the correction instructions and the corresponding {G, P, A} into the experience replay buffer. Set the buffer capacity to 500-2000 instructions.

[0093] For example, an experience replay buffer is allocated in the device memory with a fixed capacity of 1024 records (configurable from 500 to 2000 records). Of course, in other embodiments, other capacities can be selected, and more or fewer instructions can be configured. Each record stores a quadruple: {G, P, A, correction instruction}. A FIFO (First-In, First-Out) strategy is adopted: when the 1025th record is written, the earliest record is automatically overwritten to keep the latest sample.

[0094] S82. When the number of samples in the buffer reaches 100, use 1×10 -5 Up to 1×10 -3 The learning rate is used to fine-tune the parameters of the last two layers of the multi-head cross-attention neural network.

[0095] This device has a counter that monitors the buffer in real time. When the cumulative number of samples monitored by the counter is not less than 100, an online fine-tuning is initiated. The triggering event occurs at an average interval of 20 to 30 minutes (set according to the production line rhythm) to ensure that the learning frequency matches the production line rhythm. It also freezes all previous weights and only fine-tunes the last two fully connected parameters of the fusion audit module.

[0096] For example, in 1×10 -5 Up to 1×10 -3 The range is dynamically selected, with a default value of 5×10. -4 If the F1 score on the validation set decreases, the model is adjusted down by a factor of 10. F1 is a score representing the overall performance of the model, calculated as the harmonic mean of precision and recall. The F1 value ranges from 0 to 1; the closer to 1, the better the overall model performance. For example, after fine-tuning, this device immediately calculates the F1 score using 50 validation images with known results. If the F1 score decreases by more than 2%, the weights are rolled back and the learning rate is reduced, thus ensuring that the model performance continues to improve without "learning badly."

[0097] S83. A flexible weight consolidation strategy is adopted, wherein the flexible weight consolidation coefficient λ ranges from 10. 3 Up to 10 5 To suppress catastrophic forgetting.

[0098] Specifically, the elastic weight consolidation coefficient λ is set to 1×10. 4 This is used to add an "old task penalty term" to the loss function to suppress catastrophic forgetting.

[0099] For example, the fine-tuning process is as follows: 100 samples are randomly selected from the buffer to form a mini-batch. Calculate the cross-entropy loss and the EWC (Elastic Weight Consolidation) regularization term; Perform backpropagation for 3 training iterations (epochs); Immediately after the update is complete, the new weights are written back to the model parameter area 110G and synchronized to the video memory.

[0100] After fine-tuning, test F1 immediately on the validation set (e.g., 50 historical graphs); if the F1 decreases by more than 2%, roll back to the previous weights and try again with a reduced learning rate.

[0101] The technical solution of this embodiment enables the model to continuously evolve with manual corrections without interrupting production, eliminating the need for manual maintenance of the rule base and achieving "learning while reviewing".

[0102] The above-mentioned drawing review method still has at least the following problems: Each upgrade of the process card file traditionally requires manual rewriting of rules or retraining, resulting in downtime of up to 4 hours or more. Directly recalculating the entire file wastes computing power and cannot achieve sub-second response times. To address this, in some embodiments, after step S1, the following may be included: A1. Calculate the version fingerprint for the process card file. The version fingerprint is composed of the SHA-256 hashes of the four fields "material thickness, mold upper limit, environmental protection level, and material utilization rate" to form a Merkle root hash.

[0103] For example, each of the four fields in the process card file—"material thickness, mold upper limit, environmental protection level, and material utilization rate"—is hashed using SHA-256. This is equivalent to stamping each line of text with a unique seal. These four hash values ​​are treated as four leaves, forming a Merkle tree. The hash of the root is the "version fingerprint." This fingerprint, along with a timestamp, is stored in Redis, valid for 30 days. This is like giving the process card an "ID card"—if the content changes, the ID card is immediately updated. It's important to note that a Merkle tree is a "tree-structured hashing" technique: many small data blocks are hashed layer by layer until only a root hash remains, much like compressing a pile of files into a single fingerprint. Redis is a high-speed, in-memory repository specifically designed for storing key-value pairs. Its read / write speed is faster than a hard drive, making it suitable for caching or real-time data synchronization.

[0104] A2. If the fingerprint changes, a sparse difference tensor ΔP is generated, which only records the bits of the numerical change.

[0105] For example, compare the old process tensor P0 and the new process tensor P1 to find the locations where the values ​​differ. Create a sparse tensor ΔP containing only 0 and the differences. ΔP has a sparsity of less than 5% and occupies less than 1KB of memory. In simpler terms, it's like cutting only the differences between the old and new cards into a small strip of paper, leaving the rest unchanged, which saves space.

[0106] A3. The adaptive smoothing coefficient α(t) = 1−|ΔP|2 / |P0|2 is used to fuse ΔP with the original process tensor P0 to obtain the updated differential fusion tensor P'.

[0107] For example, calculate the change magnitude ratio: |ΔP|² / |P0|² (divide the difference value by the value of the original process tensor). Subtract the change magnitude ratio from 1 to obtain the adaptive smoothing coefficient α(t), which serves as the "watering" coefficient: the larger the difference, the less water (representing less new data added, and a more conservative system); the smaller the difference, the more water (representing more new data added, and a faster system to accept changes).

[0108] The formula P'=P0+α·ΔP is computed in parallel on the GPU, taking less than 40ms. In layman's terms, it's like mixing soy sauce: add less of the new ingredient when there are significant changes, and add more when there are minor changes, ensuring the flavor isn't overpowering.

[0109] A4. If the difference rate ε = ||ΔP||∞ / ||P0||∞ > 5%, then a full recalculation is triggered and an alarm is issued. Otherwise, P' is input into step S3 to parse P' and generate a new geometric feature tensor P.

[0110] It should be noted that "‖ΔP‖∞" refers to the "∞ norm" of ΔP, meaning that only the absolute value of the largest variable in ΔP is considered. For example, if ΔP contains [0.1, 0.2, 0.8, 0.05], then "‖ΔP‖∞" equals 0.8. Similarly, "‖P0‖∞" only considers the absolute value of the largest number in the original process tensor P0.

[0111] For example, the "maximum difference rate" ε = maximum change value / original maximum value. If ε > 5%, the differential method is immediately stopped, and the entire process card is analyzed in its entirety. A "high-risk process change" alarm is sent to the MES system. The MES system is the central control console for receiving "high-risk process change" alarms, scheduling shutdowns, or revising processes during drawing review. If ε < 5%, the merged P' is directly sent to step S3 for analysis, and the normal process continues. In simple terms, it's like triggering an alarm when the change is too drastic, requiring manual confirmation from engineers; if the change is minor, the rapid solution continues to be used.

[0112] The technical solution of this embodiment utilizes SHA-256 four-field hashing to construct a Merkle root fingerprint, which can detect version changes in a short time, approximately within 10ms. In step A2, only a sparse differential tensor ΔP is generated, with a memory usage of less than 1KB, which helps save memory resources. In step A3, an adaptive smoothing coefficient α(t) = 1−|ΔP|2 / |P0|2 is used to fuse ΔP with the old tensor P0 into a differential fused tensor P'. When the difference rate ε = ‖ΔP‖∞ / ‖P0‖∞ > 5%, a circuit breaker is triggered and the entire tensor is recalculated. When the difference rate ε ≤ 5%, the system considers the process change to be within an acceptable range, does not trigger a circuit breaker, directly uses the differential fused tensor P' obtained in step A3, and proceeds to the parsing stage of step S3 according to the normal process, without manual intervention or additional alarms.

[0113] It should be noted that P0 is the previously parsed process feature tensor (ready in the cache); P1 is the new process card file, which has not yet been parsed; steps A1 to A3 only perform the difference and fusion step, quickly transforming P1 into a "differential fusion tensor P'". Step S3 is still a necessary step in parsing the new process card file: P' is fed into the normalization / mapping process of step S3, ultimately outputting a new process feature tensor P for subsequent steps. Understandably, if the difference rate ε ≤ 5%, the differential fusion tensor P' is input into step S3, saving the need for full parsing; if the difference rate ε > 5%, the differential fusion tensor P' is discarded, and the new process card file P1 is directly processed in full through step S3 to ensure accuracy.

[0114] The auditing method provided in the above embodiments still has certain drawbacks: when process card documents are changed, there is initially no data for the changed document. Specifically, when new materials (such as environmental protection grade D replacing C) or new processes (such as laser replacing stamping) are introduced, the traditional method requires manually collecting 50-200 labeled real drawings for retraining, resulting in manual auditing on the first day and extending the audit cycle. If unfamiliar process fields are directly forced into the model, the model may interpret "laser cutting thickness 1 mm" as "stamping die 1 mm", causing a huge drift in the anomaly probability and a surge in the false alarm rate.

[0115] In view of this, in some embodiments, the following may be included between steps S6 and S7: B1. Perform Sentence-BERT-Chinese encoding on the new process field to obtain a 768-dimensional vector V. new .

[0116] For example, fields such as "environmental protection level D" and "material thickness 2mm" from the process card file are fed line by line into the Sentence-BERT-Chinese model (a pre-trained model that has already learned Chinese semantics). The Sentence-BERT-Chinese model transforms each line of text into a "secret" vector V composed of 768 numbers. new It's essentially translating "Environmental Protection Level D" into a code that only machines can understand.

[0117] B2. Using the offline Procrustes mapping matrix M to transform V new Mapped to pseudo-process tensor P pseudo .

[0118] For example, in the offline phase, we first use tens of thousands of historical process fields for pairing (V old V newCalculate a "translation matrix" M (using the Procrustes algorithm to ensure minimum error). During the online phase, use the new password V. new Multiplying by M immediately yields a "pseudo-process tensor" P. pseudo .

[0119] B3. If cosine similarity cos(sim) = V new ·V old / (‖V new |||V old If ||) < 0.75, wait for 50 real samples before fine-tuning; otherwise, immediately use P. pseudo .

[0120] For example, calculate the new password V new With the old code V old The cosine similarity is calculated as cos(sim). If cos(sim) < 0.75, the system considers the difference too large and will patiently collect 50 real samples before fine-tuning; otherwise, P is used directly. pseudo Continue the review. In layman's terms, if the new code is too different from the old code, "put on the brakes" and wait until you get 50 real images before learning it; if the difference is not too great, go for it and make sure you don't crash.

[0121] This embodiment uses Sentence-BERT to convert text such as "environmental protection level D" into a 768-dimensional semantic vector, and uses an offline Procrustes matrix M to transform V... new Mapped into pseudo-process tensor P pseudo Using cosine similarity cos(sim) < 0.75 as a safety gate, the model is first run with "fake data," and then gradually switched to real samples based on the weight coefficient T(k) of the pseudo-process tensor at the current number of samples k. The specific formula for calculating the weight coefficient of the pseudo-process tensor at the current number of samples k is as follows: T(k) = T0·exp(−k / 20); k is the number of real sample sheets collected, and T0 is the initial weight (i.e., using the pseudo-technical tensor P at 100%). pseudo For example, as k increases, the weights decay exponentially, and after 50 tensors, the weights approach 0, that is, the proportion of pseudo tensors is gradually reduced until real sample tensors are used completely.

[0122] In summary, this application proposes an automated drawing review method. For the first time, it simultaneously feeds the CAD vector geometric feature tensor G and the process feature tensor P from the process card file into a multi-head cross-attention network, achieving joint modeling of millimeter-level geometric accuracy and natural language process constraints. This not only automates drawing review, improving the low efficiency and high false negative rate of manual drawing review, but also completely eliminates the path dependence of traditional OCR and rule bases. Furthermore, it employs an elastic weight consolidation strategy, fine-tuning only the last two layers of the network to continuously absorb user correction instructions, further reducing the false negative rate of this method.

[0123] Reference Figure 3 , Figure 3 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of this application.

[0124] As shown in the figure, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface and a wireless interface. In this invention, the wired interface of the user interface 1003 may be a Universal Serial Bus (USB) interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed random access memory (RAM); or it may be stable memory, such as non-volatile memory, specifically a disk storage device. Alternatively, the memory 1005 may be a storage device independent of the aforementioned processor 1001.

[0125] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0126] like Figure 3 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a computer program for drawing review.

[0127] exist Figure 3In the electronic device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to peripheral devices; the electronic device calls the computer program for drawing review stored in the memory 1005 through the processor 1001 and executes the automatic drawing review method provided in the embodiment of the present invention.

[0128] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for automatic drawing review, characterized in that, include: S1. Obtain the CAD vector file to be reviewed and its corresponding process card file; S2. Parse the geometric primitives in the CAD vector file to generate a geometric feature tensor G; S3. Parse the process parameters in the process card file and generate the process feature tensor P; S4. Input the geometric feature tensor G and the process feature tensor P into a multi-head cross-attention neural network and output the anomaly probability vector A. S5. Based on the anomaly probability vector A, locate the abnormal graphic elements and abnormal process fields, and generate an anomaly list L; S6. Call the pre-built geometry-process knowledge graph to generate natural language explanation text E for the anomaly list L; S7. Visualize the anomaly list L and the explanatory text E on the CAD interactive interface, and receive user correction instructions; S8. Using the correction instructions and the corresponding {G, P, A} as incremental samples, fine-tune the multi-head cross-attention neural network online.

2. The method according to claim 1, characterized in that, S2 includes: The vector parsing engine is used to read line segments, arcs, circles, and polylines from the CAD vector file. Perform topological reconstruction on the line segments, arcs, circles, and polylines to obtain closed contours; Extract the geometric parameters of each closed contour and encode the geometric parameters into a geometric feature tensor G, wherein the geometric parameters include at least primitive type, center coordinates, size and layer identifier.

3. The method according to claim 1, characterized in that, S3 includes: The BERT-BiLSTM-CRF cascade model was used to perform sequence annotation on the process card file and extract numerical process parameters. The numerical process parameters are normalized and mapped to a unified dimension to generate a process feature tensor P, wherein the numerical process parameters include at least material thickness, upper limit of punching die, environmental protection level and material utilization rate.

4. The method according to claim 1, characterized in that, The multi-head cross-attention neural network includes: A graph neural network encoder is used to aggregate the adjacency relationships of geometric primitives and output geometric embeddings. The Transformer encoder is used to encode global features of process parameters and outputs process embeddings. A K-head cross-attention layer, where K is an integer from 4 to 8, is used to fuse the geometric embedding and the process embedding; The feedforward decoding layer is used to output the anomaly probability vector A.

5. The method according to claim 4, characterized in that, The graph neural network encoder is selected from GraphSAGE or GAT, and the hidden layer dimension is set to 64-256.

6. The method according to claim 1, characterized in that, S5 includes: Calculate the attention weight matrix W; Mark the process field corresponding to the maximum value in each row of matrix W as an abnormal process field, and mark the element index corresponding to the maximum value in each column as an abnormal element, so as to generate an abnormal list L.

7. The method according to claim 1, characterized in that, S6 includes: Use SPARQL to query a pre-built geometry-process knowledge graph to obtain the RDF triples corresponding to the anomaly list L; The RDF triples are filled into a preset natural language template to generate a natural language interpretation text E.

8. The method according to claim 1, characterized in that, S8 includes: The correction instructions and their corresponding {G, P, A} are stored in the experience replay buffer, with the buffer capacity set to 500-2000 entries. When the number of samples in the buffer reaches 100, it is 1×10 -5 Up to 1×10 -3 The learning rate is used to fine-tune the parameters of the last two layers of the multi-head cross-attention neural network; A flexible weight consolidation strategy is adopted, wherein the flexible weight consolidation coefficient λ ranges from 10. 3 Up to 10 5 To suppress catastrophic forgetting.

9. An automatic drawing review device, characterized in that, include: The file acquisition module is used to acquire the CAD vector files to be reviewed and their corresponding process card files. The vector parsing module is used to parse the geometric primitives in the CAD vector file and generate a geometric feature tensor G. The process coding module is used to parse the process parameters in the process card file and generate a process feature tensor P; The fusion review module is used to input the geometric feature tensor G and the process feature tensor P into a multi-head cross-attention neural network and output an anomaly probability vector A. The anomaly localization module is used to locate abnormal graphic elements and abnormal process fields based on the anomaly probability vector A, and generate an anomaly list L; An explanation generation module is used to call a pre-built geometry-process knowledge graph to generate natural language explanation text E for the anomaly list L; The interactive correction module is used to visualize the anomaly list L and the explanatory text E on the CAD interactive interface and to receive user correction instructions. An online learning module is used to fine-tune the multi-head cross-attention neural network online by using the correction instructions and the corresponding {G, P, A} as incremental samples.

10. An electronic device comprising a processor and a memory, the memory storing a computer program, wherein the processor, when executing the program, implements the method of any one of claims 1 to 8.