A building plan outer wall identification and building area calculation method and device and a storage medium

By combining multimodal large models with multi-level deterministic gating, the problem of accuracy and deterministic verification of building perimeter boundary identification in non-standard CAD drawings was solved, and the accuracy and verifiability of building area calculation were achieved.

CN123138458APending Publication Date: 2026-11-20苏州明新智算科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611656840.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-26
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify building boundaries, especially for complex-shaped buildings, when processing non-standard CAD drawings. Furthermore, the calculation results lack deterministic verification, making it prone to omissions, miscalculations, or duplicate calculations, and the results are difficult to verify.

Method used

A method combining a multimodal large model with multi-level deterministic gating is adopted. Candidate external wall areas are generated through deterministic geometric analysis. The multimodal large model is invoked only when there are uncertain signals, and gating such as format protocol, coordinate topology, evidence selection and unit measurement is performed to ensure the accuracy and traceability of the results.

Benefits of technology

It improves the accuracy and reliability of building area calculation, reduces miscalculations and duplicate calculations, and achieves verifiability and traceability of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138458A_ABST
    Figure CN123138458A_ABST
Patent Text Reader

Abstract

The application relates to a building plan outer wall identification and building area calculation method and device and a storage medium, which comprises the following steps: obtaining building plan vector data and establishing a graph element index; determining a geometric analysis to generate an outer wall candidate; determining whether to call a large model according to a risk routing gate control according to an uncertainty signal; the large model outputs a limited candidate boundary and does not output a building area; retrying or backtracking when a format protocol, a coordinate topology and an evidence selection gate control fail; determining a region passing through the gate control as a measurement region, and performing unit calibration, measurement rule matching and area calculation; after area release, cross-graph deduplication and project summarization, outputting building area and graph element evidence, gate control track and review status. The application improves the adaptability of complex drawings, prevents model hallucination from affecting area calculation, and makes the result recalculable and traceable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent processing technology for architectural drawings, and in particular to a method, device and storage medium for identifying exterior walls and calculating building area from architectural floor plans. Background Technology

[0002] Currently, building area is a fundamental indicator in planning review, design verification, cost estimation, quantity surveying, and asset management. In actual CAD drawings, the building's outer boundary is usually not a complete closed outline, but rather scattered across architectural floor plans, roof plans, detailed drawings, and multi-story drawings, including elements and annotations such as walls, curtain walls, structural columns, doors and windows, platforms, and open spaces. Different design firms differ in layer names, element types, block definitions, coordinate origins, and drawing habits. The same exterior wall may be expressed as a double-line wall, a single-line wall, a curtain wall grid line, a structural column edge line, or an arc, and may experience local interruptions due to components such as doors, windows, and entrances. Existing semi-automatic methods typically use preset layers, maximum closed loops, circumscribed rectangles, convex hulls, or grid connected regions to determine the area range. Some methods also attempt to introduce rule engines or large models to assist in drawing understanding and boundary extraction.

[0003] However, the adaptability of the aforementioned existing technologies to non-standard CAD drawings still needs improvement. On the one hand, relying solely on fixed layers or single geometric rules can easily lead to misjudgments for complex architectural forms such as recesses, courtyards, atriums, patios, multiple main structures, curved exterior walls, and open platforms. On the other hand, when large models are directly output for boundaries or areas, there is a lack of deterministic verification, which may result in risks such as format errors, coordinate drift, topological anomalies, unit conflicts, semantic illusions, and insufficient evidence, making it difficult to use directly for area measurement. Furthermore, building area calculation also involves judging the spatial attributes of areas such as balconies, platforms, open spaces, equipment shafts, and roof structures, as well as identifying model spatial units, floor assignments, and duplicate planes. When a single drawing contains multiple floors, or when the same floor has multiple exported versions, enlarged partial views, and repetitive representations, relying solely on geometric connectivity or the number of files for area statistics can easily lead to omissions, miscalculations, or duplicate calculations. Moreover, the calculation results lack a correspondence with the original CAD elements, making verification and traceability difficult.

[0004] Therefore, this application proposes a method, device, and storage medium for identifying exterior walls in building floor plans and calculating building area. Summary of the Invention

[0005] To address the shortcomings of existing technologies in identifying building perimeter boundaries, such as insufficient adaptability to non-standard CAD drawings, lack of deterministic verification of model output, and difficulty in tracing and verifying area results, this application provides a method, apparatus, and storage medium for identifying building floor plan exterior walls and calculating building area.

[0006] Firstly, this application provides a method for identifying exterior walls and calculating building area from architectural floor plans, employing the following technical solution: A method for identifying exterior walls and calculating building area from architectural floor plans, based on a multimodal large model and multi-level deterministic gating execution, includes the following steps: S1. Obtain the vector data of the building floor plan, parse and establish a graph element index with the original graph element handle and coordinate transformation relationship; S2. Perform deterministic geometric analysis on the graphic element index to generate one or more candidate exterior wall areas with original graphic element evidence; determine the floor category and area category corresponding to the candidate exterior wall area based on the drawing title, floor label, room and door / window relationship, roof and outdoor structure text and spatial adjacency relationship, and divide the area into included area, additional main body, hole area or excluded area. S3. Extract the uncertainty signal associated with the candidate external wall area, and determine whether to call the multimodal large model through risk routing gating; when the uncertainty signal meets any preset trigger condition, call the multimodal large model and execute step S4; otherwise, do not execute step S4, retain the candidate external wall area and execute step S5. S4. The multimodal large model reads the source image of the building floor plan and outputs the restricted candidate boundaries and semantic information; the multimodal large model does not output the final building area, nor does it have the final regional decision-making power; S5. When the multimodal large model is invoked, format protocol gating is performed on the candidate boundaries output by the multimodal large model; coordinate topology gating and evidence selection gating are performed on the candidate boundaries output by the multimodal large model and the candidate outer wall regions generated by deterministic geometry analysis; the evidence selection gating selects one of the candidate boundaries of the multimodal large model and the candidate outer wall regions generated by deterministic geometry analysis that have passed the coordinate topology gating as a region to be verified; when the multimodal large model is not invoked, coordinate topology gating and evidence selection gating are performed on the candidate outer wall regions generated by deterministic geometry analysis, and the candidate outer wall regions that pass the gating are selected as regions to be verified; when the multimodal large model is invoked and any gating fails, limited retries are performed within a preset retry budget, or the process reverts to the candidate outer wall regions generated by deterministic geometry analysis; when the multimodal large model is not invoked and any gating fails, the corresponding region is marked as pending review. S6. The area to be verified is determined as the measurement area. Through unit and measurement rule gating, the conversion factor of the model space length of the building plan to meters is determined based on at least two independent types of dimensional evidence. Based on the conversion factor, measurement rule matching and geometric area calculation are performed on the measurement area to obtain the building area of ​​a single plan. When the conversion factor cannot be confirmed by at least two independent types of dimensional evidence, the corresponding area is marked as pending verification and is not included in the determination of the total area. S7. Implement area publishing gating for the building area of ​​the single drawing, mark the area that passes the area publishing gating as confirmed, and mark the area that fails as pending review; based on floor identification, title association, coordinate range and area intersection-union ratio, remove duplicate exported drawings, partial details and version drawings of the same floor, and establish planar groups; retain one measurement instance in each group, and summarize the areas in the confirmed and pending review states to obtain the floor building area and the project building area; S8. Output the building area of ​​the project, as well as the corresponding original graphic evidence, gating execution trajectory and review status; The multi-level deterministic gating includes risk routing gating, format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating; the risk routing gating is executed in step S3, the format protocol gating, coordinate topology gating, and evidence selection gating are executed in step S5, the unit and measurement rule gating is executed in step S6, and the area publication gating is executed in step S7.

[0007] Preferably, obtaining the vector data of the building floor plan in step S1 specifically includes: scanning the project catalog and matching the building floor plan, assigning a unique project identifier, drawing identifier, floor identifier and operation identifier to each drawing; retaining all candidate drawings and matching reasons when there is ambiguity in the matching, and not forcing a unique match by truncating the file name.

[0008] Preferably, the step S1 of establishing the graph element index specifically includes: reading the unit information, layer attributes and block definitions of the vector model space, recursively expanding nested blocks and inheriting coordinate transformations; the extracted entities include at least one of the following: lines, polylines, arcs, circles, ellipses, spline curves, text and inserted blocks; for each entity, the original handle, parent block handle, effective layer, geometric parameters and visibility are saved, and a reversible mapping between model space coordinates and rendered image coordinates is established.

[0009] Preferably, before performing deterministic geometric analysis in step S2, a structural cleaning step is also included: identifying auxiliary entities such as drawing frames, grid lines, dimension lines, annotations, and local details based on layer names, line types, entity dimensions, text density, and drawing frame features; outputting cleaning decisions, including entities supported by wall pairings, semantic wall lines, doors and windows, or structural columns into the protection set, and not removing them along with the auxiliary entities; and not reading the truth value of manually filled patterns during the structural cleaning process.

[0010] Preferably, step S2, which generates one or more candidate exterior wall areas with original primitive evidence, specifically includes: establishing spatial buckets for normalized line segments according to their direction and normal position, calculating the direction difference, normal spacing, and projection overlap rate of the two lines; when the direction difference, normal spacing, wall thickness range, and projection overlap rate all meet the set thresholds, forming a straight wall band, and binding the original primitive handles at both ends, the center line, and the boundary support rate.

[0011] Preferably, generating one or more candidate exterior wall regions with original primitive evidence further includes: for arc-shaped walls, establishing an arc-shaped wall zone based on the center distance, radius difference, and common angle interval; when the proportion of arc length to the perimeter of the main region, the proportion of radius to the diagonal of the bounding box, and the proportion of grid boundary support all meet the set thresholds, the original arc geometry is preserved.

[0012] Preferably, step S2, which generates one or more candidate exterior wall areas with original primitive evidence, further includes semantic boundary generation: extracting lines containing the semantics of walls, doors and windows, curtain walls, or structural columns from layer names, line types, or adjacent text, and generating semantic evidence bands by setting a half-width buffer; forming semantic boundary candidates after being filtered by the same closure rules and frame as the wall bands; and including exterior wall area candidates when the semantic boundary candidates are supported by the main wall and their area, compactness, and bounding box fill rate meet the set thresholds.

[0013] Preferably, after generating candidate exterior wall areas in step S2, the process further includes area closure and sorting: within the set opening closure distance, buffer connections and geometric unions are performed on the wall bands; for broken lines caused by doors, windows or entrances, closure is only performed when the endpoint distance, direction and adjacent wall evidence are simultaneously satisfied; candidate scores are calculated based on candidate area, wall density, compactness, bounding box fill rate and title association, and the largest subject and independent additional subjects that reach the set proportion are retained.

[0014] Preferably, in step S2, determining the floor category and area category corresponding to the candidate exterior wall area specifically includes: distinguishing between the first floor, standard floor, roof floor, machine room floor, and mixed floor plan based on file name and drawing title; the continuous enclosed indoor area within the central door on the first floor is included as the included area, and the outdoor ancillary space is excluded as the candidate; the area enclosed by the continuous exterior wall in the standard floor is included as the main body; the machine room or stairwell with enclosure and roof evidence in the roof floor is an additional main body, the open-air platform, non-accessible roof and eaves are excluded as candidates, and the open courtyard, atrium and cantilever are open hole candidates; textual and semantic evidence is only used to trigger risk warnings and area category markings, and does not directly modify the original geometric boundaries.

[0015] Preferably, the uncertainty signal in step S3 includes at least one of the following: no effective closed region, fragmented candidate region, number of candidates exceeding a threshold, missing semantic evidence of the wall, difference between the area of ​​the semantic candidate and the wall band candidate exceeding a threshold, inconsistency between the semantic and geometric classification of the floor, proportion of circular arcs at the building scale exceeding a threshold, abnormal overlap of cross-map regions, and unit cannot be confirmed by multi-source evidence.

[0016] Preferably, the risk routing gating invokes the multimodal large model when any preset trigger condition is met, and marks the risk level as general, severe, or requiring review according to the number and severity of the triggering reasons. The risk level is used for routing and auditing.

[0017] Preferably, the preset triggering conditions include at least one of the following: candidate fragmentation is defined as having 4 or more valid candidate regions and the largest candidate region area accounting for less than 75% of the total candidate area; the ratio of semantic candidate area to wall band candidate area is less than 0.9 or greater than 4.5; architectural scale arc is defined as having an arc length accounting for more than 12% of the perimeter of the main body's outer boundary, a radius accounting for more than 20% of the diagonal of the main body's bounding box, and a boundary support rate of more than 80%; abnormal candidate quantity is defined as having 9 or more candidate pools or having 5 or more ultimately retained regions.

[0018] Preferably, the multimodal large model in step S4 includes a scene descriptor and a boundary resolver: the scene descriptor reads a source image without geometric overlay, outputs floor type, layout structure, target boundary evidence and exclusion clues, and generates restricted hints for use by the boundary resolver; the boundary resolver reads the same source image, the restricted hints and examples selected by floor, and outputs the presence, absence or uncertainty status, confidence level and one or more normalized candidate polygons.

[0019] Preferably, the multimodal large model is a multimodal visual language large model, which is adapted for tasks through architectural drawing prompting protocol, floor example library, two-stage role constraints, strict JSON mode and deterministic gating; the examples selected by floor are filtered according to floor category, with 5 examples each for the first floor and the roof floor, and 3 examples for the standard floor. When there are no matching examples, it degenerates to zero-sample inference and records audit information; the examples are in the form of images and standard JSON answers as context input, used to explain the boundary method, the method of excluding outdoor structures, the method of arc processing and coordinate protocol, and are not directly used as the final result.

[0020] Preferably, the output of the boundary resolver satisfies the following limitations: a maximum of 8 regions are output at a time, each region has a maximum of 512 vertices on its outer ring, and all coordinates use normalized coordinates from 0 to 1000 with the top-left corner as the origin; the output of the boundary resolver is gated by a format protocol to verify JSON format, field enumeration and numerical finiteness, topologically gated by coordinate range, area, closure, self-intersection and multi-region overlap, and evidence-selected by evidence to verify wall coverage, candidate intersection-union ratio, model area to geometric area ratio and original primitive support.

[0021] Preferably, in the multi-level deterministic gating, each gating level except for the risk routing gating outputs a gating number, pass status, hard failure reason code, and suggested deviation; the hard failure reason code is fed back to the multimodal large model to constrain the next output, and finite retries are performed within a preset retry budget; when the budget is exhausted or the evidence still conflicts, the large model candidate is selected, the deterministic geometric candidate is retained, the correction is continued, or the status is changed to pending review, and the gating version, routing decision, and retry history are recorded.

[0022] Preferably, in step S5: the format protocol gating is used to verify the output format, field enumeration and numerical finiteness; the coordinate topology gating is used to verify the coordinate range, closure, positive area, no self-intersection, hole inclusion and region overlap rate; the evidence selection gating is used to verify the wall band coverage, candidate intersection-union ratio, model area to geometric area ratio, and original primitive boundary support rate.

[0023] Preferably, in the evidence selection gating, the cross-union ratio threshold for consistency between geometric results and model results is 0.85, the cross-union ratio threshold for candidate region deduplication is 0.80, and the allowable overlap ratio between multiple output regions is controlled within 1%.

[0024] Preferably, step S6, which involves determining the conversion factor of the model space length to meters based on at least two independent types of dimensional evidence, specifically includes: determining the conversion factor of the model space length to meters based on at least two independent types of dimensional evidence; the dimensional evidence includes vector file unit fields, project configuration, dimension annotations, known wall thickness, and grid spacing; taking the weighted median of multiple unit candidates and calculating the consistency residual; confirming the unit only when the consistency residual is not greater than a set threshold, otherwise retaining the candidate area and prohibiting the publication of the confirmed area; the consistency residual is not greater than 1% in normal scenarios and not greater than 0.5% in strict scenarios; when only one type of unit evidence exists, retaining the candidate conversion factor and candidate area, marking them as unconfirmed units, and excluding them from determining the total area of ​​the project.

[0025] Preferably, the geometric area calculation in step S6 specifically includes: performing geometric union on the included area and the additional main body on the same floor, deducting the included holes and the excluded areas that intersect with the union result from the union result to obtain the net area; calculating the area of ​​straight boundary using the shoelace formula, calculating the area of ​​circular boundary using Green's formula, or using curve adaptive discretization, computational geometry library, vector and raster cross-validation; multiplying the model space area by the square of the length conversion factor and the included factor to obtain the building area; wherein, door and window openings are by default treated as boundary openings and the plane area is not deducted, atriums, courtyards and open spaces are deducted as holes, and open platforms, non-accessible roofs and eaves are deducted as excluded areas.

[0026] Preferably, the establishment of planar grouping in step S7 specifically includes: identifying duplicate exported drawings, partial details and version drawings of the same floor based on floor identifiers, standardized titles, coordinate ranges and area intersection-union ratios; when the intersection-union ratio of two areas exceeds a threshold, retaining a measurement entity by combining title strength, boundary support, version time and completeness.

[0027] Preferably, the area publishing gate in step S7 includes: cross-validation based on the relative residuals of the area formula value and the inverse value of the dimension chain, the boundary support rate, the ratio of the model area to the geometric area, and the region intersection-union ratio; closure, topology, unit, hole inclusion, exclusion of out-of-bounds, dimension chain, and cross-graph deduplication as hard checks for publishing; only when all hard checks pass is the area marked as a determined state; otherwise, it is marked as a pending review or uncertain state, and candidate areas, failure reasons, and recalculation entries are retained.

[0028] Preferably, in the area publishing gating, the relative residual of the size chain area is controlled within 1%, and when it exceeds 1% to 2%, it is switched to a pending review state; the boundary support rate is not less than 80% in ordinary scenarios and not less than 90% in scenarios with higher requirements.

[0029] Preferably, the output in step S8 specifically includes: writing the region source, coordinate system, unit calibration result, measurement rules, inclusion coefficient, deduction basis, calculation formula, original graphic element evidence, gate trajectory, risk level and review status into a structured JSON result; the JSON result serves as the data object and audit carrier for area calculation, and each area result can be traced back to the original CAD graphic element.

[0030] Secondly, this application provides a device for identifying exterior walls in building floor plans and calculating building area, employing the following technical solution: A device for identifying exterior walls in building floor plans and calculating building area includes: The input parsing module is used to obtain the vector data of the building floor plan, parse it, and create a graph element index with the original primitive handles and coordinate transformation relationships; The deterministic geometric parsing module is used to perform deterministic geometric parsing on the graphic element index, generate one or more candidate exterior wall areas with original graphic element evidence, and determine the floor category and area category corresponding to the candidate exterior wall areas; The risk routing module is used to extract uncertainty signals associated with the candidate external wall area, and to determine whether to call the multimodal large model through risk routing gating; it is called when any preset trigger condition is met, otherwise the candidate external wall area is retained. The large model verification module is used to read the source drawing of the building floor plan through the multimodal large model when called, and output the restricted candidate boundary and semantic information; the multimodal large model does not output the final building area, nor does it have the final regional decision-making power; A multi-level gating control module is used to perform format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publishing gating. The evidence selection gating selects a candidate boundary from the model candidate boundary and the candidate exterior wall area generated by deterministic geometric analysis as the region to be verified. If the verification fails, a limited retry is performed within a preset retry budget, or the region is rolled back to the candidate exterior wall area generated by deterministic geometric analysis. The area calculation module is used to determine the area to be verified as the measurement area, determine the conversion factor from the model space length to meters based on at least two independent types of dimensional evidence, and perform measurement rule matching and geometric area calculation based on the conversion factor to obtain the building area of ​​a single drawing; when the conversion factor cannot be confirmed, it is marked as pending verification. The deduplication and aggregation module is used to perform area release gating on the building area of ​​the single drawing, marking the area that passes the gating as confirmed and the area that fails the gating as pending review. Based on the floor identifier, title association, coordinate range and area intersection and union ratio, the module deduplicates the duplicate drawings of the same floor and aggregates the areas in the confirmed and pending review states to obtain the floor building area and the project building area. The audit release module is used to output the building area of ​​the project, as well as the corresponding original graphic evidence, gating execution trajectory and review status.

[0031] Preferably, the multi-level gating control module is a state machine structure. Each gating outputs a gating number, pass status, hard failure reason code, and suggested deviation. The hard failure reason code is fed back to the large model verification module to constrain the next output. Limited retries are performed within a preset retry budget. When the budget is exhausted or the evidence still conflicts, the module selects to adopt the large model candidate, retain the deterministic geometric candidate, continue to correct, or switch to a pending verification state.

[0032] Thirdly, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.

[0033] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0034] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0035] In summary, this application includes at least one of the following beneficial technical effects: 1. This application combines deterministic geometric analysis with risk routing gating, and only calls the multimodal large model when there are uncertain signals. This can reduce unnecessary model calls while supplementing the semantics and boundary information of complex drawings, and retain the original primitive evidence, which is convenient for review and traceability.

[0036] 2. This application employs a multi-level deterministic gating system consisting of format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating to verify, select, retry, and roll back model and geometric candidates. This helps prevent candidates with format errors, coordinate drift, topology anomalies, unit conflicts, and insufficient evidence from directly entering the area calculation chain, thereby improving the reliability of building area calculation results.

[0037] 3. This application achieves area aggregation from single map to floor and then to project by using unit calibration, measurement rule matching, hole and exclusion area deduction, cross-map deduplication and project summary, and writes the area source, calculation formula, unit evidence, deduction basis, gate control trajectory and review status into the structured JSON result. It can reduce omissions, recalculations and manual drawing, and improve the recalculation and traceability of the results. Attached Figure Description

[0038] Figure 1 This is a flowchart of the overall process for identifying exterior walls and calculating building area based on a multimodal large model and multi-level deterministic gating in the embodiments of this application. Figure 2 This is a flowchart illustrating the process of establishing the image element index in an embodiment of this application; Figure 3 This is a flowchart of the candidate generation process for the exterior wall area in this application embodiment; Figure 4 This is a flowchart illustrating the process of determining floor and area categories in an embodiment of this application; Figure 5 This is a flowchart of multimodal large model verification and multi-level gating in the embodiments of this application; Figure 6 This is a flowchart of the building area calculation and project summary in the embodiments of this application; Figure 7 This is a structural block diagram of the building plan exterior wall recognition and building area calculation device in the embodiments of this application.

[0039] Figure labeling: 1. Input parsing module; 2. Deterministic geometric parsing module; 3. Risk routing module; 4. Large model verification module; 5. Multi-level gating control module; 6. Area calculation module; 7. Deduplication and summarization module; 8. Audit release module. Detailed Implementation

[0040] The following is in conjunction with the appendix Figure 1-7 This application will be described in further detail below. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0041] To facilitate understanding of this application, some terms are defined below.

[0042] Multimodal large model: refers to a large visual language model capable of processing both image and text information simultaneously. Its specific underlying model can be replaced without affecting the multi-level deterministic gating process of this application. In one embodiment, the multimodal large model includes a scene descriptor and a boundary parser.

[0043] Image Descriptor: A module in multimodal large models used to read source images without geometric overlay, output floor types, layout structures, target boundary evidence, exclusion clues, and restricted hints.

[0044] Boundary resolver: A module used in multimodal large models to read the same source map, provide limited hints, and select by floor, outputting presence, absence, or uncertainty states, confidence scores, and normalized candidate polygons.

[0045] Limited information: The context information output by the scene descriptor to the boundary resolver includes at least the floor type, layout structure, target boundary evidence, and exclusion clues.

[0046] Constrained coordinate protocol: Coordinate constraints that the boundary resolver follows when outputting candidate polygons, including normalized coordinates from 0 to 1000, a maximum of 8 regions at a time, and a maximum of 512 vertices on the outer ring of each region.

[0047] External wall boundary: The outer boundary of the building determined according to the project measurement standard can be expressed by the outer line of the wall surface, the outermost line of the curtain wall, a single-line wall, or a verified curved boundary.

[0048] WAG wall zone: A wall area formed by two paired wall lines. WAG stands for Wall Area Geometry.

[0049] Semantic lines: Single lines or curves supported by the semantics of walls, curtain walls, doors, windows, or structural columns in the layer name, line type, block attributes, or adjacent text.

[0050] Building area: A closed spatial object with floor and measurement attributes, including the main building and additional entities that can be measured independently.

[0051] Candidate areas for exterior walls: Candidate areas with original primitive evidence generated by deterministic geometric analysis, including included areas, additional subjects, hole areas, or excluded areas.

[0052] Hole areas: Atriums, courtyards, or open spaces located within the included area and deducted according to the measurement rules, usually represented by hole_rings.

[0053] Excluded areas: Open-air platforms, non-accessible roofs, eaves, gutters, outdoor stairs, or entrance platforms that intersect with or are adjacent to the included areas but are not included in the current definition.

[0054] Area to be verified: The area that is ready to be entered into the area calculation after being selected by the evidence selection gating system.

[0055] Measurement area: The area ultimately determined as the object of area calculation.

[0056] Multi-level deterministic gating: It consists of risk routing gating, format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating, which control the mechanisms of model invocation, candidate adoption, finite retries, geometric backoff, manual review, and area publication.

[0057] Risk routing gating: determines whether to call the control node of the multimodal large model based on uncertainty signals; it is called immediately when any preset trigger condition is met.

[0058] Format protocol gating: Gating of the output format, field enumeration and numerical finiteness of multimodal large models.

[0059] Coordinate topology gating: Gating of coordinate range, closure, positive area, no self-intersection, hole inclusion and region overlap rate.

[0060] Evidence selection gating: Select one region from model candidates and geometric candidates as the region to be verified, and verify the wall band coverage, candidate intersection-union ratio, model area to geometric area ratio, and original primitive boundary support rate.

[0061] Unit and measurement rule gating: confirm the conversion factor for model space length to meters, the inclusion factor, and the gating of hole and exclusion rules.

[0062] Area publishing gating: Gating the area by performing hard checks such as dimensional chain residuals, boundary support, hole inclusion, out-of-bounds exclusion, and cross-graph deduplication.

[0063] Uncertainty signals: The set of signals that trigger risk routing gating, including the absence of a valid closed region, fragmentation of candidate regions, the number of candidates exceeding the threshold, lack of semantic evidence for walls, the difference between the area of ​​semantic candidates and wall band candidates exceeding the threshold, inconsistency between floor semantics and geometric classification, the proportion of circular arcs at the building scale exceeding the threshold, abnormal overlap of cross-map regions, and units that cannot be confirmed by multi-source evidence.

[0064] Risk Level: Risk routing gating is classified as general, severe, or requires review based on the number and severity of triggering causes. It is used for routing and auditing, and does not replace the triggering conditions.

[0065] Hard failure reason code: The reason code output when the gating check fails, which is fed back to the multimodal large model to constrain the next output.

[0066] Suggestive deviation: The prompt message output when the gating verification passes but a deviation exists.

[0067] Limited retry budget: The preset number of retries. Limited retries will be performed within this budget after a hard failure reason code is reported.

[0068] Dimensional evidence: Evidence used to determine the conversion factor from model space length to meters, including vector file unit fields, project configuration, dimension annotations, known wall thicknesses, and grid spacing.

[0069] Weighted median: The median of multiple candidate units is taken after weighting them according to the reliability of the evidence, and is used to determine the conversion factor.

[0070] Consistency residual: The deviation between multiple unit candidates and the weighted median, which is no greater than 1% in normal scenarios and no greater than 0.5% in strict scenarios.

[0071] Net region: The region obtained after combining the included region with the additional entity, and deducting the included holes and the excluded regions that intersect with the combined result.

[0072] Inclusion factor κ: The area conversion factor determined by the project measurement rules. A value of 1 indicates full inclusion, a value of 0 indicates exclusion, and a value between 0 and 1 indicates proportional inclusion.

[0073] plan_group: A plan group of the same type formed by floor identifiers, title associations, coordinate ranges and area overlap relationships. It is used to deduplicate duplicate drawings or apply project rule multiples.

[0074] Status: The region and area have passed all hard checks and the units have been confirmed.

[0075] Status pending review: The region still has risks related to geometry, semantics, units, topology, deduplication, or measurement methods. Candidate values ​​are retained but not included in the determination of the total area of ​​the project.

[0076] Area publishing hard checks: closure, topology, units, hole inclusion, out-of-bounds exclusion, dimension chains, and cross-graph deduplication checks.

[0077] Model and gating audit fields: model_identity and model_version record the identity and version of the multimodal large model, geometry_prediction retains the original model candidates, gate_trace and retry_history record gating at each level and retries, and final_region_source records the final region source.

[0078] In one embodiment, the multimodal large model is the Qwall model configured by the applicant. The Qwall model is a multimodal visual language model configured for semantic understanding of building floor plans, resolution of exterior wall boundaries, and identification of measurement risks, including a scene descriptor and a boundary parser. The Qwall model is only one specific implementation of the multimodal large model in this application; this application is not limited to it, and other multimodal large models capable of outputting restricted semantics and candidate boundaries, and not directly deciding on building area, are also applicable. The underlying layer of the Qwall model is the multimodal visual language large model, which is adapted for tasks through a building drawing hint protocol, a floor example library, two-stage role constraints, strict JSON mode, and deterministic gating. The basic model can be replaced, and the hint protocol and example library can be adjusted without affecting the multi-level deterministic gating process of this application.

[0079] Reference Figure 1 This application provides a method for identifying exterior walls and calculating building area from architectural floor plans, based on a multimodal large model and multi-level deterministic gating execution. The method includes: S1. Obtain the vector data of the building floor plan, parse and establish a graph element index with the original graph element handle and coordinate transformation relationship; S2. Perform deterministic geometric analysis on the graphic element index to generate one or more candidate exterior wall areas with original graphic element evidence; determine the floor category and area category corresponding to the candidate exterior wall area based on the drawing title, floor label, room and door / window relationship, roof and outdoor structure text and spatial adjacency relationship, and divide the area into included area, additional main body, hole area or excluded area. S3. Extract the uncertainty signal associated with the candidate external wall area, and determine whether to call the multimodal large model through risk routing gating; when the uncertainty signal meets any preset trigger condition, call the multimodal large model and execute step S4; otherwise, do not execute step S4, retain the candidate external wall area and execute step S5. S4. The multimodal large model reads the source image of the building floor plan and outputs the restricted candidate boundaries and semantic information; the multimodal large model does not output the final building area, nor does it have the final regional decision-making power; S5. When the multimodal large model is invoked, format protocol gating is performed on the candidate boundaries output by the multimodal large model; coordinate topology gating and evidence selection gating are performed on the candidate boundaries output by the multimodal large model and the candidate outer wall regions generated by deterministic geometry analysis; the evidence selection gating selects one of the candidate boundaries of the multimodal large model and the candidate outer wall regions generated by deterministic geometry analysis that have passed the coordinate topology gating as a region to be verified; when the multimodal large model is not invoked, coordinate topology gating and evidence selection gating are performed on the candidate outer wall regions generated by deterministic geometry analysis, and the candidate outer wall regions that pass the gating are selected as regions to be verified; when the multimodal large model is invoked and any gating fails, limited retries are performed within a preset retry budget, or the process reverts to the candidate outer wall regions generated by deterministic geometry analysis; when the multimodal large model is not invoked and any gating fails, the corresponding region is marked as pending review. S6. The area to be verified is determined as the measurement area. Through unit and measurement rule gating, the conversion factor of the model space length of the building plan to meters is determined based on at least two independent types of dimensional evidence. Based on the conversion factor, measurement rule matching and geometric area calculation are performed on the measurement area to obtain the building area of ​​a single plan. When the conversion factor cannot be confirmed by at least two independent types of dimensional evidence, the corresponding area is marked as pending verification and is not included in the determination of the total area. S7. Implement area publishing gating for the building area of ​​the single drawing, mark the area that passes the area publishing gating as confirmed, and mark the area that fails as pending review; based on floor identification, title association, coordinate range and area intersection-union ratio, remove duplicate exported drawings, partial details and version drawings of the same floor, and establish planar groups; retain one measurement instance in each group, and summarize the areas in the confirmed and pending review states to obtain the floor building area and the project building area; S8. Output the building area of ​​the project, as well as the corresponding original graphic evidence, gating execution trajectory and review status; The multi-level deterministic gating includes risk routing gating, format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating. The risk routing gating is executed in step S3, the format protocol gating, coordinate topology gating, and evidence selection gating are executed in step S5, the unit and measurement rule gating is executed in step S6, and the area publication gating is executed in step S7.

[0080] This application combines deterministic geometric analysis with risk routing gating to invoke a multimodal large model only when uncertain signals exist, reducing unnecessary model calls while supplementing complex drawing semantics and boundary information. Multi-level deterministic gating verifies, selects, retryes, and rolls back model and geometric candidates, preventing candidates with format errors, coordinate drift, topological anomalies, unit conflicts, or insufficient evidence from directly entering the area calculation chain. Through unit calibration, measurement rule matching, cross-drawing deduplication, and project aggregation, and by writing evidence, formulas, gating trajectories, and review status into structured JSON, the building area results are recalculated and traceable.

[0081] The steps described above are explained in detail below.

[0082] Example 1: Overall Processing Flow In one exemplary embodiment, such as Figure 1 As shown, a complete method is provided from inputting a building floor plan to publishing the building area result. This method is based on the original graph elements and reversible coordinate relationships as evidence, uses deterministic geometric calculations as the basis for area execution, employs a multimodal large model and intelligent agents to handle semantic ambiguity and abnormal scenarios, and uses unified JSON to carry intermediate results, area, and audit information.

[0083] The system receives the project input root directory, formal output directory, working directory, and optional area caliber configuration. It only scans project subdirectories starting with numerical numbers within the project root directory, locating a unique original image directory for each project, and matching project images and DXF original images by complete filename, standardized title, composite title, and unique subtitle. When files with the same name, version images, or multiple subtitles cause ambiguity, the system does not randomly select an image but retains a candidate set, title differences, version time, and matching reason; if necessary, it generates a rendered image with coordinate mapping from the DXF for manual selection. The system assigns a project_id, drawing_id, floor_id, and run_id to each image, and all subsequent region and area records reference these identifiers.

[0084] The system reads the ModelSpace range, DXF unit field, layer visibility, and block definition, recursively expands INSERT and nested blocks, and extracts LINE, LWPOLYLINE, POLYLINE, ARC, CIRCLE, ELLIPSE, SPLINE, TEXT, and MTEXT. Each entity stores its original handle, parent block handle, valid layer, entity type, endpoints or control points, center, radius, angle range, rotation angle, visibility, and parent block transformation.

[0085] The system identifies the drawing frame, title block, grid lines, dimension lines, legends, and detailed drawings based on layers, line types, entity dimensions, coverage, text density, frame consistency, and grid patterns to form a cleaning decision. Entities semantically adjacent to walls, windows, curtain walls, or structural columns, capable of forming a reasonable thickness with another wall, or supported by door and window relationships are included in the protection set, even if they are located on a mixed layer. The system does not read the ground truth of manually filled patterns during structural cleaning.

[0086] The system creates spatial buckets for the cleaned line segments and arc segments, generates straight WAGs, arc WAGs and semantic line evidence bands, performs finite distance closure, geometric union, hole restoration, topological simplification and candidate scoring on the candidates, and retains the largest subject and independent additional subjects that meet the relative area and wall support thresholds.

[0087] The system combines filenames, drawing titles, floor labels, rooms, doors and windows, stairs, roofs, drainage, and spatial adjacencies to distinguish between ground floors, standard floors, roof floors, machine room floors, and mixed floors, marking candidate areas as included areas, additional main bodies, openings, or excluded areas. Area categories and evidence are simultaneously written into a unified object, and the subsequent measurement engine executes according to the configuration.

[0088] Risk routing gating reads signals such as empty results, fragmentation, multi-agent conflicts, semantic line and WAG divergence, floor semantic anomalies, large-scale arcs, and unit ambiguity. When candidates are complete and the evidence is consistent, the model is skipped and the precise geometry is preserved; when uncertainty exists, the Qwall scene descriptor and Qwall boundary parser generate verification candidates within a constrained protocol. The Qwall model is not directly written into the final region or area.

[0089] The system first verifies strict JSON, field enumeration, finite numerical values, and the number of regions and vertices. Then, it flips the 0-1000 normalized coordinate axis and projects it back into the DXF model space to check for closure, different number of points, positive area, no self-intersections, valid topology, and region overlap. Subsequently, it checks WAG coverage, original handle boundary support, deterministic candidate intersection-union ratio, area ratio, and the integrity of protected components. The gating controller distinguishes between hard failures and advisory deviations, outputting either a model candidate, a retained geometric candidate, a retry with a reason code, or a pending review status.

[0090] The system reads the DXF unit field, project unit configuration, and dimension chain. When units are missing, it uses known wall thickness and grid spacing to form candidate conversion factors. The metrology agent reads the area objects and project rules that have passed the candidate acceptance gate, and generates inclusion, deduction, conversion, and summary plans. Only when the unit evidence and rule version meet the gate requirements is the plan handed over to the deterministic geometry engine.

[0091] The system combines the main region and additional entities, deducts holes and excluded areas, calculates the net area of ​​the model space using the shoelace formula or the Green's formula for support curves, and multiplies it by the sum of the squares of the length conversion factors to obtain the area in square meters. The area publication gate continues to verify the dimension chain, area residuals, hole inclusion, exclusion of out-of-bounds errors, and cross-graph duplication; if successful, it is marked as determined; otherwise, it is converted to pending or uncertain.

[0092] The system establishes a plan_group and identifies duplicate exported drawings or partial details of the same floor by floor identifier, title, coordinate range, area intersection / union ratio, and version relationship. Each group retains only one measurement instance or applies a multiplier according to project rules, and summarizes the determined and pending areas separately.

[0093] The audit agent aggregates the original handle, region source, Qwall model identity and version, gate traces at each level, unit evidence, formulas, included and deducted items, cross-graph deduplication, retries, rollbacks, and manual review status. Only the values ​​that pass the hard check for all areas are included in the total project count; other areas are retained as pending review. JSON is not the end point of the identification process, but rather a common carrier of area calculation inputs, calculation results, and audit evidence.

[0094] Example 2: Drawing Discovery, Analysis, and Structural Cleaning like Figure 2 As shown, this embodiment illustrates how to generate a computable and traceable index of graphic elements from a project directory and the original DXF image. The input can be either DXF or a DWG, SVG, IFC, or BIM projection result that can be converted to uniform vector coordinates; for raster images such as PNG or PDF, reliable coordinate registration or dimension chains are required.

[0095] The project discoverer first standardizes spaces, full-width characters, floor aliases, and version suffixes in filenames, and then reads the title bar text. For synonymous titles such as "First Floor Plan" and "Ground Floor Plan," a standard floor_id is created; for cases where a drawing contains multiple plans or detailed views, multiple plane_ids under the same drawing_id are created to avoid merging separate plans into a single area.

[0096] During INSERT parsing, the system applies the parent's translation, rotation, scaling, and mirroring matrices to entities within child blocks until a unified ModelSpace coordinate system is obtained. The system also preserves the inverse transformation from world coordinates to the parent block's local coordinates, ensuring that any final boundary segment can be traced back to the source entity and block level. For irreversible scaling, missing block definitions, or circular block references, the system logs a parsing error and excludes the entity from participating in area determination.

[0097] The curve entity retains its original parametric form. ARC stores the center, radius, start and end angles, and direction; ELLIPSE stores the center, principal axis vector, axis ratio, and parameter range; SPLINE stores the degree, nodes, weights, and control points. Discretization according to the given chord height error is only performed downstream of the curve where the spatial index or boundary supports sampling or does not support it; the original curve is always preserved.

[0098] The rendered image coordinates are generated through a reversible affine transformation using the ModelSpace bounding box and canvas dimensions. During rendering, identified frame, grid, and annotation noise are disabled, but a separate source image without candidate overlays is saved for visual verification to prevent Qwallmodel from mistaking candidate lines drawn by the algorithm for original image evidence. Registration can be based on the four corner points of the frame, grid intersections, or known dimension chains. For multi-viewport, UCS rotation, or non-uniform scaling, the system records parsing anomalies; if registration reliability is not met, calling the multimodal large model is prohibited or manual verification is required.

[0099] Structural cleaning employs an "identification-planning-execution-verification" approach. The identification layer generates only a candidate noise set; the planning layer determines whether to REMOVE or PROTECT based on the wall protection set; the execution layer generates a post-cleaning index; and the verification layer checks the changes in wall length, number of building-scale entities, and major connected components before and after cleaning. If the loss exceeds a threshold, the corresponding cleaning item is revoked.

[0100] Candidate title frames typically have the characteristics of being close to the entire drawing bounding box, having approximately rectangular sides, and being adjacent to the title bar; the grid lines are supported by long straight lines, regular spacing, and axis number bubbles; dimension lines are supported by short-end lines, text, values, and the adjacency relationship with the annotated entities. No single layer name is sufficient for deletion.

[0101] After cleaning, the system outputs the entities index, drawing_bounds, coordinate_transform, removed_entities, protected_entities, and parse_warnings. The index is used by subsequent geometric algorithms and also referenced by evidence_handles and audit_trail in the JSON.

[0102] Example 3: External Wall Candidate Generation and Area Restoration like Figure 3 As shown, this embodiment simultaneously handles double-line walls, curved walls, semantically single lines, door and window gaps, and multi-structure buildings. The system establishes direction and offset buckets for straight walls, reducing the overhead of pairwise comparisons. For two candidate line segments, the direction difference is first calculated. The direction difference is normalized by a π period: Δθ = min(|θ1−θ2|, π−|θ1−θ2|), where θ1 and θ2 are the direction angles of the two lines. The normal spacing is calculated only if the direction difference is not greater than a configured threshold. The normal spacing is the absolute value of the projection of the line connecting the reference points of the two lines onto the unit normal vector of the first line: d_n = |(p2−p1)·n1|, where p1 and p2 are the reference points of the two lines, and n1 is the unit normal vector of the first line. The system compares the normal spacing with the reasonable wall thickness range under drawing units and filters based on evidence that the line segments are located in the same semantic layer of the wall or have common doors, windows, or adjacent structural columns. The projection overlap rate is the ratio of the projection overlap length of two lines in the common direction to the length of the shorter line segment: r_o = L_overlap / min(L1, L2), where L_overlap is the projection overlap length of the two lines in the common direction, and L1 and L2 are the lengths of the two lines. When the direction difference, normal spacing, wall thickness, and projection overlap rate all meet the threshold, a WallPair is generated and the inner and outer edges, center line, wall thickness, and handles at both ends are saved.

[0103] In one embodiment, the wall pairing angle is approximately 2°, and can be adjusted within the range of 1° to 3° depending on the type of drawing; the wall thickness threshold is approximately 60 to 700 mm, with conventional building walls concentrated between 100 and 400 mm.

[0104] For curved walls, the system pairs arcs based on center-to-center distance, radius difference, and common angle interval. If the center-to-center distance and radius difference between two arcs are less than a threshold, and the length of the common angle interval meets the wall support requirements, an arc-shaped WallPair is generated. The system prioritizes preserving the original ARC geometry, adaptively samples based on chord height error when Boolean operations are required, and writes the discrete tolerance into the result. In one embodiment, the arc length percentage reference value is 12%, the radius percentage of the bounding box diagonal is 20%, and the grid boundary support percentage reference value is 80%.

[0105] The semantic line branch extracts semantic elements such as WALL, WINDOW, CURTAIN WALL, exterior wall, curtain wall, and structural column from layers, line types, text, and block attributes. These are then buffered into evidence bands according to drawing units and subjected to the same limited closure and frame filtering as WAG. Semantic lines are used to supplement curtain walls or single-line drawings lacking double-line walls, without directly covering areas with stronger original wall evidence.

[0106] The area restoration process first connects adjacent endpoints caused by doors, windows, or entrances at a relatively small closure distance. Then, it performs geometric union on the connected wall bands, extracts the outer envelope, and restores dimensions using reverse buffering. Closure is only allowed between endpoints where direction, distance, and evidence of adjacent walls are mutually satisfied, avoiding forced sealing across courtyards or open platforms. In one embodiment, the opening closure distance is approximately 2500 mm, which can be adjusted within the range of 1500 to 3000 mm depending on the drawing accuracy.

[0107] For each candidate region, the system calculates its area, overlapping wall area, wall density, compactness, bounding box fill rate, scale across the entire drawing, title association, door and window support, and effective boundary length. The system retains the highest-scoring subject and other subjects whose area reaches a certain proportion of the main candidate and has independent wall evidence. For drawings with multiple separate towers, podiums, or ancillary buildings, the system does not replace all building entities with the largest ring, but instead creates an independent region_id for each subject. Detailed drawing candidates typically have small areas, low bounding box fill rates, weak title association, and abnormal spatial proportions with the main drawing; therefore, they are entered into the detail_candidate after joint scoring and excluded from the determined areas.

[0108] The output of region recovery simultaneously retains candidate_regions, wall_system, semantic_wall_lines, closure_operations, and evidence_handles. closure_operations records the endpoints, distances, directions, adjacency evidence, and whether each replacement line is supported by door / window relationships, facilitating manual review.

[0109] Example 4: Semantic Determination of Floor and Metering Area like Figure 4 As shown, this embodiment converts geometric candidates into regions with floor and measurement semantics. The system first reads the file name, drawing title, floor label, and room text, and combines this information with information such as doors and windows, stairs, roof, drainage, slope, accessible platforms, non-accessible roofs, and machine rooms near the candidate region to determine floor.kind.

[0110] In the ground floor plan, the indoor area inside the door and with continuous enclosure can be included in the calculation; outdoor staircases, steps, ramps, and entrance platforms outside the door are initially excluded. If the entrance platform has a roof or the project rules require it to be included, it will be converted into an additional subject and the corresponding inclusion factor will be set according to the rules.

[0111] In the standard floor plan, the area enclosed by continuous exterior walls and associated with the floor title is included in the calculation. Open courtyards, atriums, and open spaces are treated as openings and are not added to the main structure due to the presence of surrounding walls. Whether indoor stairwells, elevator shafts, etc., are deducted is determined by the project rules; the system retains the type and basis rather than fixing a single caliber in the code.

[0112] In the roof or machine room floor plan, machine rooms, stairwells, or water tank rooms with continuous walls, doors, windows, and roof cover can be considered as additional main structures; open-air platforms, non-accessible roofs, eaves, gutters, cooling tower foundations, and roof areas enclosed only by parapet walls are initially excluded. The roof projection must not be automatically equated to the interior building area simply because it is closed.

[0113] When a drawing contains multiple floor plans or multiple segmented plans, the system assigns candidate planes to different plane_ids based on the spatial extent near the title, and then forms separate floor_ids. Only areas where the title and coordinate extent are consistent are included in the same plan_group, avoiding the duplicate addition of the ground floor and roof plans in the same drawing.

[0114] Each semantic region object must contain at least region_type, outer_ring, hole_rings, source, evidence_handles, inclusion_policy, inclusion_factor, confidence, and review_state. Region type and inclusion policy are separate: the same "platform" type can have different inclusion coefficients under different project rules, but rule version, triggering conditions, and manual modification records must be included in audit_trail.

[0115] Floor semantics do not directly alter the original geometry. If the Qwall model or manual review determines that a candidate belongs to an open-air platform, the system uses this semantics as an exclusion suggestion; the final exclusion is still verified by rule gating to ensure that the candidate is located on the corresponding floor, intersects with or is adjacent to the included area, and does not disrupt the main topology. Textual and semantic evidence is only used to trigger risk warnings and area category labeling, and does not directly modify the original geometric boundaries.

[0116] Example 5: Risk Routing Gating like Figure 5 As shown, the risk routing gating determines whether to invoke the multimodal large model based on uncertainty signals. The risk detector encodes empty results, fragmentation, candidate explosion, missing semantic evidence for walls, discrepancies between semantic lines and WAG area, inconsistencies between floor titles and geometry, slope or drainage annotations on ordinary floors, architectural-scale arcs, multi-subject conflicts, cross-map overlap anomalies, and unit ambiguity into risk vectors. If the triggering conditions are not met, the multimodal large model is not invoked, and the precise CAD geometry is directly retained; if the conditions are met, the trigger codes are recorded, and the model is entered for review.

[0117] In one embodiment, the risk routing gating invokes a multimodal large model when any preset trigger condition is met, and marks the risk level as general, severe, or requiring review based on the number and severity of the triggering causes. The risk level is used for routing and auditing, and does not replace the triggering conditions.

[0118] In one embodiment, the preset triggering conditions include: candidate fragmentation is defined as having 4 or more valid candidate regions and the largest candidate region area accounting for less than 75% of the total candidate area; the ratio of semantic candidate area to wall zone candidate area is less than 0.9 or greater than 4.5; architectural scale arc is defined as an arc length accounting for more than 12% of the perimeter of the main body's outer boundary, a radius accounting for more than 20% of the diagonal of the main body's bounding box, and a boundary support rate of more than 80%; and abnormal candidate quantity is defined as having 9 or more candidate pools or having 5 or more ultimately retained regions.

[0119] When the uncertainty signal meets any triggering condition, the multimodal large model is invoked; otherwise, the candidate for the outer wall area is retained and step S5 is executed.

[0120] Therefore, low-risk drawings can directly retain deterministic geometry, avoiding unnecessary model calls; high-risk drawings are entered into model verification, balancing efficiency and adaptability to complex drawings.

[0121] Example 6: Multimodal Large Model Verification (Qwall model example) like Figure 5 As shown, the risk routing gating determines whether to invoke the multimodal large model based on uncertainty signals. The multimodal large model is a dedicated multimodal visual language model configured for architectural floor plan tasks. A model version is jointly identified by the basic parameter model identifier, the architectural drawing prompt protocol version, the example library version organized by ground floor, standard floor, and roof floor, the role constraints of the scene descriptor and boundary resolver, and the JSON output mode. During model upgrades, `model_identity`, `model_version`, and `prompt_protocol_version` are retained for recalculation and comparison under the same gating version.

[0122] In one embodiment, the multimodal large model is a Qwall model configured by the applicant. The Qwall model consists of a scene descriptor and a boundary resolver working together. The Qwall scene descriptor only reads the source image without algorithmic candidate overlays, outputting floor categories, single-planar or multi-planar or detailed mixed layouts, suspected main body boundaries, external wall evidence, clues to exclude open areas and roofs, and a description of conflicts and risks requiring focused inspection, without outputting the final polygons and areas. The Qwall boundary resolver independently reviews the same source image and reads the description context, examples of floor-by-floor selection, restricted task hints (restricted hints), and strict JSON output mode.

[0123] The Qwall boundary resolver's state is limited to present, absent, or uncertain; it outputs one or more normalized building regions, optional holes, confidence level, evidence description, and model version. The Level 2 format protocol gating requires responses to be strict JSON, with fields and value ranges conforming to the pattern, all values ​​finite, and the number of regions and vertices per region not exceeding the upper limit. Parsing failures, missing fields, illegal enumerations, non-finite values, or exceeding limits are all considered hard failures and will not proceed to coordinate reprojection.

[0124] In one embodiment, the multimodal large model is a multimodal visual language large model, which is adapted for tasks through an architectural drawing hint protocol, a floor example library, two-stage role constraints, strict JSON schema, and deterministic gating. Examples selected by floor are filtered according to floor category: five examples are selected each for the ground floor and roof floor, and three examples are selected for standard floors. If no matching example is found, the process degenerates into zero-sample inference and records audit information. Examples are provided as contextual input in the form of images and standard JSON answers, used to illustrate boundary conditions, exclusion methods for outdoor structures, arc handling methods, and coordinate protocols; they are not directly used as the final result.

[0125] When normalized coordinates are projected back into the ModelSpace, assuming the bounding box of the effective image in the ModelSpace is [x_min, x_max] × [y_min, y_max], and the output coordinates of the Qwall boundary resolver are (x_n, y_n), then the projection relationship is: x=x_min+(x_n / 1000)(x_max−x_min); y=y_max−(y_n / 1000)(y_max−y_min); This expression explicitly flips the image along its vertical axis.

[0126] The third-level coordinate topology gating verifies the canvas registration status, normalized coordinate range, retro-projection transformation, closure, different number of points, positive area, adjacent duplicate points, self-intersection, valid polygons, hole inclusion, and region overlap. Pixel coordinates or normalized coordinates cannot be directly used as DXF coordinates; unreliable registration or invalid topology constitutes a hard failure.

[0127] Spatial consistency between model candidates and deterministic candidates can be measured using the intersection-union ratio (IoU). The fourth-level evidence selection gating simultaneously checks the WAG coverage near the candidate boundary, the original semantic lines and handle support, the integrity of strong wall components, title relationships, area ratio, and IoU. IoU and the model geometric area ratio are used to measure discrepancies and trigger restricted retries; they do not themselves constitute sufficient conditions for correct area. Hard failures such as self-intersection, obvious boundary violations, and missing protection components directly prohibit the use of model candidates.

[0128] In one embodiment, the output of the boundary resolver satisfies the following limitations: a maximum of 8 regions are output at a time, each region's outer ring has a maximum of 512 vertices, and all coordinates use normalized coordinates from 0 to 1000 with the top-left corner as the origin. The output of the boundary resolver is gated by a format protocol to verify JSON format, field enumeration, and numerical finiteness; it is gated by a coordinate topology to verify coordinate range, area, closure, self-intersection, and multi-region overlap; and it is gated by evidence selection to verify wall band coverage, candidate intersection-union ratio, model area to geometric area ratio, and original primitive support.

[0129] Example 7: Multi-level Deterministic Gating and Evidence Selection like Figure 5 As shown, the multi-level deterministic gating sequentially executes format protocol gating, coordinate topology gating, and evidence selection gating. The gating controller writes the results of each level as gate_id, pass, failure_codes, and advisories. If the Qwallmodel candidate passes all hard gates and fills in the missing ground truth boundaries of the geometric candidate, then adopt_model_candidate is selected; if the evidence of the precise CAD curve or strong wall is more complete, keep_geometry is selected; if only correctable protocol or advisory disagreement exists, the reason code is fed back to the Qwall boundary resolver and retry_with_constraints is selected; when the budget is exhausted or the evidence is still conflicting, pending_review is selected.

[0130] In one embodiment, the multi-level deterministic gating includes risk routing gating, format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating. Specifically, risk routing gating is executed in step S3, format protocol gating, coordinate topology gating, and evidence selection gating are executed in step S5, unit and measurement rule gating is executed in step S6, and area publication gating is executed in step S7.

[0131] When a multimodal large model is invoked, format protocol gating is performed on the candidate boundaries of the model output. Format protocol gating verifies the output format, field enumeration, and numerical finiteness. Coordinate topology gating verifies coordinate range, closure, positive area, no self-intersection, hole inclusion, and region overlap. Evidence selection gating verifies wall band coverage, candidate intersection-union ratio (IoU), model area to geometric area ratio, and original primitive boundary support. The IoU is calculated as follows: IoU(P,Q)=Area(P∩Q) / Area(P∪Q), where P is the model candidate and Q is the deterministic geometric candidate. In one embodiment, the IoU threshold for consistency between geometric and model results is 0.85, the candidate region deduplication IoU threshold is 0.80, and the allowed overlap ratio between multiple output regions is controlled within 1%.

[0132] The evidence-based gating system selects a candidate region for verification from the multimodal large model candidate boundaries (gated by coordinate topology) and the candidate exterior wall regions generated by deterministic geometric analysis. The selection logic includes: if the model candidate passes all hard gates and supplements the missing true boundaries of the geometric candidate, then the model candidate is adopted; if the evidence of precise CAD curves or strong walls is more complete, then the geometric candidate is retained; if only correctable agreements or suggestive disagreements exist, then a retry with a reason code is performed; if the budget is exhausted or the evidence still conflicts, the system is switched to a pending review state.

[0133] When the multimodal large model is not invoked, coordinate topology gating and evidence selection gating are applied to the candidate exterior wall regions generated by deterministic geometry analysis, and the candidate exterior wall regions that pass the gating are designated as regions to be verified. When the multimodal large model is invoked and any gating fails, finite retries are performed within a preset retry budget, or the process reverts to the candidate exterior wall regions generated by deterministic geometry analysis; when the multimodal large model is not invoked and any gating fails, the corresponding region is marked as pending verification.

[0134] In the multi-level deterministic gating system, each gating level except for the risk routing gating outputs a gating number, pass status, hard failure reason code, and suggested deviation. The hard failure reason code is fed back to the multimodal large model to constrain the next output, and finite retries are performed within the preset retry budget. When the budget is exhausted or the evidence still conflicts, the system selects to adopt the large model candidate, retain the deterministic geometric candidate, continue to revise, or switch to a pending review state, and records the gating version, routing decision, and retry history.

[0135] The manual review interface displays the source image, deterministic candidates, Qwall model candidates, discrepancy regions, evidence handles, gating status at each level, and reasons for failure. Reviewers can modify region categories, holes, exclusions, inclusion coefficients, or units, but modifications must be written to a new `audit_trail` event and trigger a deterministic area recalculation; the total project area cannot be directly rewritten manually.

[0136] Therefore, model candidates can only enter the area calculation after being selected through format, coordinate topology and evidence gating, to prevent model illusion from directly affecting the area value; at the same time, the robustness of candidate selection is improved through finite retries and geometric backoff.

[0137] Example 8: Unit Calibration and Building Area Calculation like Figure 6 As shown, this embodiment illustrates how to calculate the building area of ​​a single map from a verified semantic region object.

[0138] Let I_f be the set of included entities for floor f, H_f be the set of openings, and E_f be the set of excluded areas, with corresponding polygons P_i, Q_j, and R_k, respectively. Let U_f be the joint result of the included areas and the additional entities. Then the net area N_f can be represented as: N_f=(∪ {i∈I_f} P_i)\((∪ {j∈H_f} Q_j)∪(∪ {k∈E_f} (R_k∩U_f))) Here, "\" represents the set difference operation, which subtracts holes that are entirely within the joint result and excluded regions that intersect with the joint result from the joint result of the included region and the additional subject. Before the Boolean operation, the system performs precision normalization and small edge cleanup on the coordinates; after the operation, it checks geometric validity, area conservation, hole inclusion, and excluded region out-of-bounds.

[0139] Unit calibration is performed before area calculation. The system prioritizes reading the DXF unit field and project configuration; when units are missing or conflicting, candidates are formed from dimensions, known wall thicknesses, grid spacing, and confirmed component dimensions. For the j-th type of evidence, the unit candidate s_j is the ratio of the actual length to the model space length: s_j=l_{j,real} / l_{j,CAD} Where l_{j,real} represents the true length of the j-th type of evidence, and l_{j,CAD} represents the corresponding model space length. The system requires at least two independent types of evidence to be consistent; guessing based solely on printing ratios is not acceptable. A weighted median is calculated for multiple candidate units. ŝ=weighted_median(s_j) And calculate the consistency residuals: ε_s=max|s_j−ŝ| / max(ŝ,ε) Here, ε is a positive number to prevent the denominator from being zero. Unit calibration is confirmed only when ε_s is not greater than a set threshold; otherwise, candidate areas are retained and marked as unit_unconfirmed. In one embodiment, the consistency residual is no greater than 1% in normal scenarios and no greater than 0.5% in strict scenarios. When only one type of unit evidence exists, candidate conversion factors and candidate areas are retained, marked as unit unconfirmed, and excluded from determining the total area of ​​the project.

[0140] For a linear polygon P arranged in sequence and closed at both ends, the directed area of ​​the model space is calculated using the shoelace formula: A_{CAD|P}=1 / 2|Σ_{i=1}^{n}(x_iy_{i+1}-x_{i+1}y_i)| The perimeter is calculated as the sum of the Euclidean distances between adjacent vertices: L(P)=Σ_{i=1}^{n}sqrt((x_{i+1}-x_i)^2+(y_{i+1}-y_i)^2) The system unifies the orientation of the outer ring and holes and calculates them at a local origin to reduce floating-point errors caused by large model space coordinates. Translation does not change the area, and the original ModelSpace coordinates are retained after calculation.

[0141] For a circular arc with center (c_x, c_y), radius r, endpoints (x_0, y_0) and (x_1, y_1), and a directed central angle Δθ, its Green's area contribution can be expressed as: A_arc=1 / 2[c_x(y_1−y_0)−c_y(x_1−x_0)+r^2Δθ] This formula allows for the preservation of curve area without reducing great circular arcs to a small number of polylines. Implementation can also utilize a validated library of curve geometry or adaptive arc-length discretization, but the discretization tolerance and upper limit of area error must be recorded.

[0142] Let the inclusion factor for region r be κ_r, the unit conversion factor be s, and the area of ​​the model space be Area(P_r), then its contribution per square meter is: A_{r,m²}=κ_r·s²·Area(P_r) Among them, κ_r and its rule version are proposed by the system and confirmed by the rule gating; κ_r=1 means full inclusion, κ_r=0 means exclusion, and 0<κ_r<1 means calculation according to the project rules.

[0143] Door and window openings are treated as openings on the exterior wall boundary by default and are not deducted from the floor plan area. Whether they are deducted is controlled by the `door_window_opening_deducted` rule. Atriums, courtyards, and open spaces are deducted using `hole_rings`; open platforms, non-accessible roofs, eaves, gutters, outdoor stairs, and entrance platforms are represented using `excluded_regions`. Each deduction saves the boundary, model space area, area in square meters, textual or graphical evidence, and manual verification status.

[0144] Therefore, when a unit cannot be confirmed by at least two types of independent evidence, the area is marked as pending verification and is not included in determining the total area, thus avoiding area errors caused by unit errors; at the same time, through explicit deduction of holes and excluded areas, the calculation of building area complies with the project measurement rules.

[0145] Example 9: Area publishing gating, cross-map deduplication, and project aggregation like Figure 6 As shown, area publishing gating, cross-map deduplication, and project summarization are executed after the building area calculation for a single map is completed.

[0146] For deduplication of multiple drawings on the same floor, a plan_group is first formed. For duplicate exported drawings, version drawings, and partial detail drawings, the system calculates the region IoU, title association, coordinate range, and boundary integrity, retains only one measurement entity, and records the source; for project rules such as the number of duplicate floors in standard floors, a single instance area is retained and m_g is set to the number of measurement instances of the same type of floor or a multiple of the project rule.

[0147] Before the area is published, multi-way cross-validation is performed. Let the area formula result be A_formula, the area calculated by the dimension chain be A_dimension, the candidate area of ​​the multimodal large model be A_model, the deterministic geometric area be A_geometry, the number of boundary sampling points be N_sample, and the number of points supported by the original wall or semantic line be N_supported. Then, the following can be calculated: Area residual: ε_A=|A_formula−A_dimension| / max(|A_dimension|,ε) Boundary support: R_support = N_supported / N_sample Model geometric area ratio: ρ_A = A_model / max(|A_geometry|, ε) The aforementioned quality signals, together with IoU, constitute the quality signal. Thresholds are configurable; excessive area residuals, insufficient boundary support, abnormal model area ratios, unconfirmed units, or unprocessed cross-graph overlaps all trigger pending or manual review. In one embodiment, the relative area residual of the size chain is controlled within 1%; when it exceeds 1% to 2%, it enters a pending review state; the boundary support rate is no less than 80% in normal scenarios and no less than 90% in scenarios with higher requirements.

[0148] The confirmed area and the area pending review of the project can be represented as follows: A_project=Σ_{g∈G}1{status_g=determined}·m_g·A_g A_pending=Σ_{g∈G}1{status_g≠determined}·m_g·A_g Where G is the deduplicated set of plan_group, A_g is the area of ​​a single instance retained within the group, m_g is the number of independently retained instances or the project rule multiple, and the indicator function takes 1 when the condition is true and 0 otherwise. By summarizing pending projects separately, the system prevents unconfirmed units or high-risk areas from quietly entering the total number of projects.

[0149] As a result, duplicate drawings and partial details are removed, and the confirmed area and the area to be verified are summarized separately, avoiding omissions, recalculations, and unconfirmed areas from being included in the total project area, thus improving the accuracy of the project building area summary.

[0150] Example 10: JSON Audit Objects and Data Structures An area result object can be represented as the following JSON. Field names and hierarchies can be adjusted according to the system interface, but traceability between calculation inputs, results, and auditing must be maintained.

[0151] json { "source": "Sixth Floor Plan.dxf", "coordinate_system": "DXF ModelSpace", "floor": {"id": "F06", "kind": "standard"}, "unit_calibration": {"cad_unit": "mm", "scale_to_meter": 0.001, "confirmed": true}, "model_identity": {"name": "Qwall model", "model_version": "QW-1.0", "prompt_protocol_version": "PP-1.0"}, "outer_wall": [438706.5, -7907.5], [467756.5, -7907.5], [467756.5, -19557.5], [438706.5, -19557.5] , "additional_regions": [], "courtyards": [], "excluded_regions": [], "evidence_handles": ["1A2F", "1A30", "1A31", "1A32"], "area_calculation": { "gross_area_model_units2": 338432500, "gross_area_m2": 338.4325, "deducted_area_m2": 0, "net_building_area_m2": 338.4325, "perimeter_m": 81.40, "inclusion_factor": 1.0, "formula": "shoelace_and_unit_square", "status": "determined" }, "cross_plan_overlap_check": {"duplicate_detected": false, "plan_group": "F06-main"}, "checks": {"closed": true, "valid_topology": true, "unit_confirmed":true, "cross_plan_overlap": false}, "final_region_source": "geometry:semantic_wall_lines", "geometry_prediction": [], "model_gate_review": {"triggered": false, "status": "not_required","gate_version": "G-1.0"}, "gate_trace": [{"gate_id": "risk_route", "pass": true, "decision": "keep_geometry"}], "routing_decision": "keep_geometry", "retry_history": [], "risk_assessment": {"level": "low", "manual_review_recmmended":false}, "audit_trail": [{"event": "area_computed", "engine": "deterministic_geometry", "status": "determined"}], "review_state": "determined" } In the JSON above, outer_wall, courtyards, and excluded_regions are both inputs for area calculation and boundaries for recalculation during auditing; model_identity, model_gate_review, gate_trace, routing_decision, and retry_history record the Qwall model and the gating process; area_calculation stores the square meter result, perimeter, deduction amount, formula, and status; final_region_source and audit_trail describe the final region source and change process.

[0152] In addition to JSON output for each drawing, project-level outputs can also generate area reports organized by floor, plan_group, and region type. Each value in the report references the corresponding region_id, drawing_id, formula, and rule version, allowing reviewers to drill down from the total area to a single floor, single region, and original element.

[0153] When drawings are changed, the system compares the entity handles, area boundaries, and titles under the old and new run_ids, and only re-identifies and recalculates the affected plan_group. Unchanged floors can continue to use the confirmed units and measurement rules, but the source and version of the reuse must still be recorded.

[0154] Example 11: Devices, Equipment, Media, and Program Products like Figure 7 As shown, in one embodiment, the building plan exterior wall recognition and building area calculation device includes an input parsing module 1, a deterministic geometric parsing module 2, a risk routing module 3, a large model verification module 4, a multi-level gating control module 5, an area calculation module 6, a deduplication and summarization module 7, and an audit release module 8.

[0155] The input parsing module acquires vector data from the building floor plan, parses it, and establishes a graph element index containing the original primitive handles and coordinate transformation relationships. The deterministic geometry parsing module performs deterministic geometry parsing on the graph element index, generating one or more candidate exterior wall areas with original primitive evidence, and determining the floor category and area category corresponding to each candidate exterior wall area. The risk routing module extracts uncertainty signals associated with the candidate exterior wall areas and uses risk routing gating to determine whether to invoke the multimodal large model; it invokes the model when any preset trigger condition is met, otherwise the candidate exterior wall area is retained. The large model verification module reads the source drawing of the building floor plan through the multimodal large model during invocation, outputting restricted candidate boundaries and semantic information; the multimodal large model does not output the final building area and does not have final area decision-making authority. A multi-level gating control module is used to execute format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publishing gating. The evidence selection gating selects a candidate boundary from the model candidate boundaries passed by the coordinate topology gating and the candidate exterior wall areas generated by deterministic geometric analysis as the area to be verified. If verification fails, a limited retry is performed within a preset retry budget, or the system reverts to the candidate exterior wall areas generated by deterministic geometric analysis. An area calculation module is used to determine the area to be verified as the measurement area, determine the conversion factor from model space length to meters based on at least two independent types of dimensional evidence, and perform measurement rule matching and geometric area calculation based on the conversion factor to obtain the building area of ​​a single drawing. If the conversion factor cannot be confirmed, it is marked as pending review. The deduplication and aggregation module is used to implement area release gating on the building area of ​​the single drawing, marking the approved areas as "confirmed" and the unapproved areas as "pending review". Based on floor identification, title association, coordinate range, and area intersection / union ratio, it deduplicates duplicate drawings of the same floor and aggregates the areas in the "confirmed" and "pending review" states to obtain the floor building area and the project building area. The audit release module is used to output the project building area, along with the corresponding original graphic element evidence, gating execution trajectory, and review status.

[0156] In one embodiment, the multi-level gating control module is a state machine structure. Each gating outputs a gating number, pass status, hard failure reason code, and suggested deviation. The hard failure reason code is fed back to the large model review module to constrain the next output. Limited retries are performed within the preset retry budget. When the budget is exhausted or the evidence is still conflicting, the module chooses to adopt the large model candidate, retain the deterministic geometric candidate, continue to correct, or switch to the pending review state.

[0157] The modules described above can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can execute on the same computer device or be distributed across the drawing parsing service, visual verification service, and area calculation service, exchanging data via intermediate objects with project_id, drawing_id, floor_id, region_id, and run_id. Regardless of the deployment method, the final area is calculated by the deterministic geometry engine based on gated regions and units.

[0158] In one embodiment, the computer device includes a processor, memory, input / output interfaces, and communication interfaces; when the program in the memory is executed by the processor, it performs input discovery, DXF parsing, candidate generation, multimodal large model verification, multi-level gating, unit calibration, area calculation, floor deduplication, project summarization, and audit release. The same program can also constitute a computer-readable storage medium or a computer program product and be deployed as a standalone program, a containerized service, a batch processing task, or multiple audited collaborative services.

[0159] Example 12: Alternative Solution Input files can be DXF, DWG converted vector files, SVG, IFC or BIM projection results, or PNG or PDF with reliable registration. For all formats, a reversible coordinate system should be established, and original primitive or pixel evidence should be preserved for gating verification.

[0160] Deterministic exterior wall candidates can be generated using bilinear WAGs, semantic single-line buffers, grid barrier lines, vector and grid fusion, or segmentation networks. The candidate generation method can be replaced, but candidates must carry source evidence and be included in risk routing and subsequent gating.

[0161] The multimodal large model can be implemented in a single stage or a two-stage model consisting of a scene descriptor and a boundary resolver. Its base model, hinting protocol, and example library can also be replaced. As long as the semantics and boundary candidates are still output in a constrained structure, and gating decisions are issued based on format, coordinate topology, evidence selection, unit rules, and area, it falls within the scope of this invention. The Qwall model can propose area categories and risks, but the inclusion factors and deduction strategies for doors, windows, balconies, canopies, equipment platforms, machine rooms, open spaces, and roof structures must be confirmed by measurement rule gating.

[0162] Area calculations can utilize shoelace formulas, Green's formula, computational geometry libraries supporting curves, adaptive curve discretization, or cross-validation of vector and raster areas. Units can be confirmed using multi-source evidence from DXF fields, project configurations, dimensioning, known wall thicknesses, and grid spacing; definitive areas should not be published if confirmation is not possible. Measurement rules can originate from versioned project rule tables, knowledge bases, or manual review results.

[0163] The exterior wall recognition service, multimodal large model service, gate controller, and area service can be physically separated, but the logical flow must continue to complete the building area calculation, area publishing gate control, and audit write-back. JSON must not be used as the endpoint for uncalculated areas. The above alternatives can be used individually or in combination.

[0164] Example 13: Experimental Data and Results The phased offline testing covered 37 projects and 189 architectural floor plans, of which 185 were target plans and 4 were empty target plans. Compared with the pre-gated deterministic baseline, the macro-average IoU of the multimodal large model and multi-level gated collaborative process improved from 81.73% to 90.68%, the micro-average IoU from 74.62% to 86.92%, the area recall from 82.04% to 95.62%, and the connected component F1 score from 71.09% to 91.50%. Of the 189 plans, 88 did not meet the risk triggering conditions, and the process directly retained deterministic geometry; 101 plans triggered the multimodal large model, of which 61 were adopted as model candidates after candidate acceptance gating, and 40 were still retained as geometric candidates by evidence-based gating after model review, with 26 finite retries with failure codes. Another engineering drawing containing both the eight-story floor plan and the server room plan was selected for building area verification. The unit gate control confirmed the model space in millimeters based on the dimensions in the drawing. The deterministic geometry engine calculated the building area of ​​the eight-story floor to be 1576.13 square meters, while the drawing indicated 1573.60 square meters, a deviation of 0.16%. The server room was calculated to be 90.08 square meters, while the drawing indicated 90.00 square meters, a deviation of 0.09%. The total area was 1666.21 square meters, with a deviation of 0.16% from the total of 1663.60 square meters on the drawing.

[0165] The above data represents a phased validation using manually labeled samples during the R&D stage. Some samples were involved in algorithm or prompting protocol development and cannot replace independent external validation on unseen projects. Current major risks still include complex roofs, mixed curtain walls and window lines, open recesses, upper and lower layer projections, unusual text or proxy objects, undeclared units, and generic hole representations. Therefore, the test results also retain the number of samples below the threshold, risk levels, and recommendations for manual review.

[0166] Regarding the beneficial effects: This application combines deterministic geometric analysis with risk routing gating, invoking a multimodal large model only when uncertain signals exist. This reduces unnecessary model calls while supplementing complex drawing semantics and boundary information, and preserves original primitive evidence for easy review and traceability. A multi-level deterministic gating system, consisting of format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating, verifies, selects, retryes, and rolls back model and geometric candidates. This helps prevent candidates with format errors, coordinate drift, topology anomalies, unit conflicts, and insufficient evidence from directly entering the area calculation chain, improving the reliability of building area calculation results. Through unit calibration, measurement rule matching, hole and exclusion area deduction, cross-drawing deduplication, and project summarization, and by writing the area source, calculation formula, unit evidence, deduction basis, gating trajectory, and review status into the structured JSON result, it can achieve area summarization from single drawing to floor to project, reducing omissions, recalculations, and manual redrawing, improving the repeatability and traceability of the results.

[0167] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

[0168] In summary, this embodiment forms a complete audit chain from drawing input to project building area through deterministic geometric analysis, risk routing gating, multimodal large model restricted verification, multi-level deterministic gating, unit calibration, area publishing, and cross-drawing deduplication, thereby improving the adaptability to complex drawings, the reliability of area calculation, and the traceability of results.

Claims

1. A method for identifying exterior walls and calculating building area from architectural floor plans, characterized in that, Based on a multimodal large model and multi-level deterministic gating execution, the following steps are included: S1. Obtain the vector data of the building floor plan, parse and establish a graph element index with the original graph element handle and coordinate transformation relationship; S2. Perform deterministic geometric analysis on the graphic element index to generate one or more candidate exterior wall areas with original graphic element evidence; determine the floor category and area category corresponding to the candidate exterior wall area based on the drawing title, floor label, room and door / window relationship, roof and outdoor structure text and spatial adjacency relationship, and divide the area into included area, additional main body, hole area or excluded area. S3. Extract the uncertainty signal associated with the candidate external wall area, and determine whether to call the multimodal large model through risk routing gating; when the uncertainty signal meets any preset trigger condition, call the multimodal large model and execute step S4; otherwise, do not execute step S4, retain the candidate external wall area and execute step S5. S4. The multimodal large model reads the source image of the building floor plan and outputs the restricted candidate boundaries and semantic information; the multimodal large model does not output the final building area, nor does it have the final regional decision-making power; S5. When the multimodal large model is invoked, format protocol gating is performed on the candidate boundaries output by the multimodal large model; coordinate topology gating and evidence selection gating are performed on the candidate boundaries output by the multimodal large model and the candidate outer wall regions generated by deterministic geometry analysis; the evidence selection gating selects one of the candidate boundaries of the multimodal large model and the candidate outer wall regions generated by deterministic geometry analysis that have passed the coordinate topology gating as a region to be verified; when the multimodal large model is not invoked, coordinate topology gating and evidence selection gating are performed on the candidate outer wall regions generated by deterministic geometry analysis, and the candidate outer wall regions that pass the gating are selected as regions to be verified; when the multimodal large model is invoked and any gating fails, limited retries are performed within a preset retry budget, or the process reverts to the candidate outer wall regions generated by deterministic geometry analysis; when the multimodal large model is not invoked and any gating fails, the corresponding region is marked as pending review. S6. The area to be verified is determined as the measurement area. Through unit and measurement rule gating, the conversion factor of the model space length of the building plan to meters is determined based on at least two independent types of dimensional evidence. Based on the conversion factor, measurement rule matching and geometric area calculation are performed on the measurement area to obtain the building area of ​​a single plan. When the conversion factor cannot be confirmed by at least two independent types of dimensional evidence, the corresponding area is marked as pending verification and is not included in the determination of the total area. S7. Implement area publishing gating for the building area of ​​the single drawing, mark the area that passes the area publishing gating as confirmed, and mark the area that fails as pending review; based on floor identification, title association, coordinate range and area intersection-union ratio, remove duplicate exported drawings, partial details and version drawings of the same floor, and establish planar groups; retain one measurement instance in each group, and summarize the areas in the confirmed and pending review states to obtain the floor building area and the project building area; S8. Output the building area of ​​the project, as well as the corresponding original graphic evidence, gating execution trajectory and review status; The multi-level deterministic gating includes risk routing gating, format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publication gating. The risk routing gating is executed in step S3, the format protocol gating, coordinate topology gating, and evidence selection gating are executed in step S5, the unit and measurement rule gating is executed in step S6, and the area publication gating is executed in step S7.

2. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S1, obtaining the vector data of the building floor plan, specifically includes: Scan the project catalog and match the architectural floor plans, assigning each drawing a unique project identifier, drawing identifier, floor identifier, and operation identifier; When there is ambiguity in the matching, all candidate drawings and the matching reason are retained, and a unique match is not forced by truncating the file name.

3. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S1, which involves creating the graph element index, specifically includes: Read the unit information, layer attributes and block definitions of the vector model space, recursively expand the nested blocks and inherit the coordinate transformation; The extracted entities include at least one of the following: straight line, polyline, arc, circle, ellipse, spline curve, text, and inserted block; For each entity, save the original handle, parent block handle, effective layer, geometric parameters and visibility, and establish a reversible mapping between model space coordinates and rendered image coordinates.

4. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Before performing deterministic geometric analysis in step S2, a structure cleaning step is also included: Identify auxiliary entities such as drawing frames, grid lines, dimension lines, annotations, and partial details based on layer names, line types, entity dimensions, text density, and drawing frame features; Output cleaning decisions, including entities supported by wall pairings, semantic wall lines, doors, windows, or structural columns into the protection set, and not removing them along with auxiliary entities; The true value of the manually filled pattern is not read during the structural cleaning process.

5. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S2, which generates one or more candidate exterior wall areas with original primitive evidence, specifically includes: Establish spatial buckets for normalized line segments according to their direction and normal position, and calculate the direction difference, normal spacing and projection overlap rate of the two lines; When the directional difference, normal spacing, wall thickness range, and projection overlap rate all meet the set thresholds, a straight wall band is formed, and the original primitive handles at both ends, the center line, and the boundary support rate are bound together.

6. The method for identifying exterior walls and calculating building area from a building plan according to claim 5, characterized in that, Generating one or more candidate exterior wall areas with original primitive evidence also includes: For a curved wall, an arc-shaped wall zone is established based on the distance between the centers, the difference in radii, and the common angle interval; When the proportion of arc length to the perimeter of the main region, the proportion of radius to the diagonal of the bounding box, and the proportion of grid boundary support all meet the set thresholds, the original arc geometry is preserved.

7. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S2, which generates one or more candidate exterior wall regions with original primitive evidence, also includes semantic boundary generation: Extract lines whose layer names, line types, or adjacent text contain semantics related to walls, doors, windows, curtain walls, or structural columns, and set a half-width buffer to generate semantic evidence bands; After being filtered using the same closure rules and frame as the wall band, semantic boundary candidates are formed. When a semantic boundary candidate is supported by the main wall and its area, compactness, and bounding box fill rate meet the set thresholds, it is included in the external wall area candidate.

8. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, After generating candidate external wall areas in step S2, the process also includes area closure and sorting: Within the set opening and closing distance, the wall strip is subjected to buffer connection and geometric union; A broken line caused by a door, window, or entrance shall be closed only if the distance and direction of the endpoint and the evidence of the adjacent wall are satisfied simultaneously. Candidate scores are calculated based on candidate area, wall density, compactness, bounding box fill rate, and title association, retaining the largest subject and independent additional subjects that meet the set ratio.

9. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S2, determining the floor category and area category corresponding to the candidate external wall area, specifically includes: Distinguish between ground floor, standard floor, rooftop floor, machine room floor, and mixed floor plan based on file name and drawing title; The continuous enclosed indoor area within the central entrance on the first floor is included in the calculation, while the outdoor ancillary space is excluded. The area enclosed by continuous exterior walls in a standard floor is included in the calculation. The machine room or stairwell with enclosure and cover evidence on the roof level are considered as additional main structures; open-air platforms, non-accessible roofs and eaves are considered as exclusion candidates; and open courtyards, atriums and open spaces are considered as candidates for openings. Textual and semantic evidence is used only to trigger risk warnings and area category markings, and does not directly modify the original geometric boundaries.

10. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, The uncertainty signal mentioned in step S3 includes at least one of the following: There is no effective closed region, the candidate region is fragmented, the number of candidates exceeds the threshold, the semantic evidence of the wall is missing, the difference between the area of ​​the semantic candidate and the wall band candidate exceeds the threshold, the semantic and geometric classification of the floor is inconsistent, the proportion of circular arcs at the building scale exceeds the threshold, there is abnormal overlap between cross-map areas, and the unit cannot be confirmed by multi-source evidence.

11. The method for identifying exterior walls and calculating building area from a building plan according to claim 10, characterized in that, The risk routing gating invokes the multimodal large model when any preset trigger condition is met, and marks the risk level as general, severe, or requiring review based on the number and severity of the triggering reasons. The risk level is used for routing and auditing.

12. The method for identifying exterior walls and calculating building area from a building plan according to claim 10, characterized in that, The preset triggering conditions include at least one of the following: Candidate fragmentation is defined as having four or more valid candidate regions, with the largest candidate region accounting for less than 75% of the total candidate area. The ratio of semantic candidate area to wall strip candidate area is less than 0.9 or greater than 4.5; The architectural scale of the arc is defined as follows: the arc length accounts for more than 12% of the perimeter of the outer boundary of the main body, the radius accounts for more than 20% of the diagonal of the main body's enclosure box, and the boundary support rate is more than 80%. An abnormal number of candidates is defined as a candidate pool of 9 or more or a final retention area of ​​5 or more.

13. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, The multimodal large model mentioned in step S4 includes a scene descriptor and a boundary resolver: The image descriptor reads the source image without geometric overlay, outputs the floor type, layout structure, target boundary evidence and exclusion clues, and generates restricted hints for use by the boundary resolver. The boundary resolver reads the same source map, the restricted hints, and the example selected by floor, and outputs the presence, absence, or uncertainty status, confidence level, and one or more normalized candidate polygons.

14. The method for identifying exterior walls and calculating building area from a building plan according to claim 13, characterized in that, The multimodal large model is a multimodal visual language large model, which adapts to tasks through architectural drawing prompting protocol, floor example library, two-stage role constraints, strict JSON mode and deterministic gating; The examples selected by floor are filtered according to floor category, with 5 examples each for the first floor and the roof floor, and 3 examples for the standard floor. If there are no matching examples, the inference is reduced to zero samples and the audit information is recorded. The example uses images and standard JSON answers as contextual input to illustrate boundary selection, exclusion of outdoor structures, arc handling, and coordinate protocols, and is not directly used as the final result.

15. The method for identifying exterior walls and calculating building area from a building plan according to claim 13, characterized in that, The output of the boundary resolver satisfies the following constraints: A maximum of 8 regions can be output at a time, and the outer ring of each region can have a maximum of 512 vertices. All coordinates use normalized coordinates from 0 to 1000 with the top left corner as the origin. The output of the boundary resolver is gated by the format protocol to verify the JSON format, field enumeration and numerical finiteness, topologically gated by the coordinate range, area, closure, self-intersection and multi-region overlap, and evidence selection to verify the wall band coverage, candidate intersection-union ratio, model area to geometric area ratio and original primitive support.

16. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, In the multi-level deterministic gating system, each gating level except for the risk routing gating outputs the gating number, pass status, hard failure reason code, and suggested deviation; The hard failure reason code is fed back to the multimodal large model to constrain the next output, and finite retries are performed within the preset retry budget; When the budget is exhausted or the evidence is still conflicting, choose to adopt the large model candidate, retain the deterministic geometric candidate, continue to revise, or switch to a pending review state, and record the gating version, routing decision, and retry history.

17. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, In step S5: The format protocol gating is used to verify the output format, field enumeration, and finiteness of values; The coordinate topology gating is used to verify coordinate range, closure, positive area, no self-intersection, hole inclusion, and region overlap rate. The evidence selection gating is used to verify wall coverage, candidate intersection-union ratio, model area to geometric area ratio, and original primitive boundary support rate.

18. A method for identifying exterior walls and calculating building area from a building plan according to claim 17, characterized in that, In the evidence selection gating, the cross-union ratio threshold for consistency between geometric results and model results is 0.85, the cross-union ratio threshold for candidate region deduplication is 0.80, and the allowable overlap ratio between multiple output regions is controlled within 1%.

19. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S6, which involves determining the conversion factor from the model space length of the building floor plan to meters based on at least two independent types of dimensional evidence, specifically includes: The conversion factor from model space length to meters is determined based on at least two independent types of dimensional evidence; the dimensional evidence includes vector file unit fields, project configuration, dimension annotations, known wall thicknesses and grid spacing; Take the weighted median of multiple candidate units and calculate the consistency residual; Units are confirmed only when the consistency residual is no greater than a set threshold; otherwise, candidate areas are retained and the publication of confirmed areas is prohibited. The consistency residual is no greater than 1% in normal scenarios and no greater than 0.5% in strict scenarios. When only one type of unit evidence exists, the candidate conversion factor and candidate area are retained, marked as unconfirmed, and excluded from determining the total area of ​​the project.

20. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, Step S6, which involves performing geometric area calculations, specifically includes: Perform a geometric union between the included area and the additional main body on the same floor, and subtract the included holes and the excluded areas that intersect with the union result from the union result to obtain the net area; For straight boundary lines, the shoelace formula is used to calculate the area; for circular boundary lines, Green's formula is used to calculate the area; or curve adaptive discretization, computational geometry library, and vector and raster cross-validation are used. Multiply the model space area by the square of the length conversion factor and the factor to obtain the building area; Among them, door and window openings are treated as boundary openings and are not deducted from the floor area by default; atriums, courtyards, and open spaces are deducted as holes; and open platforms, non-accessible roofs, and eaves are excluded areas.

21. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, The establishment of planar grouping in step S7 specifically includes: Based on floor identification, standardized titles, coordinate ranges, and area intersection-union ratio, identify duplicate exported drawings, partial details, and version drawings for the same floor; When the intersection-to-union ratio of two regions exceeds the threshold, a single measurement entity is retained by combining header strength, boundary support, version time, and completeness.

22. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, The area publishing gating mentioned in step S7 includes: Cross-validation was performed using the relative residuals between the area formula values ​​and the inverse calculation values ​​of the dimension chain, the boundary support rate, the ratio of model area to geometric area, and the region intersection-union ratio. Closure, topology, unit, hole containment, out-of-bounds exclusion, dimension chain, and cross-graph deduplication are hard checks for publication; Only when all hard checks pass will the area be marked as determined; otherwise, it will be marked as pending review or uncertain, and the candidate area, failure reason and recalculation entry will be retained.

23. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, In the area publishing gating, the relative residual of the size chain area is controlled within 1%, and when it exceeds 1% to 2%, it is switched to a pending review state; the boundary support rate is not less than 80% in ordinary scenarios and not less than 90% in scenarios with higher requirements.

24. The method for identifying exterior walls and calculating building area from a building plan according to claim 1, characterized in that, The output in step S8 specifically includes: Write the region source, coordinate system, unit calibration results, measurement rules, inclusion coefficients, deduction basis, calculation formula, original graphic element evidence, gated trajectory, risk level and review status into the structured JSON result; The JSON results serve as the data object and auditing carrier for area calculation, and each area result can be traced back to the original CAD drawing.

25. A device for identifying exterior walls in a building plan and calculating building area, characterized in that, include: The input parsing module is used to obtain the vector data of the building floor plan, parse it, and create a graph element index with the original primitive handles and coordinate transformation relationships; The deterministic geometric parsing module is used to perform deterministic geometric parsing on the graphic element index, generate one or more candidate exterior wall areas with original graphic element evidence, and determine the floor category and area category corresponding to the candidate exterior wall areas; The risk routing module is used to extract uncertainty signals associated with the candidate external wall area, and to determine whether to call the multimodal large model through risk routing gating; it is called when any preset trigger condition is met, otherwise the candidate external wall area is retained. The large model verification module is used to read the source drawing of the building floor plan through the multimodal large model when called, and output the restricted candidate boundary and semantic information; the multimodal large model does not output the final building area, nor does it have the final regional decision-making power; A multi-level gating control module is used to perform format protocol gating, coordinate topology gating, evidence selection gating, unit and measurement rule gating, and area publishing gating; the evidence selection gating selects one of the candidate exterior wall areas generated by the model candidate boundary and deterministic geometric analysis through the coordinate topology gating as the area to be verified; If the verification fails, perform a limited retry within the preset retry budget, or fall back to the candidate external wall area generated by deterministic geometric analysis; The area calculation module is used to determine the area to be verified as the measurement area, determine the conversion factor from the model space length to meters based on at least two independent types of size evidence, and perform measurement rule matching and geometric area calculation based on the conversion factor to obtain the building area of ​​a single map. If the conversion factor cannot be confirmed, it is marked as pending review. The deduplication and aggregation module is used to perform area release gating on the building area of ​​the single map, marking the area that passes the gating as confirmed and the area that fails the gating as pending review. Based on floor identification, title association, coordinate range and area intersection and union ratio, duplicate drawings of the same floor are deduplicated and the areas in the confirmed and pending review status are summarized to obtain the floor building area and the project building area. The audit release module is used to output the building area of ​​the project, as well as the corresponding original graphic evidence, gating execution trajectory and review status.

26. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 24.

27. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 24.

28. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 24.