A material cost calculation method for 2D engineering mechanical drawings

By segmenting and detecting engineering machinery drawings using view segmentation and contour detection models, the problems of high error rate and poor robustness of OCR under non-standard conditions are solved, and accurate calculation and reliability assurance of material costs are achieved.

CN122175633APending Publication Date: 2026-06-09WUXI XUELANG DIGITAL TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUXI XUELANG DIGITAL TECH CO LTD
Filing Date
2026-05-09
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, OCR recognition of engineering machinery drawings suffers from high error rates and poor format robustness when dealing with issues such as PDF to image distortion, blurry scanned documents, and non-standard fonts, leading to inaccurate material cost calculations.

Method used

The engineering machinery drawings are segmented using a view segmentation model, and the view contour information is detected by combining a pre-trained contour detection model. The sensitivity and positioning accuracy of the model to the inner contour are improved by using a dynamic weighted loss function for the inner contour, so as to achieve cross-view geometric consistency reconstruction. The material cost is calculated by combining the material unit price and density mapping relationship.

Benefits of technology

It significantly reduces the rate of missed inspections of inner contours, ensuring the accuracy and reliability of material cost calculations. The processing is transparent and traceable, guaranteeing the physical reliability and auditability of material cost calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175633A_ABST
    Figure CN122175633A_ABST
Patent Text Reader

Abstract

The application provides a material cost calculation method for a 2D engineering mechanical drawing, wherein the method comprises: obtaining a target engineering mechanical drawing, inputting the target engineering mechanical drawing into a view segmentation model, and segmenting to obtain at least one view; performing text extraction on the target engineering mechanical drawing to obtain attribute parameters of each object; detecting view contour information of each view according to each view and a pre-trained contour detection model; determining shape information and target contour information of a to-be-calculated object according to the view contour information of each view; and determining a material cost of the to-be-calculated object according to a preset mapping relationship between a material unit price and a material density, material parameters, shape information, and target contour information. The application can significantly reduce the internal contour missing detection rate, accurately calculate the material cost of the to-be-calculated object, and at the same time, the processing process is transparent and traceable, thereby guaranteeing the physical credibility and auditability of the material cost calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method for calculating material costs for 2D engineering machinery drawings. Background Technology

[0002] In the fields of engineering machinery, heavy equipment, and customized machining, the raw material cost of parts is the most fundamental and rigid component of the pricing system. Its calculation relies heavily on the accurate analysis of the geometric configuration (such as external dimensions, hole and groove features, and wall thickness distribution) and material properties (such as grade, condition, and density) expressed in the design drawings.

[0003] In existing technologies, OCR is typically used to recognize text annotations and dimension values ​​in drawings, and material costs are calculated using preset quotation rule templates.

[0004] However, OCR relies heavily on text clarity and font standardization. In cases of PDF to image distortion, blurry scanned documents, or non-standard fonts, it suffers from a high error rate and poor format robustness. Summary of the Invention

[0005] The purpose of this application is to provide a material cost calculation method for 2D engineering machinery drawings, in order to address the shortcomings of the prior art and solve the problems of high error rate and poor format robustness in the prior art.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, one embodiment of this application provides a method for calculating material costs based on 2D engineering machinery drawings, the method comprising: Obtain the target construction machinery drawing and input the target construction machinery drawing into a pre-trained view segmentation model to segment and obtain at least one view of the target construction machinery drawing, wherein the target construction machinery drawing includes at least one object; Text extraction is performed on the target engineering machinery drawings to obtain the attribute parameters of each object, including: material parameters; Based on each view and the pre-trained contour detection model, the view contour information of each view is detected. The view contour information includes the inner contour parameters and outer contour parameters of each component under the view. The contour detection model is trained based on a preset inner contour dynamic weighted loss function. Based on the view contour information of each view, the shape information and target contour information of the object to be calculated are determined. The target contour information includes: the inner contour parameters and the outer contour parameters of the object to be calculated. The material cost of the object to be calculated is determined based on the preset mapping relationship between the unit price of the material and the density of the material, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated.

[0007] Secondly, another embodiment of this application provides a material cost device for 2D engineering machinery drawings, the device comprising: The segmentation module is used to acquire the target engineering machinery drawing and input the target engineering machinery drawing into a pre-trained view segmentation model to segment the drawing to obtain at least one view of the target engineering machinery drawing, wherein the target engineering machinery drawing includes at least one object. The extraction module is used to extract text from the target engineering machinery drawings to obtain the attribute parameters of each object, including material parameters; The detection module is used to detect the view contour information of each view based on each view and a pre-trained contour detection model. The view contour information includes the inner contour parameters and outer contour parameters of each component under the view. The contour detection model is trained based on a preset inner contour dynamic weighted loss function. The first determining module is used to determine the shape information and target contour information of the object to be calculated based on the view contour information of each view. The target contour information includes: the inner contour parameters and the outer contour parameters of the object to be calculated. The second determining module is used to determine the material cost of the object to be calculated based on the preset mapping relationship between the unit price of the material and the density of the material, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated.

[0008] Thirdly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.

[0009] Fourthly, another embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of any of the methods described in the first aspect above.

[0010] The beneficial effects of this application are as follows: By inputting the target engineering machinery drawing into a pre-trained view segmentation model, at least one view of the target engineering machinery drawing is obtained, achieving view decoupling, reducing the complexity of subsequent processing, and extracting text from the target engineering machinery drawing to obtain the attribute parameters of each object. Then, based on each view and a contour detection model pre-trained based on a preset dynamic weighted loss function for inner contours, the inner contour parameters and outer contour parameters of each component under the view are detected, actively enhancing the model's perception sensitivity and positioning accuracy of inner contours, breaking through the bottleneck of general edge detectors in missing small contrast inner contours, and determining the shape information and target contour information of the object to be calculated based on the view contour information of each view, achieving cross-view geometric consistency reconstruction. Thus, based on the preset mapping relationship between material unit price and material density, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated, the material cost of the object to be calculated is determined, which can significantly reduce the inner contour missing rate and accurately calculate the material cost of the object to be calculated. At the same time, the processing process is transparent and traceable, ensuring the physical credibility and auditability of the material cost calculation. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments 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.

[0012] Figure 1 A flowchart illustrating a material cost calculation method for 2D engineering machinery drawings provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the process of determining the shape information and target contour information of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment; Figure 3 This is a flowchart illustrating the process of determining the intermediate shape information and intermediate contour information of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment. Figure 4 This is a flowchart illustrating the process of determining multiple target components of the object to be calculated and the target outer contour information of each target component in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment; Figure 5 This is a flowchart illustrating the process of determining the target inner contour information of each target component in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment; Figure 6 This is a flowchart illustrating the process of determining the intermediate shape information and intermediate contour information of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment. Figure 7 This is a flowchart illustrating the process of determining the material cost of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment; Figure 8 A schematic diagram of a material cost calculation device for 2D engineering machinery drawings provided in this application embodiment; Figure 9 This is a schematic diagram of the electronic device structure provided in an embodiment of this application. Detailed Implementation

[0013] 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. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0014] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. 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.

[0015] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0016] In existing technologies, OCR is typically used to recognize text annotations and dimension values ​​in drawings, and material costs are calculated using preset quotation rule templates.

[0017] However, OCR relies heavily on text clarity and font standardization. In cases of PDF to image distortion, blurry scanned documents, or non-standard fonts, it suffers from a high error rate and poor format robustness.

[0018] Based on the aforementioned problems, this application proposes a material cost calculation method for 2D engineering machinery drawings. The method involves inputting the target engineering machinery drawing into a pre-trained view segmentation model to segment it into at least one view, achieving view decoupling. Text extraction is then performed on the drawing to obtain attribute parameters for each object. Based on each view and a pre-trained contour detection model using a preset dynamic weighted loss function, the method detects the inner and outer contour parameters of each component within the view. This actively enhances the model's sensitivity and positioning accuracy regarding inner contours, overcoming the bottleneck of general edge detectors that miss subtle contrasting inner contours. Furthermore, based on the view contour information of each view, the method determines the shape and target contour information of the object to be calculated, achieving cross-view geometric consistency reconstruction. Finally, based on a preset mapping relationship between material unit price and material density, the material parameters of the object to be calculated, and the shape and target contour information, the method determines the material cost of the object to be calculated. This accurately calculates the material cost, significantly reducing the inner contour miss rate, while ensuring the physical reliability and auditability of the material cost calculation.

[0019] It is understood that the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment can be applied to any electronic device with processing capabilities, for example, it can be deployed as a plug-in in a drawing processing system.

[0020] The following describes in detail the material cost calculation method for 2D engineering machinery drawings provided in this application, with reference to several embodiments.

[0021] Figure 1 A flowchart illustrating a material cost calculation method for 2D engineering machinery drawings provided in this application embodiment is shown below. Figure 1 As shown, the method includes: S101. Obtain the target engineering machinery drawing and input the target engineering machinery drawing into the pre-trained view segmentation model to segment and obtain at least one view of the target engineering machinery drawing.

[0022] Optionally, the target engineering machinery drawing is input into a pre-trained view segmentation model, and the view segmentation model segments the target engineering machinery drawing to obtain at least one view of the target engineering machinery drawing.

[0023] The target construction machinery drawing is a 2D construction machinery drawing to be processed. The target construction machinery drawing typically includes a title block, views, dimensions, technical requirements, etc. It also includes at least one object.

[0024] In this context, a view refers to a single projected view in the engineering machinery drawing, drawn according to the principle of orthographic projection. Examples include: front view, top view, left view, and sectional view. Views are used to indicate and represent the two-dimensional outline projection of the same object in a certain direction, including the outer outline, inner outline, dimension lines, and section lines.

[0025] The pre-trained view segmentation model can be a general, untrained YOLO26-seg model.

[0026] Specifically, an object refers to the graphic area in the target engineering machinery drawing that is surrounded by a single, connected, closed outline. Optionally, the material parameters corresponding to each object are marked in the title block, technical requirements section, or view footnotes of the target engineering machinery drawing.

[0027] For example, taking a 2D engineering machinery drawing as an assembly drawing of a crane slewing bearing, the target engineering machinery drawing includes at least a first object and a second object. The first object is the slewing bearing body, and the second object is the upper cover plate.

[0028] S102. Extract text from the target engineering machinery drawings to obtain the attribute parameters of each object.

[0029] Optionally, the target engineering machinery drawing is input into a pre-trained material extraction model to identify the text in the target engineering machinery drawing and obtain the attribute parameters of each object.

[0030] The attribute parameters include material parameters. Optionally, the attribute parameters may also include process requirements and proportional information. The pre-trained material extraction model can be a PaddleOCR model.

[0031] Specifically, material parameters may include: the material used and the density of the material.

[0032] S103. Based on each view and the pre-trained contour detection model, detect the view contour information of each view.

[0033] Optionally, after obtaining each view, the view is input into a pre-trained contour detection model, and the contour detection model performs internal and external contour detection on each view to obtain the view contour information of each view.

[0034] The view contour information includes the inner contour parameters and outer contour parameters of each component in the view. The contour detection model is trained based on a preset dynamic weighted loss function for the inner contour.

[0035] Specifically, dynamic weighting of the inner contour refers to the loss function corresponding to the inner contour changing as the inner contour changes during training. Training a contour detection model using this dynamic weighting loss function can significantly improve the segmentation mask accuracy and localization accuracy for small object detection, enhance the model's ability to perceive dense small structures, and reduce the error rate in subsequent geometric reconstruction caused by missed or misaligned inner contours.

[0036] A component is a collection of multiple view outline instances belonging to the same physical entity; one component corresponds to one physical entity. The inner and outer contour parameters of a component in the view refer to the inner and outer contour parameters of that component in the current view.

[0037] The inner contour refers to the internal structural lines of holes, grooves, cavities, etc., while the outer contour refers to the external boundary.

[0038] Specifically, the inner contour parameters include: type, spatial positioning information, geometric parameters, and associated information. For example, the type includes holes, slots, cavities, notches, thread relief grooves, etc. Spatial positioning information indicates the offset of the inner contour relative to the outer contour reference point, including: centering, symmetry, etc. Geometric parameters include: diameter, width, depth, length, radius, angle, chamfer C-value, tolerance zone, etc. Associated information includes directly attached dimension lines, leader lines, etc.

[0039] Specifically, the outer contour parameters include: topology, geometric parameters, keypoint coordinates, and semantic tags. For example, the topology indicates the basic geometric type of the outer contour, including whether the contour is simply connected, multi-connected, the number of vertices, and its concavity / convexity. Geometric parameters include: the length / width of the circumscribed rectangle, the diameter of the minimum circumscribed circle, the principal axis direction angle, the area, and the perimeter. Keypoint coordinates include: the pixel coordinates of all vertices. Semantic tags indicate whether standard structures are present, such as bolt hole areas, locating pin hole groups, and sealing groove areas.

[0040] For example, continuing to use a 2D engineering machinery drawing as an assembly drawing of a crane slewing bearing, the components may include: bearing base component A, flange component B, gear ring component C, and upper cover plate component D.

[0041] S104. Based on the view outline information of each view, determine the shape information and target outline information of the object to be calculated.

[0042] Optionally, after obtaining the view outline information of each view, a cross-view correspondence can be established based on the view outline information of each view, and a structured component representation of the three-dimensional object can be reconstructed to obtain the shape information and target outline information of the object to be calculated.

[0043] The shape information indicates the topology type and operation type of the object to be calculated. For example, topology types include: cylinder, cylindrical hole. Operation types include: overlay, cut.

[0044] The target contour information includes: the inner contour parameters and the outer contour parameters of the object to be calculated.

[0045] The object to be calculated refers to the object selected for material cost accounting among all the objects included in the target engineering machinery drawings.

[0046] In one example, a pre-trained graph neural network can be used to perform cross-view outer contour matching and component recognition on the view contour information of each view, establish a correspondence between multiple views, identify multiple components of the object to be calculated and the target outer contour of each component, and on this basis, reconstruct the structured component representation of the three-dimensional object to obtain the shape information and target contour information of the object to be calculated.

[0047] For example, continuing to use a 2D engineering machinery drawing as an assembly drawing of a crane slewing bearing seat, the object to be calculated is the slewing bearing seat body, or the object to be calculated is the upper cover plate.

[0048] S105. Based on the preset mapping relationship between material unit price and material density, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated, determine the material cost of the object to be calculated.

[0049] Optionally, after obtaining the material parameters, shape information, and target contour information of the object to be calculated, the estimated material usage information of the object to be calculated can be determined based on the material parameters, shape information, and target contour information of the object to be calculated, and the material cost of the material to be calculated can be calculated based on the estimated material usage information of the object to be calculated and the preset mapping relationship between the material unit price and the material density.

[0050] The estimated material usage information for the object to be calculated includes at least the total amount of material used by the object.

[0051] In this embodiment, by inputting the target engineering machinery drawing into a pre-trained view segmentation model, at least one view of the target engineering machinery drawing is obtained, achieving view decoupling, reducing the complexity of subsequent processing, and extracting text from the target engineering machinery drawing to obtain the attribute parameters of each object. Then, based on each view and a contour detection model pre-trained based on a preset dynamic weighted loss function for inner contours, the inner contour parameters and outer contour parameters of each component under the view are detected, actively enhancing the model's sensitivity and positioning accuracy for inner contours, overcoming the bottleneck of general edge detectors in missing small contrast inner contours, and determining the shape information and target contour information of the object to be calculated based on the view contour information of each view, achieving cross-view geometric consistency reconstruction. Thus, based on the preset mapping relationship between material unit price and material density, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated, the material cost of the object to be calculated is determined, which can significantly reduce the inner contour missing rate and accurately calculate the material cost of the object to be calculated. At the same time, the processing process is transparent and traceable, ensuring the physical credibility and auditability of the material cost calculation.

[0052] In one possible implementation, the dynamic weighted loss function for the inner contour includes dynamic weight coefficients, which include: the basic weight coefficient for the contour category and the incremental weight coefficient for the inner contour.

[0053] Optionally, the dynamic weighted loss function for the inner contour includes: dynamic weight coefficients and the original total loss of the inner and outer contours.

[0054] The baseline weight coefficient for the contour category refers to the basic weight under the current contour category, which can be obtained through pre-configuration. Specifically, contour categories include: outer contour and inner contour. Inner contours include holes, grooves, countersunk holes, stepped holes, open grooves, and cavities. The baseline weight of the inner contour is greater than that of the outer contour, thus forcing the model to focus on the inner contour.

[0055] Among them, the inner contour incremental weight coefficient refers to the incremental weight applied to the inner contour, which can be calculated in real time.

[0056] In one example, it can be calculated based on the pixel area of ​​the true mask of the inner contour in the training sample corresponding to the current iteration round.

[0057] In another example, it can also be calculated based on the ratio of the pixel area of ​​the true mask of the inner contour to the pixel area of ​​the true mask of the outer contour in the training samples corresponding to the current iteration round.

[0058] In another example, it can also be calculated based on the shape complexity or inclusion relationship of the true mask of the inner contour in the training sample corresponding to the current iteration round.

[0059] For example, in the current iteration, the original total loss of the inner and outer contours can be calculated using the predicted mask pixel values ​​output by the current contour detection model and the real mask pixel values ​​of the training samples corresponding to the current iteration.

[0060] In one possible implementation, the inner contour increment weight coefficient is determined based on the pixel area of ​​the inner contour in the sample data.

[0061] Specifically, the inner contour increment weight coefficient is calculated based on the pixel area of ​​the true mask of the inner contour in the training samples corresponding to the current iteration round.

[0062] For example, the inner contour dynamic weighted loss function It can be as follows:

[0063] in, For dynamic weighting coefficients, For the current contour detection model at the pixel level The output predicted mask pixel values, For pixels The actual mask pixel values, For the high of the mask, For the width of the mask, This is a preset threshold, for example, it can be 1e-6.

[0064] For example, dynamic weighting coefficients You can refer to the following formula:

[0065] in, The basic weighting coefficients for the contour category, The area dynamic weighting coefficient includes the inner contour increment weighting coefficient and the outer contour increment weighting coefficient.

[0066] For example, area dynamic weighting coefficient You can refer to the following formula:

[0067] in, For the outline category, For the outer contour, For the inner contour. The pixel area of ​​a single contour's true mask. , This is the preset area contour determination threshold.

[0068] For example, in the current iteration, the calculation can be performed in batches, and the loss of all contours within a batch can be weighted and averaged, as shown in the following formula:

[0069] in, The final weighted partition loss for a single batch. The number of valid contours within a single batch. For the first batch Index of a contour, For the first The outline category of each outline. For the first The actual mask pixel area of ​​the contour For the first The basic loss for each contour is obtained through the aforementioned dynamic weighted loss function for the inner contour. Calculated.

[0070] By determining the incremental weight coefficient of the inner contour by the pixel area of ​​the inner contour in the sample data, the fundamental problem of small targets being submerged in the loss function can be directly solved. It can also shift the focus from all small targets to the small targets that have not yet been learned, achieving dynamic adaptation. Moreover, it does not require prior knowledge and can automatically adapt to the feature distribution of any dataset. At the same time, it perfectly matches the large range of feature dimensions in engineering drawings.

[0071] In one possible implementation, Figure 2 This is a flowchart illustrating the process of determining the shape and target contour information of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment. (Refer to...) Figure 2 As shown, in S104 above, the shape information and target contour information of the object to be calculated are determined based on the view contour information of each view, including: S201. Based on the view outline information of each view, determine the intermediate shape information and intermediate outline information of the object to be calculated.

[0072] Optionally, cross-view outer contour matching and component recognition can be performed first based on the view contour information of each view to establish a correspondence between multiple views, identify multiple components of the object to be calculated and the target outer contour of each component, and on this basis, predict the features inside each component based on the target outer contour of each component and the shape of these features in 3D space to complete the dimensionality enhancement, reconstruct the structured component representation of the three-dimensional object, and associate the outer contour and inner contour to the same component to obtain the intermediate shape information and intermediate contour information of the object to be calculated.

[0073] S202. Input the intermediate shape information and intermediate contour information of the object to be calculated, the target engineering machinery drawings and various views into the pre-trained multimodal large model, and use the multimodal large model to infer the shape information and target contour information of the object to be calculated.

[0074] Optionally, after obtaining the intermediate shape information and intermediate contour information of the object to be calculated, the intermediate shape information and intermediate contour information of the object to be calculated, the target engineering machinery drawing and each view are input into the pre-trained multimodal large model. The multimodal large model performs cross-modal alignment, mechanical common sense injection, geometric semantic completion and ambiguity resolution to infer the shape information and target contour information of the object to be calculated.

[0075] By using the view contour information of each view, the intermediate shape information and intermediate contour information of the object to be calculated are determined. The intermediate shape information and intermediate contour information of the object to be calculated, the target engineering machinery drawing and each view are input into the pre-trained multimodal large model. The multimodal large model infers the shape information and target contour information of the object to be calculated. This can significantly reduce the cognitive load of the task, allowing the model to focus on error correction and improvement, resulting in higher quality and more reliable output. This reduces the inference difficulty of the multimodal large model, while also improving interpretability and significantly enhancing the robustness and generalization ability of the system.

[0076] In one possible implementation, Figure 3 This is a flowchart illustrating the process of determining the intermediate shape and contour information of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment. (Refer to...) Figure 3 As shown, in step S201 above, the intermediate shape information and intermediate contour information of the object to be calculated are determined based on the view contour information of each view, including: S301. Based on the outer contour parameters of each component in each view, determine multiple target components of the object to be calculated and the target outer contour information of each target component.

[0077] Optionally, after obtaining the outer contour parameters of each component in each view, it is possible to determine whether the contours in different views may belong to the same component based on the outer contour parameters of each component in each view, thereby performing cross-view component clustering and outer contour aggregation to obtain multiple target components of the object to be calculated and the target outer contour information of each target component.

[0078] Here, the target component refers to the component that constitutes the object to be calculated, and the target outer contour information refers to the outer contour parameters in the preset world coordinate system.

[0079] S302. Based on the inner contour parameters of each target component in each view and the target outer contour information of each target component, determine the target inner contour information of each target component.

[0080] Optionally, after obtaining the target outer contour information of each target component, the inner contour parameters of each target component in each view can be converted into the target inner contour information of each target component of the object to be calculated based on the target outer contour information of each target component.

[0081] Among them, the target inner contour information refers to the inner contour parameters in the preset world coordinate system.

[0082] S303. Based on the target outer contour information and the target inner contour information of each target component, determine the intermediate shape information and intermediate contour information of the object to be calculated.

[0083] Optionally, the target outer contour information and the target inner contour information of each target component are fused together to determine the intermediate shape information and intermediate contour information of the object to be calculated.

[0084] In one example, after obtaining the target outer contour information and the target inner contour information of each target component, a point cloud set corresponding to each target component can be constructed based on the target outer contour information and the target inner contour information of each target component. Then, three-dimensional primitive recognition and assembly are performed on the point cloud set corresponding to each target component to obtain the intermediate shape information and intermediate contour information of the object to be calculated.

[0085] In one possible implementation, Figure 4 This application provides a flowchart illustrating the process of determining multiple target components of an object to be calculated and the target outer contour information of each target component in a material cost calculation method for 2D engineering machinery drawings. (Refer to...) Figure 4 As shown, in step S301 above, based on the outer contour parameters of each component in each view, multiple target components of the object to be calculated and the target outer contour information of each target component are determined, including: S401. Calculate the feature similarity results of each component in each view based on the outer contour parameters of each component in each view.

[0086] In one example, the outer contour parameters of each component in each view can be projected onto a preset world coordinate system, and a unified component coordinate expression can be established based on the view type, thereby calculating the similarity results of each component in each view.

[0087] Specifically, the common symmetry center line, reference edge, contour center point or dimensioning baseline of each view is used as the cross-view projection reference. The outer contour parameters in the main view are mapped to two-dimensional projection constraints on the XY plane in the world coordinate system, the outer contour parameters in the top view contour are mapped to two-dimensional projection constraints on the XZ plane in the world coordinate system, and the outer contour parameters in the left and right views are mapped to two-dimensional projection constraints on the YZ plane in the world coordinate system.

[0088] Specifically, in the world coordinate system after the projection of each view, the feature vector corresponding to each outer contour parameter is constructed according to the outer contour parameters of each component in each view, and all cross-view contour combinations are enumerated to obtain multiple cross-view contour pairs. Based on the feature vector corresponding to each outer contour parameter, the similarity score of each cross-view contour pair is calculated as the feature similarity result of each component in each view.

[0089] The similarity score for each cross-view contour pair includes a geometric similarity score and a projection similarity score. Specifically, the geometric similarity score can be obtained by measuring the dimensions of the two outer contours in the common dimension of the cross-view contour pair. The projection similarity score can be obtained by checking whether the centers of the two contours satisfy projection alignment.

[0090] For example, the similarity score of the cross-view contour pair can be obtained by weighted summation of the geometric similarity score and the projection relationship similarity score.

[0091] In one example, the geometric similarity score can be obtained by comparing the height of the front view with the height of the left view. If the height difference between the front view and the left view exceeds a preset threshold, the geometric similarity is determined to be a preset low geometric similarity threshold. If the height difference between the front view and the left view is less than the preset threshold, the geometric similarity is determined to be a preset high geometric similarity threshold.

[0092] In one example, the projection relationship similarity score can be determined by whether the center coordinates of the front view and the top view are aligned. The reciprocal of the deviation between the center coordinates of the front view and the top view can be calculated as the projection relationship similarity score.

[0093] S402. Based on the feature similarity results of each component in each view, determine multiple target components belonging to the object to be calculated.

[0094] Optionally, based on the feature similarity results of each component in each view, the contour can be clustered into components to obtain multiple target components belonging to the object to be calculated.

[0095] For example, the outer contour of each component in each view is taken as a node, the feature similarity result of each component in each view is judged with a preset similarity threshold, and the edges between each node are constructed according to the judgment result. The weight of the edge is the feature similarity result, and a graph structure distributed in each view is constructed.

[0096] In one example, the graph structure is matched and clustered. Specifically, starting with the cross-view contour pairs with the highest similarity, these pairs are grouped into the same candidate component. Then, according to preset constraints, contours highly similar to existing contours within that component are iteratively added, resulting in multiple target components belonging to the object to be calculated. The preset constraint can be that a component can have at most one outer contour in each view.

[0097] In another example, the graph structure can be clustered using a graph cut algorithm to obtain multiple target components belonging to the object to be computed.

[0098] S403. Perform fusion processing on the outer contour parameters of each target component in each view to obtain the target outer contour information of each target component.

[0099] Optionally, after obtaining multiple target components belonging to the object to be calculated, the outer contour parameters of the same target component in different views can be fused in the world coordinate system to obtain the target outer contour information of each target component.

[0100] In one example, the bounding box size, aspect ratio, contour area, principal axis direction, arc segment parameters, line segment parameters, corner topology, and center position offset of each view's outer contour are extracted to construct a component-level outer contour feature vector. Then, based on the pre-configured size consistency rules for different views in the shared dimension, the outer contours of each view are registered and fused to obtain the complete size parameters of the component in the length, width, and height directions.

[0101] Among them, the pre-configured size consistency rules for different views in the shared dimension may include: the length of the front view is consistent with the length of the top view, the height of the front view is consistent with the height of the side view, and the width of the top view is consistent with the width of the side view.

[0102] In addition, for cases where there are size conflicts, a weighted decision can be made based on the confidence level of the dimension annotation, the clarity of the outline, the integrity of the line type, and the confidence level of the detection model output, so as to output the outer contour information of the target.

[0103] In another example, the outer contour parameters of the same target component in different views are fused using a pre-trained reconstruction model to obtain the target outer contour information of each target component.

[0104] For example, the target outer contour information includes multiple first spatial curves in the world coordinate system and the view source to which each first spatial curve belongs. All the first spatial curves in the world coordinate system constitute the outer contour of the target component.

[0105] By calculating the feature similarity results of each component in each view using the outer contour parameters of each component in each view, and based on the feature similarity results of each component in each view, multiple target components belonging to the object to be calculated are determined. Then, the outer contour parameters of each target component in each view are fused to obtain the target outer contour information of each target component. The two-dimensional contours scattered in different views are organized according to the principle of belonging to the same physical component, eliminating information silos between views, realizing cross-view ambiguity elimination, and improving computational efficiency.

[0106] In one possible implementation, Figure 5 This is a flowchart illustrating the process of determining the target inner contour information of each target component in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment, with reference to... Figure 5 As shown, in step S302 above, the target inner contour information of each target component is determined based on the inner contour parameters of each target component in each view and the target outer contour information of each target component, including: S501. Based on the target outer contour information of the target component, construct the local coordinate system corresponding to the target component.

[0107] Optionally, after obtaining the target outer contour information of the target component, the center point of the target component is used as the origin, the X-axis is defined as the length direction of the target component, the Y-axis as the height direction of the target component, and the Z-axis as the depth direction of the target component, and a local coordinate system corresponding to the target component is constructed.

[0108] S502. Project the inner contour parameters of the target component in each view to the local coordinate system corresponding to the target component to obtain multiple candidate inner contour features of the target component in the local coordinate system.

[0109] Optionally, the inner contour parameters of the target component under each view are projected to the local coordinate system corresponding to the target component according to the view type, and the center position, boundary distance, size parameters, shape category, symmetry relationship with the center line and adjacency relationship with the boundary of each inner contour parameter are extracted to obtain multiple candidate inner contour features of the target component in the local coordinate system.

[0110] For example, the inner contour parameters of the front view are projected onto the XY plane in the local coordinate system, the inner contour parameters of the top view are projected onto the XZ plane in the local coordinate system, and the inner contour parameters of the left view are projected onto the YZ plane in the local coordinate system. The center position, boundary distance, size parameters, shape category, symmetry relationship with the center line, and adjacency relationship with the boundary of each inner contour parameter relative to its corresponding outer contour are extracted to obtain multiple candidate inner contour features of the target part in the local coordinate system.

[0111] Among them, the candidate inner contour features are feature vectors, including multiple sub-vectors. Each sub-vector is used to indicate the center position, boundary distance, size parameters, shape category, symmetry relationship with the center line, and adjacency relationship with the boundary of the inner contour parameters relative to the center of the outer contour.

[0112] S503. Based on the multiple candidate inner contour features of the target component in the local coordinate system, determine the correspondence between the parameters of each candidate inner contour.

[0113] Optionally, based on multiple candidate inner contour features of the target component in the local coordinate system, the candidate inner contour features belonging to the same physical feature are matched according to a preset matching rule to obtain the correspondence between the parameters of each candidate inner contour.

[0114] The matching rules include positional consistency, size consistency, and topological consistency of each candidate inner contour feature in each view.

[0115] S504. Determine the target inner contour information of each target component based on the correspondence of the parameters of each candidate inner contour.

[0116] Optionally, after obtaining the correspondence of each candidate inner contour parameter, the candidate inner contour parameters are fused in the local coordinate system corresponding to the target component according to the correspondence of each candidate inner contour parameter to obtain the inner contour information of each target component in the corresponding local coordinate system, and the inner contour information of each target component in the corresponding local coordinate system is transformed to the world coordinate system to obtain the target inner contour information of each target component.

[0117] For example, the number of views to which each inner contour belongs can be determined according to the correspondence of each candidate inner contour parameter, and the corresponding candidate inner contour parameters can be fused according to the number of views to which each inner contour belongs to, to obtain a target inner contour information of each target component, and the target inner contour information of each target component can be obtained after all inner contours of each target component have been processed.

[0118] In one example, if an inner contour is detected in two or more views, that is, the number of views to which the inner contour belongs is greater than or equal to 2, then its three-dimensional shape, spatial position and extension direction are determined by the joint constraints of multiple views, for example, by referring to the aforementioned S403.

[0119] In another example, if an inner contour is detected only in a single view, that is, the number of views to which the inner contour belongs is less than 2, then the projection shape of the inner contour in the missing view is inferred by combining the relative position of the inner contour in the outer contour to which it belongs, the projection relationship with the outer contours of other views, common mechanical structure rules, and the distribution of adjacent features.

[0120] For example, if the front view detects a rectangular inner contour while the top view detects a circular inner contour, it can be determined that the inner contour corresponds to a circular hole structure extending along the depth direction; if both the front view and the side view detect a rectangular groove while the top view does not detect a closed contour, it can be determined that it is an open groove structure extending along the length or width direction.

[0121] For example, the target inner contour information includes multiple second space curves in the world coordinate system and the view source to which each second space curve belongs. All the second space curves in the world coordinate system constitute all the inner contours of the target component.

[0122] In one possible implementation, Figure 6 This is a flowchart illustrating the process of determining the intermediate shape and contour information of the object to be calculated in the material cost calculation method for 2D engineering machinery drawings provided in this application embodiment. (Refer to...) Figure 6 As shown, in S303 above, based on the target outer contour information and the target inner contour information of each target component, the intermediate shape information and intermediate contour information of the object to be calculated are determined, including: S601. Based on the target outer contour information of each target component, determine the outer contour entity of each target component and the primitive type of each target component.

[0123] Optionally, taking a target component as an example, all the first spatial curves in the target outer contour information of the target component are divided into a first front view curve group, a first top view curve group, and a first side view curve group according to the view source mark, and an unrestricted stretching operation is performed on each first view curve group along the corresponding direction to generate a first stretched body, a second stretched body, and a third stretched body.

[0124] Specifically, the first front view curve group is stretched along the Z-axis of the world coordinate system to generate the first stretched body; the first top view curve group is stretched along the Y-axis of the world coordinate system to generate the second stretched body; and the first side view curve group is stretched along the X-axis of the world coordinate system to generate the third stretched body.

[0125] Optionally, a Boolean intersection operation is performed on the first, second, and third extruded bodies to obtain the outer contour solid of the target component. The outer contour solid is a closed three-dimensional solid representing the outermost envelope shape of the target component.

[0126] Optionally, the geometric features of the outer contour entity are extracted. The geometric features of the outer contour entity include: quantity, type of face, angle relationship between adjacent faces, and cross-sectional changes along each axis.

[0127] Optionally, the extracted geometric features are matched with a preset primitive determination rule library to determine the primitive type of the target component. The primitive types of the target component include cuboids, cylinders, stepped axes, extruded bodies, or bodies of revolution, etc.

[0128] S602. Based on the target inner contour information of each target component, generate at least one inner contour entity corresponding to each target component and the primitive type of each inner contour entity.

[0129] Optionally, taking a target component as an example, all the second spatial curves of the target component are divided into a second front view inner curve group, a second top view inner curve group, and a second side view inner curve group according to the source view mark. Based on all the second spatial curves of the target component, at least one curve loop is obtained by clustering through a preset endpoint distance connectivity clustering algorithm. Based on a preset depth rule base, the depth attribute of each curve loop in the target component is determined.

[0130] Specifically, if a curved loop exists in all three view groups and its projection penetrates the boundary of the outer contour entity, then the curved loop is determined to be a through hole type, and the depth value is set to a preset penetration value. If the curved loop only exists in some views and is associated with depth dimension annotation information, then it is determined to be a blind hole or countersunk hole type, and the depth value is taken from the depth dimension annotation information. If the curved loop is composed of multiple coaxial curve segments and the diameter varies, then it is determined to be a stepped hole type, and the diameter and depth of each segment are recorded separately.

[0131] Optionally, based on the depth attribute of each curve ring in the target component, an extrusion operation is performed on each curve ring along the direction of the corresponding source view to generate the corresponding inner contour entity.

[0132] Specifically, for through holes, the stretching length is the length that penetrates the outer contour solid; for blind holes or countersunk holes, the stretching length is the depth value; and for stepped holes, the inner contour solid is generated in segments.

[0133] Optionally, the geometric features of the inner contour entity can be extracted. The geometric features of the inner contour entity include: cross-sectional shape, number of cylindrical segments, diameter variation relationship, and presence or absence of a bottom surface.

[0134] Optionally, the extracted geometric features are matched with a preset inner contour feature determination rule library to determine the primitive type of each inner contour entity. The primitive types of inner contour entities include through holes, blind holes, countersunk holes, stepped holes, waisted grooves, and square grooves.

[0135] S603. Based on the outer contour entity of each target component, at least one inner contour entity corresponding to each target component, and the primitive type of each inner contour entity, determine each target entity corresponding to each target component, as well as the outer contour parameters and inner contour parameters of each target entity, and use the primitive type of each target component as the primitive type of each target entity.

[0136] Optionally, at least one inner contour entity corresponding to each target component is sorted according to a preset deduction priority rule. The deduction priority rule includes: inner contour entities with larger volumes are deducted first, inner contour entities with through holes are deducted first than inner contour entities with blind holes, and inner contour entities with intersecting relationships are merged and deducted.

[0137] Optionally, in the sorted order, Boolean subtraction is performed on each inner contour entity from the outer contour entities to obtain the target entity corresponding to the target component. The target entity is a closed three-dimensional entity with an internal cavity structure.

[0138] Optionally, extract the outer contour parameters from the target entity. For cuboid primitives, extract the length, width, and height; for cylinder primitives, extract the radius and height; for stepped axis primitives, extract the radii and lengths at each level.

[0139] Optionally, internal contour parameters can be extracted from the target entity. For through holes and blind holes, the hole diameter and depth are extracted; for countersunk holes, the major diameter, minor diameter, major diameter depth, and minor diameter depth are extracted; for waisted grooves, the groove width, groove length, and depth are extracted.

[0140] Optionally, the primitive type of the outer contour entity determined in S601 can be used as the primitive type label of the target entity.

[0141] S604. Based on the target entities corresponding to each target component, the outer contour parameters and inner contour parameters of each target entity, the primitive type of each target entity, and the pre-trained shape contour processing model, obtain the intermediate shape information and intermediate contour information of the object to be calculated.

[0142] Optionally, the target entities corresponding to each target component, the outer contour parameters and inner contour parameters of each target entity, and the primitive type features of each target entity are encoded and input into the pre-trained shape contour processing model. The shape contour processing model performs contour missing completion, size conflict arbitration, and non-standard feature semantic naming, and infers contour completion information, conflict arbitration information, and semantic naming information.

[0143] Among them, the shape contour processing model is a geometric semantic reasoning model based on the Transformer architecture.

[0144] Among them, contour completion information refers to the generation of completion suggestions based on symmetry priors and structural priors when geometric incompleteness caused by view occlusion or missing lines is detected in the target entity. Contour completion information includes the location, size and type of the missing face.

[0145] Among them, conflict arbitration information refers to the consistency correction based on engineering semantic constraints when a geometric contradiction is detected between the outer contour parameters and the inner contour parameters. Conflict arbitration information includes the output of the corrected parameter values ​​and the corrected confidence level.

[0146] Semantic naming information refers to outputting semantic category labels and corresponding standard parameter descriptions for non-standard geometric features that cannot be matched by the rule base. Semantic naming information includes semantic category labels and corresponding standard parameter descriptions.

[0147] Optionally, based on the contour completion information, conflict arbitration information, and semantic naming information output by the contour shape processing model, corresponding geometric modification operations are performed on each target entity, including adding missing features, adjusting feature size, or re-labeling feature type, to obtain each final entity, the outer contour parameters of each final entity, and the inner contour parameters.

[0148] Optionally, each final entity and its outer and inner contour parameters are encapsulated at the object level to obtain the intermediate shape and contour information of the object to be calculated.

[0149] Specifically, all final entities are assembled according to their positions in the world coordinate system to obtain the intermediate shape information of the object to be calculated. The outer contour parameters of all final entities are then combined in the three principal projection directions to obtain the outer contour boundary of the object to be calculated. The inner contour parameters of all final entities are then combined in the three principal projection directions to obtain the inner contour boundary of the object to be calculated. The outer contour boundary and the inner contour boundary of the object to be calculated are then used as the intermediate contour information of the object to be calculated.

[0150] In one possible implementation, Figure 7This application provides a flowchart illustrating the process of determining the material cost of an object to be calculated in a material cost calculation method for 2D engineering machinery drawings, as illustrated in the embodiments of this application. Figure 7 As shown, in step S105 above, the material cost of the object to be calculated is determined based on the preset mapping relationship between the material unit price and the material density, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated. This includes: S701. Determine the actual size parameters of the object to be calculated based on the shape information and target contour information of the object to be calculated.

[0151] Optionally, the actual size parameters of the object to be calculated can be obtained based on the shape information, target contour information, and proportion information of the object to be calculated.

[0152] S702. Calculate the volume of the object to be calculated based on its shape information and actual size parameters.

[0153] Optionally, the volume of the object to be calculated can be obtained based on the shape information and the actual size parameters of the object.

[0154] For example, a preset standard basic geometric volume formula can be invoked to calculate the volume of the object to be calculated by subtracting the excavated volume from the superimposed volume, thereby ensuring accuracy and efficiency.

[0155] S703. Based on the volume of the object to be calculated, the material parameters of the object to be calculated, and the preset mapping relationship between the unit price of the material and the density of the material, the material cost of the object to be calculated is obtained.

[0156] Optionally, based on the material parameters of the object to be calculated, the material unit price of the object to be calculated is obtained from the preset mapping relationship between material unit price and material density, and the material cost of the object to be calculated is obtained based on the volume of the object to be calculated.

[0157] Based on the same inventive concept, this application also provides a material cost calculation device for 2D engineering machinery drawings, which corresponds to the material cost calculation method for 2D engineering machinery drawings. Since the principle of the device in this application is similar to the material cost calculation method for 2D engineering machinery drawings described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0158] Reference Figure 8 As shown, Figure 8This is a schematic diagram of a material cost calculation device for 2D engineering machinery drawings provided in an embodiment of this application. The device includes: a segmentation module 801, an extraction module 802, a detection module 803, a first determination module 804, and a second determination module 805. The segmentation module 801 is used to acquire the target engineering machinery drawing and input the target engineering machinery drawing into a pre-trained view segmentation model to segment and obtain at least one view of the target engineering machinery drawing, wherein the target engineering machinery drawing includes at least one object; Extraction module 802 is used to extract text from the target engineering machinery drawings to obtain the attribute parameters of each object, including material parameters; The detection module 803 is used to detect the view contour information of each view based on each view and the pre-trained contour detection model. The view contour information includes the inner contour parameters and outer contour parameters of each component under the view. The contour detection model is trained based on the preset inner contour dynamic weighted loss function. The first determining module 804 is used to determine the shape information and target contour information of the object to be calculated based on the view contour information of each view. The target contour information includes: the inner contour parameters and the outer contour parameters of the object to be calculated. The second determining module 805 is used to determine the material cost of the object to be calculated based on the preset mapping relationship between the unit price of the material and the density of the material, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated.

[0159] Optionally, the dynamic weighted loss function for the inner contour includes: dynamic weight coefficients, which include: the basic weight coefficient for the contour category and the incremental weight coefficient for the inner contour.

[0160] Optionally, the inner contour increment weighting coefficient is determined based on the pixel area of ​​the inner contour in the sample data.

[0161] Optionally, the first determining module 804 is specifically used for: Based on the view outline information of each view, determine the intermediate shape information and intermediate outline information of the object to be calculated; The intermediate shape information and intermediate contour information of the object to be calculated, the target engineering machinery drawings and various views are input into the pre-trained multimodal large model, and the multimodal large model infers the shape information and target contour information of the object to be calculated.

[0162] Optionally, the first determining module 804 is specifically used for: Based on the outer contour parameters of each component in each view, determine multiple target components of the object to be calculated and the target outer contour information of each target component; Based on the inner contour parameters of each target component in each view and the target outer contour information of each target component, determine the target inner contour information of each target component of the object to be calculated. Based on the target outer contour information and the target inner contour information of each target component, the intermediate shape information and intermediate contour information of the object to be calculated are determined.

[0163] Optionally, the first determining module 804 is specifically used for: Based on the outer contour parameters of each component in each view, calculate the feature similarity results of each component in each view; Based on the feature similarity results of each component in each view, multiple target components belonging to the object to be calculated are determined; The outer contour parameters of each target component in each view are fused to obtain the target outer contour information of each target component.

[0164] Optionally, the first determining module 804 is specifically used for: Based on the target outer contour information of the target component, construct the local coordinate system corresponding to the target component; Project the inner contour parameters of the target component in each view onto the local coordinate system corresponding to the target component to obtain multiple candidate inner contour parameters of the target component in the local coordinate system; Based on multiple candidate inner contour parameters of the target component in the local coordinate system, the target inner contour information of the target component to be calculated is determined.

[0165] Optionally, the first determining module 804 is specifically used for: Based on the target outer contour information of each target component, determine the outer contour entity of each target component and the primitive type of each target component; Based on the target inner contour information of each target component, generate at least one inner contour entity corresponding to each target component and the primitive type of each inner contour entity. Based on the outer contour entity of each target component, at least one inner contour entity corresponding to each target component, and the primitive type of each inner contour entity, determine each target entity corresponding to each target component, as well as the outer contour parameters and inner contour parameters of each target entity, and use the primitive type of each target component as the primitive type of each target entity. Based on the target entities corresponding to each target component, the outer contour parameters and inner contour parameters of each target entity, the primitive type of each target entity, and the pre-trained shape contour processing model, the intermediate shape information and intermediate contour information of the object to be calculated are obtained.

[0166] Optionally, the second determining module 805 is specifically used for: Based on the shape information and target contour information of the object to be calculated, determine the actual size parameters of the object to be calculated; The volume of the object to be calculated is obtained based on the shape information and actual size parameters of the object. The material cost of the object to be calculated is obtained based on the volume of the object, the material parameters of the object, and the preset mapping relationship between the unit price of the material and the density of the material.

[0167] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0168] This application also provides an electronic device, such as... Figure 9 As shown, Figure 9 The schematic diagram of the electronic device structure provided in this application embodiment includes: a processor 901 and a memory 902, and optionally, a bus 903. The memory 902 stores machine-readable instructions executable by the processor 901. When the electronic device is running, the processor 901 and the memory 902 communicate via the bus 903. The processor 901 executes the machine-readable instructions to perform the steps of the material cost calculation method for 2D engineering machinery drawings described above.

[0169] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the material cost calculation method for 2D engineering machinery drawings described above.

[0170] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0171] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0172] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for calculating material costs based on 2D engineering machinery drawings, characterized in that, include: Obtain the target construction machinery drawing and input the target construction machinery drawing into a pre-trained view segmentation model to segment and obtain at least one view of the target construction machinery drawing, wherein the target construction machinery drawing includes at least one object; Text extraction is performed on the target engineering machinery drawings to obtain the attribute parameters of each object, including: material parameters; Based on each view and the pre-trained contour detection model, the view contour information of each view is detected. The view contour information includes the inner contour parameters and outer contour parameters of each component under the view. The contour detection model is trained based on a preset inner contour dynamic weighted loss function. Based on the view contour information of each view, the shape information and target contour information of the object to be calculated are determined. The target contour information includes: the inner contour parameters and the outer contour parameters of the object to be calculated. The material cost of the object to be calculated is determined based on the preset mapping relationship between the unit price of the material and the density of the material, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated.

2. The material cost calculation method for 2D engineering machinery drawings according to claim 1, characterized in that, The inner contour dynamic weighted loss function includes: dynamic weight coefficients, which include: contour category basic weight coefficients and inner contour incremental weight coefficients.

3. The material cost calculation method for 2D engineering machinery drawings according to claim 2, characterized in that, The inner contour increment weighting coefficient is determined based on the pixel area of ​​the inner contour in the sample data.

4. The material cost calculation method for 2D engineering machinery drawings according to claim 1, characterized in that, The step of determining the shape information and target contour information of the object to be calculated based on the view contour information of each view includes: Based on the view outline information of each view, determine the intermediate shape information and intermediate outline information of the object to be calculated; The intermediate shape information and intermediate contour information of the object to be calculated, the target engineering machinery drawing and each of the views are input into a pre-trained multimodal large model, and the shape information and target contour information of the object to be calculated are obtained by reasoning from the multimodal large model.

5. The material cost calculation method for 2D engineering machinery drawings according to claim 4, characterized in that, The step of determining the intermediate shape information and intermediate contour information of the object to be calculated based on the view contour information of each view includes: Based on the outer contour parameters of each component in each view, determine multiple target components of the object to be calculated and the target outer contour information of each target component; Based on the inner contour parameters of each target component in each view and the target outer contour information of each target component, determine the target inner contour information of each target component; Based on the target outer contour information and the target inner contour information of each target component, the intermediate shape information and intermediate contour information of the object to be calculated are determined.

6. The material cost calculation method for 2D engineering machinery drawings according to claim 5, characterized in that, The step of determining multiple target components of the object to be calculated and the target outer contour information of each target component based on the outer contour parameters of each component in each view includes: Based on the outer contour parameters of each component in each view, calculate the feature similarity results of each component in each view; Based on the feature similarity results of each component in each view, multiple target components belonging to the object to be calculated are determined; The outer contour parameters of each target component in each view are fused to obtain the target outer contour information of each target component.

7. The material cost calculation method for 2D engineering machinery drawings according to claim 5, characterized in that, The step of determining the target inner contour information of each target component based on the inner contour parameters of each target component in each view and the target outer contour information of each target component includes: Based on the target outer contour information of the target component, a local coordinate system corresponding to the target component is constructed; Project the inner contour parameters of the target component in each view onto the local coordinate system corresponding to the target component to obtain multiple candidate inner contour features of the target component in the local coordinate system; Based on the multiple candidate inner contour features of the target component in the local coordinate system, the correspondence between the parameters of each candidate inner contour is determined. Based on the correspondence of the candidate inner contour parameters, the target inner contour information of each target component is determined.

8. The material cost calculation method for 2D engineering machinery drawings according to claim 5, characterized in that, The step of determining the intermediate shape information and intermediate contour information of the object to be calculated based on the target outer contour information and the target inner contour information of each target component includes: Based on the target outer contour information of each target component, determine the outer contour entity of each target component and the primitive type of each target component; Based on the target inner contour information of each target component, generate at least one inner contour entity corresponding to each target component and the primitive type of each inner contour entity. Based on the outer contour entity of each target component, at least one inner contour entity corresponding to each target component, and the primitive type of each inner contour entity, determine each target entity corresponding to each target component, as well as the outer contour parameters and inner contour parameters of each target entity, and use the primitive type of each target component as the primitive type of each target entity. Based on the target entities corresponding to each target component, the outer contour parameters and inner contour parameters of each target entity, the primitive type of each target entity, and the pre-trained shape contour processing model, the intermediate shape information and intermediate contour information of the object to be calculated are obtained.

9. The material cost calculation method for 2D engineering machinery drawings according to claim 1, characterized in that, The step of determining the material cost of the object to be calculated based on the preset mapping relationship between material unit price and material density, the material parameters of the object to be calculated, and the shape information and target contour information of the object to be calculated includes: Based on the shape information and target contour information of the object to be calculated, the actual size parameters of the object to be calculated are determined; The volume of the object to be calculated is obtained based on the shape information and the actual size parameters of the object to be calculated. The material cost of the object to be calculated is obtained based on the volume of the object to be calculated, the material parameters of the object to be calculated, and the preset mapping relationship between the material unit price and the material density.

10. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, wherein when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the material cost calculation method for 2D engineering machinery drawings as described in any one of claims 1 to 9.