Dynamic rule engine and multi-objective audit task decomposition method for power diagram
By using a dynamic rule engine and a multi-objective review task decomposition method, the problems of rule management and insufficient utilization of parallel computing resources in power engineering drawing review are solved, achieving efficient and stable power drawing review, outputting detailed reports, and improving the quality and efficiency of power engineering construction and operation and maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-07
AI Technical Summary
Existing power engineering drawing review technology suffers from several drawbacks. It lacks comprehensive version management and online update capabilities for rules, requiring system downtime for rule changes, which makes it difficult to support frequent trial runs and rapid iterations. Furthermore, the drawing parsing process lacks stability, fails to fully utilize parallel computing resources, and lacks a unified standard for review results, leading to low efficiency and unstable quality.
By employing a dynamic rule engine and a multi-objective audit task decomposition method, the system obtains power rule files, performs semantic parsing and filtering, generates structured cells, optimizes task allocation using a greedy algorithm, achieves parallel execution and result write-back, and establishes a mapping relationship between rule name, category, and version to ensure flexible and efficient rule management and full utilization of parallel computing resources.
It achieves flexible and efficient rule management to adapt to the needs of power drawing review, improves stability and review efficiency under complex conditions, outputs detailed multi-dimensional review reports, enhances the quality and reliability of power drawing review, and provides strong support for power engineering construction and operation and maintenance.
Smart Images

Figure CN121503098B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of digitalization and intelligent review of electric power engineering, and particularly relates to a dynamic rule engine and multi-target review task decomposition method for electric power drawings. BACKGROUND
[0002] The construction and operation of electric power engineering have long relied on a large number of electric power engineering drawings, which cover primary main wiring, secondary circuit, grounding and lightning protection, panel and cabinet layout, equipment list and terminal table, and other types.
[0003] The drawing habits of different units and projects differ significantly, which is reflected in layer naming, labeling method, symbol system, table style, font and coding, and the precision of size labeling. These differences make the batch review significantly more difficult. The traditional approach mainly relies on professional personnel to check item by item, which not only ensures the consistency of the size and the geometric alignment, but also checks the naming and numbering specifications, verifies the consistency between the table and the drawing, and whether the cross-page reference is closed, and pays attention to whether the element selection meets the specifications. The manual process is time-consuming, strongly dependent on expert experience, and prone to errors in uniformity and review tracking. With the centralized processing and parallel review of power grid enterprises, the demand for centralized processing of massive drawings in a short period of time is increasingly prominent, and the existing manual process cannot meet the requirements in terms of throughput efficiency and consistency.
[0004] To meet this demand, various automation attempts have emerged in the industry, many of which focus on fixed rules and scripts to cover partial checks. However, this approach often has several common shortcomings. First, the rules are often written into code or saved in simple configuration form, lacking a perfect version management and online update capability, and rule changes often require downtime to release, making it difficult to support frequent trial operation and rapid iteration. Second, the drawing analysis process often only focuses on a single element, lacking systematic linkage processing of geometry, tables, and text, and is unstable when encountering inconsistent line widths, slight rotation, redundant line segments, and noise interference, which can lead to fluctuations in the quality of structured results. Third, the granularity of task arrangement is generally large, often taking the entire drawing or project as the scheduling unit, making it difficult to decompose at a fine granularity for combinations of files, page numbers, regions, objects, and rule categories, thus failing to fully release parallel computing resources. Finally, the structured writing of review results and progress management lack a unified standard in format and field, making it difficult for subsequent positioning, review, statistical analysis, and operation management. SUMMARY
[0005] To overcome the problems in the prior art, the present application proposes a dynamic rule engine and multi-target review task decomposition method for electric power drawings.
[0006] The technical scheme for solving the above technical problems of the present application is as follows:
[0007] The present application provides a dynamic rule engine and multi-target audit task decomposition method for power drawings, comprising the following steps:
[0008] Step 10: Obtain the power rule file, parse and generate qualified rules for checking, and filter the qualified rules to obtain an effective rule pool;
[0009] Step 20: Reserve candidate areas by preprocessing the power engineering drawings, generate structured cells by merging and detecting line segments and tables, attribute the extracted and cleaned text to the corresponding cells, and form a structured result;
[0010] Step 30: Select candidate rules from the effective rule pool, extract audit objects from the structured result, generate audit points, calculate the priority of the audit points, and package them into a dispatch unit set that can be executed in parallel;
[0011] Step 40: Based on the dispatch unit set, in the execution environment with the maximum concurrency, use the dynamic model and the greedy algorithm to optimize task allocation, optimize task execution through quantitative benefits and rule checking, and merge and write back the results after all tasks are completed;
[0012] Step 50: Perform multi-dimensional audit on the structured drawing data after merging and result writing, and output an audit report.
[0013] Further, the step 10 comprises:
[0014] Obtain the power rule file, extract rule metadata, and register it as a rule index list, which is a structured index table used for locating and tracing the rule file body;
[0015] Read the rule file body according to the rule index list, perform rule semantic analysis on the file content, convert it into a unified structured rule object, and perform field verification, and record the passers as qualified rules;
[0016] According to the rule category identifier in the qualified rule, a mapping relationship of rule name, rule category identifier, and version identifier is established, and saved as a unique key of rule name+rule category identifier+version identifier;
[0017] The qualified rules are screened for validity and entered into the effective rule pool; the rules that have been parsed and have been effective are written with state, timestamp, and operator information.
[0018] Further, the qualified rules are screened for validity and entered into the effective rule pool, comprising:
[0019] According to the enable flag, the rule state, and the group and sub-group range, it is determined whether the rule enters the effective rule pool, and an indicator function is determined:
[0020] ;
[0021] In the formula, is a single rule; represents the enable flag; represents the rule state; is a sub-group to which the rule belongs; is a current sub-group set; is an indicator function, which is 1 if the condition is true, and 0 otherwise;
[0022] Only when the enable flag is yes and the rule state is valid, that is, only when , the rule can enter the effective rule pool.
[0023] Further, the step 20 comprises:
[0024] reading a power engineering drawing file and pre-processing to retain graphic content in a candidate area;
[0025] based on each line segment in the pre-processed power engineering drawing file, calculating the line segment angle of the two endpoints; based on the line segment angle and the preset angle tolerance, the preset alignment tolerance and the maximum gap, performing line segment classification and collinear merging, and removing line segments with a length less than a minimum length threshold;
[0026] calculating the significant line proportion of the candidate area, comparing the significant line proportion of the candidate area with a proportion threshold, and simultaneously detecting whether the number of cells reaches a minimum cell threshold to determine a table, and then generating a cell;
[0027] extracting text from the pre-processed power engineering drawing file, performing cleaning operations to obtain a pure text set and insertion point coordinates of the pure text in the power engineering drawing file;
[0028] by minimizing the distance between the text point and the cell center, the text is attributed to the corresponding cell;
[0029] writing the structured result and its determination mark into an intermediate data cache, wherein the structured result includes a table, a cell, text and their relationships.
[0030] Further, based on the line segment angle and the preset angle tolerance, the preset alignment tolerance and the maximum gap, the line segment classification and collinear merging are performed, including:
[0031] If the angle difference of the two line segments is within a preset angle tolerance range, the projection alignment deviation of the two line segments is less than a preset alignment tolerance threshold, and the maximum gap of the nearest endpoints is less than a preset maximum gap threshold, the collinear segments are merged.
[0032] Further, the candidate region significant line proportion is calculated, and the table is determined by comparing the candidate region significant line proportion with a proportion threshold and by detecting whether the number of cells reaches a minimum cell threshold, and then the cells are generated, including:
[0033] For each candidate region in the power engineering drawing file, the total length of the significant lines constituting the table boundary is calculated, and the total length of all line segments in the candidate region is calculated.
[0034] The significant line proportion is obtained by calculating the ratio of the total length of the significant lines to the total length of the line segments in the candidate region, and the significant line proportion is compared with a preset proportion threshold. If the significant line proportion is greater than or equal to the proportion threshold, it is indicated that the candidate region is more likely to have a table:
[0035] The number of cells in the candidate region is detected, and the detected number of cells is compared with a preset minimum cell threshold. When the detected number of cells is greater than or equal to the minimum cell threshold, the candidate region is finally confirmed as a table region.
[0036] According to the boundary and internal line segment distribution of the table, specific cells are generated.
[0037] Further, the text is attributed to the corresponding cell by minimizing the distance from the text point to the cell center, including:
[0038] For all extracted texts, the median character height is calculated. Based on the calculated median character height, a row clustering threshold is given. When the distance between two texts in the vertical direction is less than the row clustering threshold, it is determined that they are in the same row.
[0039] The median character width is calculated for all texts, and based on the median character width, a column separation threshold is given. When the distance between two texts in the horizontal direction is greater than the column separation threshold, it is considered that the two texts belong to different columns.
[0040] For each text, all candidate cell sets are traversed, the cost of the text to each candidate cell is calculated, and the candidate cell with the minimum cost is selected as the final attribution cell of the text.
[0041] Further, the step 30 includes:
[0042] A candidate rule set is filtered out from the effective rule pool according to the matching of the target type and grouping attribute of the rule;
[0043] Extracting the audit object from the structured result; considering all audit rules involved by each audit object through the limited Cartesian mapping, generating the audit point;
[0044] According to the rule category importance, historical risk weight, cross-page cross-table influence range and dependency, the priority score of each audit point is calculated, and is packaged into a set of dispatch units that can be executed in parallel.
[0045] Further, the step 40 comprises:
[0046] Initializing the parallelizer and building the thread pool; calculating the execution duration estimation value of the dispatch unit, combining the greedy scheduling algorithm to optimize thread allocation, and realizing the approximate minimization of the total completion time;
[0047] Through the quantitative parallel benefit and rule checking double mechanism, the double optimization of parallel task execution efficiency and business logic accuracy is realized, and all dispatch packages are completed or reach the termination condition to merge and result back;
[0048] Wherein, the quantitative parallel benefit: the total time of serial is The total running time of parallel is The parallel overhead is Then the speedup ratio S is:
[0049] ;
[0050] If S>1 represents that the parallel execution effectively improves the efficiency; if S≤1, the optimization parallel strategy is optimized;
[0051] The rule checking includes the independent rule judgment of each dispatch unit to the audit point in it.
[0052] Further, in the step 50, it comprises: geometric consistency and size checking, naming specification checking, consistency checking of equipment information in tables and drawings, checking whether the cross-page reference in the document is complete and closed, problem severity and confidence measurement, label box merging measurement, progress and pass rate measurement.
[0053] Compared with the prior art, the present application has the following technical effects:
[0054] (1) The present application establishes the mapping relationship of rule name, rule category identifier and version identifier, saves the rule with a unique key, records the detailed state information of the parsed and effective rules, and records the abnormal context if it fails. Effectively solve the problems that the existing technology lacks perfect version management and online updating ability, the rule change needs to be released offline, and it is difficult to support frequent trial operation and rapid iteration, make the rule management more flexible and efficient, and better adapt to the dynamic change demand of power drawing audit rules.
[0055] (2) In the drawing analysis link, the application not only focuses on a single element, but also systematically links geometry, tables and text. Through line segment classification and merging, table detection, text extraction, cleaning and attribution, the stability under complex conditions is improved, and the quality of the structured result is guaranteed. In the audit task processing, it can be disassembled from multiple dimensions such as files, page numbers, regions, objects and rule categories, generate a set of parallel executable dispatch units, and use dynamic models and greedy algorithms to optimize task allocation, fully release parallel computing resources, solve the problem that the existing technology cannot fully utilize parallel computing resources due to large task arrangement granularity, and greatly improve the audit efficiency.
[0056] (3) The application realizes the unified standard of structured writing and progress management of the audit result in format and field, which provides convenience for subsequent positioning, review, statistical analysis and operation management. At the same time, through multi-dimensional audit, covering geometry consistency, naming specification, table Figure One consistency, cross-page reference integrity, problem severity and other aspects, the quality of power drawing can be fully evaluated, and detailed audit report can be output, which effectively improves the quality and reliability of power drawing audit, provides strong guarantee for power engineering construction and operation, and has significant comprehensive benefits. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0058] Figure 1 The overall architecture of the power drawing dynamic rule engine system is shown in the figure;
[0059] Figure 2 The rule management process diagram of the application is shown in the figure;
[0060] Figure 3 The drawing analysis and structured processing flowchart of the application is shown in the figure. DETAILED DESCRIPTION
[0061] In order to further illustrate the technical means and effects adopted by the application to achieve the predetermined invention purpose, the specific implementation, structure, features and effects of the technical solutions proposed by the application will be described in detail below combined with the drawings and preferred embodiments. The specific features, structures or characteristics in one or more embodiments can be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used by the application have the same meaning as understood by those skilled in the art of the technology to which the application belongs.
[0062] In this embodiment, refer to Figures 1-3 This paper presents a dynamic rule engine and a multi-objective review task decomposition method for power drawings, including the following steps:
[0063] Step 10: Obtain the power rule file, parse and verify it to generate qualified rules, and filter the qualified rules to obtain a pool of valid rules;
[0064] Step 20: By preprocessing the power engineering drawings, candidate areas are retained, and structured cells are generated through line segment classification and merging and table detection. After extracting and cleaning the text, it is assigned to the corresponding cells to form a structured result.
[0065] Step 30: Filter candidate rules from the effective rule pool, extract audit objects from the structured results, generate audit points, calculate the priority of audit points, and package them into a set of dispatch units that can be executed in parallel;
[0066] Step 40: Based on the set of dispatch units, in the execution environment with maximum concurrency, the task allocation is optimized by using a dynamic model and a greedy algorithm, and the task execution is optimized by both quantitative benefits and rule verification.
[0067] Step 50: Determine the rules and measure the results of the task execution;
[0068] Step 60: Standardize and store the audit results, visualize them, and trigger a closed-loop governance mechanism.
[0069] The following is a detailed explanation of each of the above steps:
[0070] Step 10: Obtain the power rule file, parse and verify it to generate qualified rules, and filter the qualified rules.
[0071] As an example, step 10 specifically includes the following sub-steps:
[0072] Step 101: Obtain the power rule file, extract the rule metadata, and register it as a rule index list; the rule index list is a structured index table used to locate and trace the rule file ontology, which does not contain rule semantic content. The rule metadata includes source, file identifier, storage path, version information, generation time, file type, hash digest, etc.
[0073] From the object storage system, power rule files are obtained in batches based on the file identifier and path of the task input. Rule metadata such as source, file identifier, storage path, version information, generation time, file type, and hash digest are extracted. The metadata is associated with the file identifier and path to generate a structured rule index list.
[0074] Step 102: Read the rule file body one by one according to the rule index list, perform rule semantic parsing on the file content, convert unstructured / semi-structured rule text or tables into unified structured rule objects (field-based + executable constraint expression), and perform field validation. Those that pass the validation are recorded as qualified rules.
[0075] Convert unstructured or semi-structured power rule files in the rule index list into structured results, such as parsing tables and text to extract fields such as rule name, rule description, rule category identifier, group and subgroup, file identifier, file path, and version identifier.
[0076] Perform completeness and type validation on required fields. Completeness validation includes checking whether required fields such as rule name, rule description, rule category identifier, group / subgroup, file identifier, file path, and version identifier are empty. Verify that the data types of the fields meet expectations.
[0077] If the parsing and validation pass, the rule is considered valid. If any field is missing or the data type of a field does not match, it is recorded as an exception, the rule is marked as ineffective, the error reason is written as "rule name missing" or "incorrect version identifier format," and the deployment process for that rule ends. The processing of other rules in the same batch is unaffected, ensuring the atomicity of batch tasks. Rules that meet the conditions proceed to the next sub-step.
[0078] For example, for a single rule file f (Word / PDF / Excel / JSON, etc.):
[0079] (1) File structure parsing:
[0080] If it is JSON / YAML: extract the fields directly from the key path;
[0081] If it is an Excel file: identify the header (first row / merged cells / key column names) and extract it row by row;
[0082] For Word / PDF: Chapter title location + table extraction + paragraph segmentation (constraint trigger words such as "should / must / should not be less than").
[0083] (2) Normalization of terminology in the power sector:
[0084] Use a domain dictionary / mapping table to standardize synonyms:
[0085] “circuit breaker / switch / air switch” → breaker;
[0086] “Break-off capacity / Icu / Limit break-off capacity” → Icu;
[0087] Unit standardization: kA, A, kV, mm², etc. are converted into a unified unit system.
[0088] (3) Semantic slot filling: breaking down natural language rules into fixed slots:
[0089] target: Object type (primary device / secondary circuit / table field / cross-page reference...);
[0090] Scope: Applicable drawing types (primary main wiring / low-voltage power distribution system diagram / terminal table, etc.);
[0091] precond: Preconditions (e.g., "when transformer capacity ≥ ... / when circuit is for protection ...");
[0092] constraint: constraints (comparison operators, thresholds, formulas, enumeration sets);
[0093] severity: level of severity;
[0094] evidence: Method of evidence collection (which table column / which graphic object / which text mode).
[0095] (4) Constraint Expression Generation (Constraint IR / DSL):
[0096] Convert the rule into an executable expression:
[0097] Comparison type: expr_left >= expr_right;
[0098] Set type: value∈{…};
[0099] Regular expression: regex_match(text, pattern), where text represents the text string to be matched and pattern represents the regular expression pattern;
[0100] Page closure: exists(linked_ref) and coverage >= C0;
[0101] (5) Field Validation (Schema Validation):
[0102] Validate the parsability of required fields, types, units, and formulas; if it fails, record the error reason and mark it as invalid.
[0103] Step 103: Based on the rule category identifier in the qualified rules, establish a mapping relationship combining rule name, rule category identifier, and version identifier.
[0104] (A) Unique key mapping (anti-duplicate + traceable):
[0105] Unique key: rule_key = rule_name + rule_class_id + version;
[0106] In the above formula, rule_name represents the rule name; rule_class_id represents the rule category identifier; and version represents the version identifier.
[0107] Purpose: To prevent duplicate entries of the same name, type, and version into the database; different versions can coexist and can be rolled back.
[0108] (B) Retrieve Index Mapping (Quick Search by Category / Business):
[0109] Create an index:
[0110] Rule category identifiers are mapped to a set of rule IDs under that category: rule_class_id → {list of rule_ids};
[0111] Drawing type identifiers are mapped to the set of rule IDs associated with that type: drawing_type → {rule_id list};
[0112] Rule group / subgroup identifiers are mapped to the set of rule IDs within that group: group / subgrp → {list of rule_id};
[0113] Table 1. Examples of mapping in the power sector
[0114]
[0115] Referring to Table 1, the unique key mapping is: ("Low-voltage incoming circuit breaker…", "AC-01", "v2025.01") →R001;
[0116] Search mapping:
[0117] AC-01→{R001};
[0118] Low-voltage power distribution system diagram → {R001};
[0119] Secondary loop diagram → {R015}.
[0120] Based on the rule category identifier in the rules, a mapping relationship combining rule name, rule category identifier, and version identifier is established for subsequent retrieval by rule category and tracing by version. This mapping relationship can be persistently stored to form a traceable mapping.
[0121] Step 104: Save the rule using the rule name + rule category identifier + version identifier as a unique key to prevent duplicate entries. If any step fails, rollback will be performed to ensure consistency.
[0122] A unique key consisting of the qualified rule, rule category identifier, rule name, and version identifier is written into the rule storage unit. In a preferred approach, the write operation is encapsulated in a database transaction, and the entire operation is rolled back if any write fails, thus avoiding data inconsistency caused by partial success.
[0123] Step 105: Qualified rules are filtered to enter the valid rule pool.
[0124] Whether a rule enters the valid rule pool is determined based on the activation flag, rule status, and group / subgroup range, using an indicator function:
[0125] ;
[0126] In the formula, For a single rule; Indicates activation; Indicates the rule status; For the subgroup to which the rule belongs; This refers to the current set of subgroups being deployed. This is an indicator function; it takes the value 1 if the condition is true, and 0 otherwise.
[0127] Specifically, the value is 1 if all of the following conditions are met, and 0 otherwise:
[0128] 1. The current state status_code(r) of the identification rule r ∈ {GRAY, ACTIVE} (grayscale state GRAY and full state ACTIVE are allowed to enter the candidate);
[0129] 2. The current time now ∈ [effective_from, effective_to] (if no expiration date is configured, it is considered long-term), effective_from represents the start time when the rule takes effect, and effective_to represents the end time when the rule takes effect;
[0130] 3. Last time parsing / unit test / conflict detection passed: last_check_pass=1, last_check_pass indicates whether the most recent parsing, unit test or conflict detection passed;
[0131] 4. Not rolled back / frozen: rollback_flag=0, rollback_flag indicates whether the rule has been rolled back or frozen.
[0132] Only when the enable flag is 'Yes' and the rule status is 'Valid', that is, only when then, the rule can enter the valid rule pool.
[0133] Use the hash bucket algorithm:
[0134] ;
[0135] In the above formula, is the drawing file identifier, represents the bucket number obtained through hash calculation; represents the project identifier. Using the hash bucket algorithm, the combination of the drawing file identifier or the project identifier and the file identifier is subjected to hash calculation, and then modulo 100 is taken to obtain a bucket number between 0 and 99.
[0136] If bucket < rollout_percent, where rollout_percent represents the percentage of gray-scale rollout, then this drawing enters the rollout set g, otherwise it does not enter, so as to implement the configuration of the rule status to achieve a progressive gray-scale rollout of 5% → 25% → 100%; when a rollback trigger event occurs (see step 603), the rule status is rolled back to the nearest stable set. All write operations to the repository follow the idempotent unique key and transaction encapsulation strategy, and the whole is rolled back if any step fails.
[0137] Step 106: After warehousing, write back the "parsed / effective" status and record the timestamp and operator.
[0138] Write the status, timestamp and operator information for the parsed and effective rules; record the exception context for the failure records for easy auditing and review. Thus, the rule setting is completed. Audit fields such as each rule record are ensured to be traceable and verifiable.
[0139] Step 20: Retain the candidate area by preprocessing the power engineering drawing file, generate structured cells through line segment classification and merging and table detection, extract and clean the text, and then assign it to the corresponding cell.
[0140] As an example, this step specifically includes:
[0141] Step 201: Read the power engineering drawing file and perform preprocessing to retain the graphic content within the candidate area.
[0142] Read the power engineering drawing file from the storage location. The power engineering drawing file may come from different sources and have various formats. After reading, in order to ensure the consistency and accuracy of subsequent processing, perform preprocessing operations on the power engineering drawing file.
[0143] Specifically, the coordinate system of the drawings is unified, transforming graphic elements from different coordinate systems to the same standard coordinate system; at the same time, units are standardized to eliminate errors that may be caused by inconsistent units. Next, a pre-defined layer strategy is loaded, which filters out non-printable layers and layers irrelevant to the current processing task, reducing unnecessary data interference.
[0144] The power engineering drawings also need to be trimmed to retain only the graphic content within the area of interest, and the graphic accuracy needs to be normalized to bring drawings of different accuracy to a unified standard, thus preparing for subsequent line segment processing.
[0145] Step 202: Calculate the line segment angle at each of the two endpoints of each line segment in the preprocessed power engineering drawing file; classify and merge the line segments based on the line segment angle, preset angle tolerance, preset alignment tolerance and maximum gap, and remove line segments with a length less than the minimum length threshold.
[0146] For each line segment's two endpoints , Calculate the angle of the line segment :
[0147] ;
[0148] Judgment rules are set based on the calculated line segment angle and the preset angle tolerance:
[0149] ;
[0150] In the above formula, This refers to the angle tolerance. When the angle difference between two line segments is within the angle tolerance range, they are considered to be consistent in the angular direction.
[0151] Based on this, according to alignment tolerance With maximum gap Further determine whether the line segments are collinear. If the preset conditions are met, the collinear segments are merged to simplify the graphic structure. The preset conditions include that the projection alignment deviation of the two line segments is less than the preset alignment tolerance threshold and the maximum gap between the nearest endpoints is less than the preset maximum gap threshold.
[0152] Meanwhile, to avoid noise interference, line segments shorter than the minimum length threshold are ignored. Line segments running in the same direction and aligned are merged to reconstruct a robust mesh structure. These operations effectively organize the line segment information in the drawing, improving the quality and usability of the graphic data.
[0153] The angle tolerance for this step is... The alignment tolerance is 0.5mm–0.8mm, the maximum merging gap is 1.0mm–1.5mm, and the minimum segment threshold is 1.5mm–2.5mm. Specifically, the segment angle of line segment AB... If two line segments A1B1 and A2B2 satisfy... , And its projection alignment deviation ≤[0.5,0.8]mm, maximum gap at the nearest endpoint If the length is ≤[1.0,1.5]mm, it is considered collinear and can be merged; short segments with a length less than [1.5,2.5]mm are considered noise and ignored or downweighted. This threshold can be linearly scaled according to the map scale.
[0154] Step 203: Calculate the proportion of salient lines in the candidate region and compare it with the proportion threshold. At the same time, determine the table by detecting whether the number of cells reaches the minimum cell threshold, and then generate cells.
[0155] For each candidate region in the power engineering drawing file, calculate the total length of the salient lines that make up the table boundary. Salient lines are those line segments that are relatively long, have a relatively regular direction, and are visually prominent; these line segments are more likely to form the table boundary. At the same time, calculate the total length of all line segments within the candidate region.
[0156] The proportion of salient lines is obtained by calculating the ratio of the total length of salient lines to the total length of line segments in the candidate region. This proportion is then compared to a pre-set threshold. If the proportion is greater than or equal to the threshold, it indicates that the candidate region is highly likely to contain a table.
[0157] ;
[0158] In the above formula, The total length of the significant lines that make up the table boundaries, The total length of the candidate region line segments; The number of cells detected. The minimum cell threshold; The percentage threshold is an empirical value used to measure the likelihood that a line segment within a region will form the boundary of a table.
[0159] The system detects the number of cells within a candidate region and compares this number with a pre-set minimum cell threshold. This minimum cell threshold is used to exclude cases where significant lines make up a large proportion of the data, but the data doesn't actually constitute a valid table; for example, it might just be a combination of random line segments. Only when the number of detected cells is greater than or equal to the minimum cell threshold is the candidate region ultimately confirmed as a table region.
[0160] Once the table area is identified, specific cells are generated based on the table's boundaries and the distribution of line segments within it.
[0161] In this step, the percentage of saliency lines in the table is 0.60–0.70, the minimum number of cells is ≥6, and the intersection tolerance is 0.3mm–0.5mm. Specifically, the percentage of saliency lines in the candidate rectangular area... Must meet , ∈[0.60,0.70], and the number of detected cells. , Intersection point positioning uses tolerance. The line width and line type are ∈[0.3,0.5]mm, and normalization is performed to stabilize the line when the line width and line type are inconsistent. Count the intersections.
[0162] Step 204: Extract text from the preprocessed power engineering drawing file, perform a cleaning operation to obtain a set of clean text and the coordinates of the insertion point of the clean text in the power engineering drawing file. The cleaning operation includes removing control characters and processing abnormal codes.
[0163] A comprehensive text scan is performed on the table area (or the pre-processed power engineering drawing file). Text in the pre-processed power engineering drawing file may exist in various forms, such as explanatory text next to graphics, cell text within tables, etc. The extraction process requires locating each text object and separating it from the graphic data of the pre-processed power engineering drawing file. This process utilizes Optical Character Recognition (OCR) technology (if the drawing is in image format) or leverages the text storage structure of the drawing file itself (such as text layer information in CAD files) to obtain the original text content.
[0164] A cleaning operation is performed, which includes removing control characters and handling abnormal codes. Control characters may be mixed into electrical engineering drawings during generation, transmission, or editing. Control characters are special characters used to control equipment operation or data transmission; they do not carry actual textual semantic information. For example, some early drawing file formats may contain control characters used for line breaks, tables, and other control functions. If these control characters are retained in the text, they will interfere with subsequent text processing and analysis, so they need to be completely removed from the extracted text. Because drawings may come from different software systems or have undergone multiple conversions, the text encoding format may be abnormal. Different software may use different character encoding standards; when the encodings are inconsistent, garbled characters or incorrect display will occur. For example, some special characters may be incorrectly represented under different encodings. The system will detect the encoding in the text and convert abnormal codes into a unified, recognizable encoding format to ensure that the text can be displayed correctly and processed further.
[0165] After the above extraction and cleaning operations, a clean text collection is obtained. This includes all valid text extracted and cleaned from the preprocessed power engineering drawing files. Furthermore, to accurately restore the text to its corresponding position on the drawing in subsequent operations, or to perform further layout analysis, the insertion point coordinates of each text element in the preprocessed power engineering drawing file are recorded. The insertion point coordinates are based on the drawing's coordinate system to locate the text's position on the drawing plane. Coordinate representation.
[0166] Step 205: Assign text to the corresponding cell by minimizing the distance from the text point to the cell center.
[0167] After completing the text extraction and cleaning of the power engineering drawings and obtaining the text set and its insertion point, the next step is to enter the row and column serialization and text attribution stage, which aims to accurately assign the text to the corresponding row and column cells of the table.
[0168] For all extracted text, calculate the median height; use the calculated median height as the reference. Based on this, a row clustering threshold is given; when the vertical distance between two texts is less than the row clustering threshold, they are determined to be in the same row.
[0169] The median character height reflects the approximate size of the text in the vertical direction. By statistically sorting a large number of text character heights, the height of the character at the middle position is taken as the median character height.
[0170] The calculated median character height Based on this, a row clustering threshold is given. :
[0171] ;
[0172] In the above formula, This is the vertical distance tolerance coefficient within a line, used to characterize the allowable deviation in the vertical direction of text within the same line relative to the median character height (medh). Line clustering threshold. Used to determine which text should belong to the same line. Preferably, A value of 0.5–0.6 is used to absorb y-axis jitter caused by font differences, alignment errors, and parsing errors within the same table row, while preventing the accidental merging of adjacent rows of text. When the vertical distance between two texts is less than the row's clustering threshold... When they are in the same row, it is determined that they are in the same row:
[0173] ;
[0174] Calculate the median character width for all texts, and based on the median character width, give a column separation threshold; when the horizontal distance between two texts is greater than the column separation threshold, the two texts are considered to belong to different columns.
[0175] The median character width reflects the horizontal size of the text and is an important reference for determining column separator thresholds. (Based on the median character width...) As a horizontal metric benchmark, the horizontal spacing between adjacent text blocks within the same line is defined as follows: Set text block Located on the left side Located on the right, its outer frame has left and right boundaries respectively. , but .
[0176] when The time is determined as a column separator. Among them, The column separation determination coefficient (dimensionless) represents the column spacing threshold multiple based on character width; preferably, Choose 1.5 to 2.5, or use hookup as a configurable parameter to adapt to different drawing types and layout styles; The method is determined based on the statistical distribution of the horizontal gaps between adjacent text blocks in the same row, so that the gaps within the same column and the gaps between columns can be separated on both sides of the threshold.
[0177] Two texts are considered to belong to different columns if the horizontal distance between them exceeds the column separator threshold. Similarly, the column separator threshold determined based on the median character width can adapt to the actual conditions of different drawings, achieving adaptive column partitioning.
[0178] For each text, iterate through all candidate cell sets, calculate the cost from the text to each candidate cell, and select the candidate cell with the lowest cost as the final cell to which the text belongs. The constructed cost function is:
[0179] ;
[0180] In the above formula, Represents a text object, Representing text The final cell to which it belongs; Represented as a set of candidate cells; Candidate cells; For the joint cost function; For normalized distance, the preferred value is... , For text points (preferably the center point of the text bounding box). The center point of the cell; Represents a cell c The width; This represents the height of cell c; Representing text t The surrounding box, Indicates to According to the expansion ratio The expanded enclosure, For cells The surrounding box; For the intersection, union, and comparison of the two; The weighting coefficients are preferably satisfied. Improved when the table grid lines are clear. To enhance overlap constraints; improve performance when there are many broken or merged cells in the mesh. To enhance distance constraints. Outward expansion ratio. The preferred value is 0.10–0.20.
[0181] Step 206: Write the structured results and their judgment tags into the intermediate data cache. The structured results include tables, cells, text and their relationships.
[0182] The structured results generated in the above steps, such as text-cell binding relationships, table cell content, and geometric fragment attributes, along with rule-matching judgment tags, such as "compliant" and "needs correction," are written to an intermediate data cache. This cache uses key-value storage or a relational database table structure, supporting rapid retrieval for subsequent rule matching, task decomposition, and audit traceability, ensuring data consistency and reproducibility across multiple processing steps.
[0183] Step 30: Filter candidate rules from the valid rule pool, extract audit objects, generate audit points, calculate audit point priorities, and package them into a set of dispatch units that can be executed in parallel.
[0184] As an example, step 30 specifically includes:
[0185] Step 301: Filter the candidate rule set from the valid rule pool by matching the target type and grouping attribute of the rule.
[0186] Based on drawing type T, group G, and subgroup set Retrieve candidate sets from the rule base:
[0187] ;
[0188] in, For the set of candidate rules; and These are the target type and grouping of the rule, respectively.
[0189] Step 302: Extract audit objects from the structured results. The audit objects include table cells, text blocks, geometric fragments, page areas, and page number information.
[0190] The method employs data structure traversal and feature recognition to extract audit objects. For example, for table cells, the boundaries and content of each cell can be identified by traversing the table data structure in the structured results. For text blocks, extraction can be performed based on the text's storage location and format characteristics. For geometric fragments, they can be obtained by analyzing the geometric element information in the graphic data structure. For page areas, extraction is performed by combining the page layout structure and relevant identification information. For page number information, relevant information can be extracted from the document's header, footer, or specific locations.
[0191] Step 303: Generate audit points by considering all audit rules involved in each audit object through restricted Cartesian mapping.
[0192] After the audit targets are extracted, fine-grained audit points are generated to enable a comprehensive and detailed audit of each audit target.
[0193] Restricted Cartesian mapping is a method for associating and mapping audit objects with audit rules. It is based on the concept of the Cartesian product, but in practice, it is filtered and matched according to specific constraints to ensure that the generated audit points are meaningful and actionable. Through restricted Cartesian mapping, all audit rules that each audit object may be involved in can be systematically considered, thereby generating comprehensive and targeted audit points, specifically including:
[0194] Before performing a restricted Cartesian mapping, it is necessary to first determine the suitability of the review object and the review rules. Different types of review objects are subject to different review rules; for example, only geometry rules apply to geometric objects, while text rules apply to text blocks. By determining the suitability, irrelevant rules can be excluded, invalid review points can be reduced, and review efficiency can be improved.
[0195] For the approved review objects and rules, a restricted Cartesian mapping is performed. Specifically, for each review object, it is combined with all applicable review rules to generate a set of review points. :
[0196] ;
[0197] in, For object o With rules r Adaptation determination; This represents the set of all objects pending review. Represents a set of rules;a This indicates a specific review point.
[0198] For example, for a geometric fragment object, if there are three geometric class rules applicable to it, then three audit points will be generated, corresponding to the combination of this geometric fragment and these three rules respectively.
[0199] The dimensions for determining compatibility include, but are not limited to:
[0200] (a) Geometric rules: apply only to geometric objects (line segments, closed boxes, connected components); require the prerequisite of satisfying the "collinearity / alignment / gap" threshold;
[0201] (b) Table-type rules: apply only to cell / header / field column objects; must have a key field or column role (such as "device model" or "terminal number");
[0202] (c) Text-based rules: apply only to text blocks / number strings; require initial screening through pattern or character set constraints;
[0203] (d) Page crossing rules: Only apply to object pairs with page crossing tags / terminal references; a corresponding closing relationship must exist.
[0204] For those that do not meet any of the above dimensions Direct filtering ( This reduces unnecessary calculations. For each qualified pair, an audit point record <file / page / region / object ID, rule I> is generated and entered into the priority scoring and assignment process.
[0205] Example, compat execution example:
[0206] ① Geometric alignment check: The object is a set of line segments L The rule's objective is "border alignment". If the polar angles are the same and both the endpoint spacing and gap are below the threshold (see step 202 threshold), then Otherwise, 0.
[0207] ② Table - Figure One Consistency: The object pair is {table row( row Equipment label box (bbox The rule objective is "list-graphic matching"; when the key field (device number) is equal and the spatial intersection-union ratio is greater than 0... .
[0208] ③ Cross-page reference closure: The object is {terminal} ti Page cross mark mj The rule objective is "reference closure"; when there are paired mappings and coverage reach is high. .
[0209] Step 304: For each audit point Calculate priority score :
[0210] ;
[0211] In the formula, The importance of the rule category is derived from the rule metadata field (rule category identifier, group / subgroup) after the rule semantic parsing, and is normalized to [0,1] after being assigned a value through a preset mapping table; Historical risk weights are derived from the risk fields of the rule metadata or historical batch hit statistics, and are obtained according to a preset mapping / normalization strategy. The scope of impact across pages and tables is calculated based on the number of pages and tables affected in this audit, the number of affected objects, and whether key parts such as main wiring / protection configuration are involved, and mapped to [0,1]. For dependency degree, a dependency graph is constructed based on the data / logical dependencies between audit points, and the dependency is calculated based on in-degree, out-degree, or downstream coverage ratio. These are the priority scoring weights for audit points, used to rank audit points during the assignment and scheduling phases. All are non-negative configurable parameters. To ensure comparability across different projects / batches, it is preferable to normalize the weights during calculation.
[0212] ;
[0213] and with normalized weights Replace the original weight participate Calculation. In the priority assessment of review points for critical drawings such as main wiring and relay protection, relative weights (0.6, 0.7, 0.8, 0.5) can be given, and normalized in the above manner during calculation.
[0214] By page, region, or rule category Grouping and packaging into sets of dispatchable units that can be distributed in parallel. .
[0215] Step 305: Task Queue Registration: Write the dispatch package into the audit task queue, record the audit points, estimated workload and dependency information in the package, and prepare to enter the parallel execution stage.
[0216] Step 40: Based on the set of dispatch units, in the execution environment with maximum concurrency, the task allocation is optimized by using a dynamic model and a greedy algorithm. The task execution is optimized by both quantitative benefits and rule verification. After all tasks are completed, the results are merged and written back.
[0217] This invention employs a strategy combining an Early Complete Time (EFT) greedy algorithm with a lightweight variant of Longest Processing Time First (LPT) in a high-concurrency execution environment to approximately minimize the completion time (makespan). Specifically, it utilizes dispatch units... b Execution time estimate The dispatch units are pre-sorted according to the longest processing time, and then assigned one by one to the thread with the earliest expected completion time according to the earliest completion time rule. During runtime, the queue and expected completion time are updated on a rolling basis after each task ends or times out / rollback.
[0218] Step 401: Initialize the parallelizer and build the thread pool.
[0219] The maximum concurrency of the thread pool is set to m And establish a task queue to carry Tasks pending processing.
[0220] Step 402: Calculate the estimated execution time of the dispatch unit through the dynamic prediction model, and optimize thread allocation by combining the greedy scheduling algorithm to finally achieve an approximate minimization of the total completion time.
[0221] Calculate the assignment unit based on the total number of line segments, text, cells, and rule items in the assignment unit. b Estimated time :
[0222] ;
[0223] In the above formula, This represents the total number of line segments contained in the assignment unit. The total number of texts contained in the dispatch unit. The total number of cells contained in the assignment unit. The total number of rule items contained in the assignment unit; This represents fixed overhead (loading / queuing / IO). , , , and The parameters are obtained by fitting historical operation logs using least squares or robust regression (e.g., Huber), and the optimal parameters are selected through cross-validation (e.g., 10-fold) to avoid model overfitting. To avoid drift, upper and lower bounds are set for the coefficients, and they are re-estimated weekly / monthly.
[0224] Based on the estimated execution time of the dispatch units, the dispatch units are pre-sorted according to their longest processing time, and then allocated one by one to the thread with the earliest estimated completion time according to the earliest completion time rule. A greedy algorithm based on the earliest finish time is then used. Assign m worker threads to approximately minimize the completion time M:
[0225] ;
[0226] In the above formula, Indicates assignment to the first k A subset of dispatch units for each worker thread.
[0227] Specifically, to improve robustness, adjustments were made to the total number of line segments, total number of text elements, total number of cells, and total number of rule items. First, perform dimension normalization or logarithmic transformation before fitting, then restore during the prediction stage; for abnormally large packets, use truncation or unpacking strategies. (Dispatch unit) b The estimated execution time is used for subsequent task priority allocation and load balancing, and the time row residual is compared with the actual dispatch unit after the task is completed to continuously calibrate the coefficient. Let the concurrency be m and the set of dispatch units be B.
[0228] (1) Pre-sorting (LPT variant): based on the execution time estimate of the dispatch unit. Sort by size from largest to smallest; and by priority. The assignment packets are sorted in descending order of average value, and then sorted in ascending order of enqueue time to break up ties, ensuring that high-priority / early submitted tasks are assigned first.
[0229] (2) EFT allocation: Maintain a minimum heap of length m to store the "estimated availability time" of each thread. For each sorted assignment unit b ,pop up Minimum thread k The allocation unit b Assign to the smallest thread k and after Press back into the pile;
[0230] (3) Rolling revaluation: any allocation unit b Record the actual duration after completion or retrying upon failure. And update the thread; if If the residual threshold is exceeded, a flag for coefficient re-estimation is triggered.
[0231] (4) Tail suppression and fairness: For the remaining small number of long packets, a tail parallel strategy is initiated. If resources are idle, the concurrency is temporarily increased. It then rotates the data by page / region to avoid prolonged starvation of any particular page. The time complexity of this scheduling is approximately [missing information]. Under the same resource conditions, compared to round-robin / random allocation, it can significantly reduce makespan and improve resource utilization.
[0232] Step 403: Through a dual mechanism of quantifying parallel benefits and rule verification, the efficiency of parallel task execution and the accuracy of business logic are optimized.
[0233] In the parallel benefit evaluation model, the total serial duration is denoted as... The total parallel execution time is Parallel overhead is Then the speedup ratio S is:
[0234] ;
[0235] If S>1, it means that parallel execution effectively improves efficiency; if S≤1, then the parallel strategy needs to be optimized (such as adjusting the number of threads or splitting long tasks).
[0236] Each dispatch unit b operates its own independent rule-based judgment logic for internal audit points, specifically including: geometric consistency dimension verification, naming and numbering format verification, and table- Figure One Consistency comparison, cross-page reference integrity verification, etc. When rule validation detects anomalies, it generates visual annotation products, such as red highlighted boxes and annotation pop-ups, to intuitively locate the problem. For example, it marks line segments with out-of-tolerance dimensions in CAD drawings, or marks incorrectly formatted numbers in documents. The annotation content includes the problem type, severity, and suggested repair solutions, supporting rapid manual review and correction.
[0237] Step 404: Failure retry and idempotent execution: Retry failed units using an exponential backoff strategy to ensure semantic idempotency of the task.
[0238] To ensure reliable task execution, an exponential backoff retry strategy and idempotent write design are adopted. For failed assignment units, exponential backoff is implemented with a base of 1.5–2.0, such as a 1.5s retry interval for the first attempt, 3s for the second, and 6s for the third, with a maximum backoff interval of 30s. The maximum number of retries is 2–3 to avoid resource exhaustion due to infinite retries. Write operations uniquely identify the write context of an audit result using a composite idempotent key K={task_id, file_id, page_no, rule_id, object_id}, where task_id is the task execution identifier, file_id is the drawing file identifier, page_no is the page number within the file (preferably starting from 1), rule_id is the rule identifier, and object_id is the identifier of the object to be audited within the page (such as a unique number for a text block, table cell, or symbol element). For the same idempotent key... The system employs idempotent verification or conflict update strategies to ensure consistent results when the same operation is executed multiple times, thus avoiding duplicate writes or dirty data. Statistical indicators show that the vast majority of tasks converge within ≤2 retries, and the duplicate write rate and dirty data discovery rate are significantly reduced, verifying the effectiveness of the idempotent mechanism.
[0239] Comprehensive monitoring of retry behavior and write quality, with key metrics including retry percentage (%), average number of retries, P95 / P99 retries, convergence batch distribution, Top-N reasons for failure, duplicate / conflicting write rate, and dirty data detection rate. These key metrics provide real-time feedback on task execution stability and assist in optimizing retry strategies, such as adjusting the backoff base or upper limit. Simultaneously, detailed logs (L=) are recorded for each retry and failed write. ,in For business execution identifier (preferably the aforementioned idempotent key) (hash or project batch serial number). For rule identification, Error codes are used to characterize the category of failure reason. This is a retry round that has already occurred. The backoff wait time (in milliseconds) for this retry. The timestamp is the most recent execution time. The logs are used to calculate metrics such as retry percentage, P95 / P99 retries, Top-N failure reasons, and duplicate / conflicting write rate, and support post-event review and compliance auditing. Preferably, bid = This is used to associate the same idempotent context with a short identifier in the log, where, Represents a hash.
[0240] Step 405: Parallel Segment Merging: After all dispatch packets are completed or the termination conditions are met, they enter the merging node and uniformly enter the result write-back stage.
[0241] Step 50: Perform rule-based judgment and result measurement on the results of task execution to achieve standardized quantitative evaluation of drawing quality.
[0242] As an example, step 50 includes the following sub-steps:
[0243] Step 501: Geometric consistency and dimensional verification. Obtain the geometric consistency check results and record the deviation line segment pairs and their distance values.
[0244] Verify whether the alignment or connection of line segments conforms to geometric rules, including:
[0245] Traverse all line segment pairs in the structured drawing Calculate the shortest distance between the two endpoints. ;
[0246] Preset distance tolerance ,like If the line segment alignment or connection is valid, it is determined that the line segment alignment or connection is valid; otherwise, it is marked as a geometric deviation.
[0247] Generate geometric consistency check results and record the deviation line segment pairs and their distance values.
[0248] Step 502: Naming convention verification, output text compliance markers and non-compliant fragment location information.
[0249] Ensure that the text content conforms to the preset naming rules; use regular expressions or predefined pattern sets to match the text content. If the match is successful, mark it as compliant; if the match fails, mark it as non-compliant and record the range of non-compliant text fragments.
[0250] Step 503: Verify the consistency between the equipment information in the table and the drawings, and output the table. Figure One Consistency results and list of devices with differences.
[0251] Based on the equipment set in the inventory list and the equipment set identified in the drawings, calculate the set difference. :
[0252] ;
[0253] in, For the list of equipment, This represents the set of devices identified in the drawing; △ is the symmetric difference operator.
[0254] Preset threshold ,like Then the decision table Figure One If consistent, then mark as inconsistent; otherwise, mark as inconsistent. Output table. Figure One Consistency results and list of devices with differences.
[0255] Step 504: Assess whether cross-page references in the document are completely closed, and obtain the cross-page reference integrity result.
[0256] Check whether cross-page references in the document are fully closed. Calculate coverage based on the set of cross-page references that should exist in the document and the set of actually closed references:
[0257] ;
[0258] in, For the existing set of cross-page references, C represents the set of references that have been closed in practice; C represents the coverage.
[0259] Preset coverage threshold If 95%, If it passes, it is marked as a missing reference; otherwise, it is marked as a missing reference.
[0260] Step 505: Calculate the problem severity and confidence level based on risk level score, impact scope score, recurrence weight, and difficulty of remediation score.
[0261] ;
[0262] In the formula, The risk level score is preferably obtained from the risk field of the rule metadata or by mapping historical hit severity statistics. It should be noted that in step 505... These are the combination coefficients for the outcome measurement phase, used only for... The four scores are weighted and summed, and then compared with the scores used for assignment and scheduling in step 304. Each rule is independent and configured separately. The importance of rule categories is not considered. Instead of being a component, it is preferred as... One of the mapping factors: for example, obtaining the basic risk score from the risk level / historical hit severity of the rule metadata. Combined with the category importance coefficient Gain correction and normalization are performed to obtain ; To determine the scope of impact, it is preferable to calculate and normalize based on the number of pages spanned, the number of tables spanned, the number of affected objects, and whether key components such as main wiring / relay protection are involved. For recurrence weighting, it is preferable to obtain the weight by logarithmic compression and normalization of the number of occurrences of similar problems in the same project batch or the same file; To determine the difficulty of repair, a score is deducted, with the optimal score determined by a combination of the repair cost level or estimated working time of the rule's metadata, dependency complexity, and rework scope. Weighting coefficients. It is non-negative and preferably satisfies It can be configured according to business line / drawing type or calibrated based on the effects of historical projects.
[0263] Specifically, (1) Risk level classification The risk level is determined by the risk field in the rule file / rule metadata or historical risk weights, and is mapped and assigned values based on the importance of the rule category and historical hit risks. For example, the risk level can be divided into four levels: "low / medium / high / extremely high" and mapped to increasing scores, or historical risk weights can be linearly normalized to a preset score range. .
[0264] (2) Scope of influence Based on the scope of the impact of this violation, the scope of impact includes at least one or more of the following: the number of pages affected across pages, the number of tables affected across tables, the number of affected objects (such as the number of line segments / equipment / circuits / terminals), and whether critical parts (such as main wiring / protection configurations) are affected. The above impact quantities are mapped to score ranges according to a preset normalization strategy to obtain... Among them, cross-page and cross-table effects can be assigned higher base scores.
[0265] (3) Weight of repeated occurrences The number of times the same rule identifier / reason code appears in the same document, batch, or project is determined. When the repetition count is 1, the baseline weight is used. The repetition count increases monotonically with the frequency of occurrence. The repetition count can be compressed using a piecewise function or a logarithmic growth function. This is to avoid extreme repetition that could lead to an imbalance in scores.
[0266] (4) Deduction for repair difficulty The complexity of the rectification action is determined by the rectification suggestion field (action_suggestion) provided by the system or the repair level field in the rule metadata. For example, the repair difficulty can be divided into "easy / medium / difficult" or more levels and mapped to a deduction value. The greater the repair difficulty, the higher the deduction, so as to reflect the governance strategy of "high risk but high repair cost".
[0267] Step 506: For any two bounding boxes, calculate the intersection-union ratio. If the intersection-union ratio is greater than or equal to the threshold, then merge the bounding boxes.
[0268] For any two bounding boxes, calculate the intersection-union ratio (IoU):
[0269] ;
[0270] in, , There are two label boxes; η The threshold value is used.
[0271] Preserve the weighted center position of the merged bounding boxes, update the boundary coordinates, and generate the merged set of annotation boxes.
[0272] Step 507: Monitor the overall progress of the review task With quality :
[0273] ;
[0274] In the formula, Points for which review has been completed. Total audit points; Number of non-compliant items This represents the number of items that have been checked.
[0275] Specifically, the judgment results of each audit point will be recorded in a unified structure, including at least the following fields: task identifier, file / version / page number, rule identifier and category, object location information, problem description, rectification suggestions, basis name and path.
[0276] Identifiers: task_id (unique identifier for the audit task), project_id (project / project identifier), file_id / path (unique identifier or storage path of the audited file), file_ver (file version number / revision number), page_no (page number / page sequence number), area_id (internal partition / slice region identifier);
[0277] Rule class: rule_id (unique rule identifier), rule_class (rule category identifier / category code, used for retrieval and statistics by profession / drawing type / grouping), rule_ (rule body field, used to record the executable constraint expression or its structured representation generated after rule semantic parsing and field validation).
[0278] Object location: object_type (object type, geom represents geometric object, table represents table object, text represents text object, xref represents cross-page reference / cross-reference object), object_id (object identifier / index), bbox / geom (object spatial location information, where bbox is the bounding box coordinates, geom is the geometric shape coordinates / geometric description, both recorded based on a unified page standard coordinate system);
[0279] Judgment result: status∈{PASS,FAIL,WARN,SKIP} (representing pass, fail, warning, and skip respectively), reason_code (reason code dictionary, used to describe the reason category of FAIL / WARN, such as NUM_DUP indicating duplicate number, REF_BREAK indicating broken reference, DELTA_MISMATCH indicating difference mismatch), severity_score (severity score, value 0-100, the larger the value, the more severe the problem), confidence (confidence level, value 0-1, the larger the value, the more reliable the judgment).
[0280] Measurement and Evidence: delta ( , difference / deviation metric, used to quantify the difference between the measured value and the expected value or between two objects), coverage (C, coverage / closure rate and other coverage metrics, used to quantify the degree of matching coverage or cross-page closure), evidence_name (evidence name), evidence_path (evidence path / access identifier, used to locate labeled products or vector attachments for verification).
[0281] Rectification suggestions: action_suggestion (rectification suggestion text), reference_std (based on standard name / clause number), reference_path (based on file path or accessibility identifier);
[0282] Execution information: exec_cost_ms (execution time in milliseconds), worker_id (execution node / work unit identifier), retry_count (number of retries), last_error (last error message / error code);
[0283] Audit: created_at (creation time), updated_at (update time), operator (operator / operator identifier).
[0284] The above fields use a unified schema and are versioned (schema_ver is the schema version number) to support backward compatibility and cross-project statistics.
[0285] The above fields use a unified schema and are versioned (schema_ver) to support backward compatibility and cross-project statistics.
[0286] Standardized results are submitted point-by-point or in batches to ensure atomicity and consistency. The file paths or access identifiers of labeled artifacts are recorded for subsequent location and verification. The idempotent key is L={task_id,file_id,page_no,rule_id,object_id}. Before batch submission, a hash (payload) is calculated for each record to create a change fingerprint. If there are records with the same K but different fingerprints, an optimistic concurrency strategy is implemented: the record with the newer timestamp / version number is overwritten while retaining the difference for auditing. Batch data entry is encapsulated into single transactions by page or dispatch unit. If any record fails, the transaction is rolled back and written to the failure queue, with exponential backoff retries (maximum 2-3 times). Duplicate submissions (with the same K and fingerprint) are ignored. For duplicates with different fingerprints, the "old → new" revision chain (rev_id) is retained for traceability. The evidence_path and visual labeled artifacts are stored on disk and their URIs are written back to ensure verifiable location.
[0287] The system updates indicators such as total task progress, execution status, and pass rate in real time. In one implementation, the system supports progress summarization by page, rule category, and group.
[0288] Step 60: Standardize and store the audit results, visualize them, and trigger a closed-loop governance mechanism.
[0289] As an example, step 60 specifically includes:
[0290] Step 601: Calculate based on the results already entered into the database, including but not limited to: Table - Figure OneMetrics such as consistency of symmetry difference ratio, cross-page reference coverage, problem severity and confidence, pass rate, average processing latency, and parallel speedup ratio.
[0291] Difference , For the list of equipment, The set of devices identified in the image;
[0292] Coverage , To close the set of references, For a measured closed set;
[0293] Pass rate ;
[0294] Parallel speedup Page-level throughput .
[0295] The indicators are aggregated in batches according to the natural processing window of a single gray-scale release, forming a time series for threshold comparison.
[0296] Step 602: Statistical indicator storage and display: The indicators are summarized and stored by project / page / rule category and other dimensions for use in visual dashboards and reports; time series comparison and outlier detection are supported.
[0297] Step 603: Threshold Comparison and Strategy Decision: Let the pass rates of the current batch and the previous batch be respectively... , The coverage is , .
[0298] A rollback is triggered when any of the following conditions are met:
[0299] (1) and That is, a decrease of more than 5% in two consecutive batches;
[0300] (2) ;
[0301] (3) .
[0302] in, To represent the amount of performance degradation, the preferred characterization is the first... Batch grayscale deployment relative to the most recent stable set The processing latency increment; for example, taking For the first P95 processing latency for batch tasks, fetch To stabilize batches The P95 processing latency can then be defined. (or ). The maximum allowable degradation threshold, when A rollback is triggered at that time.
[0303] First, freeze new traffic and then target the subgroups. Revert to the most recent stable set Afterwards, a review list is generated, including the affected rules, pages, and objects, and the rollback reason code is marked. Once the indicators recover, the rollback is re-deployed at 5%-25%-100%. All actions are written into the audit table and bound to the rule version and threshold version.
[0304] Step 604: Rule Iteration and Re-release: Revise the rules based on the measurement results, and quickly iterate and release them according to the path of "acquisition-parsing-mapping-database entry-grayscale activation", forming a closed loop from discovery-location-rectification-review-optimization.
[0305] In summary, this embodiment addresses the multi-style, multi-layer, and multi-precision characteristics of common power industry drawings such as DXF and DWG. This invention introduces multi-tolerance and structural reconstruction strategies at the geometric, tabular, and text levels: It identifies and merges collinear segments using angle tolerance, alignment tolerance, and maximum gap threshold to stably restore borders and table gridlines; it jointly determines table regions using intersection density, significant line proportion, and minimum cell count; and it achieves row and column serialization through text cleaning and a strategy of attributing text points to cell boundaries. The above methods maintain high recognition stability and portability under complex conditions such as noise, rotation, inconsistent line widths, and redundant layers.
[0306] This invention refines review tasks into review points, groups and schedules them using priority scoring, and employs a parallel execution framework for multi-threaded, multi-core concurrent processing. Simultaneously, it estimates execution time based on object size (e.g., line segments, number of text rule items), achieving task allocation close to the earliest completion time. Compared to serial or coarse-grained assignment schemes, this invention offers quantifiable improvements in both average latency and overall throughput, making it particularly suitable for centralized review scenarios involving large batches, multiple pages, and numerous rules.
[0307] This invention establishes a unified result model, which structurally stores the judgment results, problem identification, rectification suggestions, and supporting links for each audit point in a database, and provides a table- Figure OneIndicators such as consistency symmetry difference, cross-page reference coverage, issue severity, and confidence level are used to quantitatively assess audit quality and risk levels. Combined with task progress and statistical analysis, such as pass rate, issue distribution, and rule hit frequency, the rule set and threshold parameters can be continuously optimized, forming a closed-loop governance capability from discovery to location, rectification, review, and optimization. Audit results are stored as multi-dimensional statistical data to evaluate the effectiveness of different rule combinations and parameter configurations; using metrics as objective functions, such as reducing symmetry difference, improving coverage, and increasing pass rate, these metrics guide subsequent rule iterations and adaptive parameter optimization. Unlike experience-based parameter tuning, this invention uses a closed-loop metric system to drive long-term performance evolution, improving reusability and transferability.
[0308] In this invention, large objects such as rules and annotations are uniformly stored in an object storage system, while structured results are persisted in a database. The parsing module and the auditing engine communicate through a loosely coupled interface. System parameters are centrally configured, facilitating migration to multiple environments and on-demand expansion. This decoupled design reduces dependence on specific vendors or technology stacks and provides low-intrusion expansion space for subsequent integration of new drawing formats, rule types, or scheduling strategies. Field integrity and value range checks are set at data entry and exit points, respectively. Key write operations are encapsulated using transactions, with rollback upon exceptions to ensure data consistency. The scope of rule application is limited through grouping, sub-grouping, and role permissions to prevent erroneous activation. Exponential backoff retries and idempotent control are applied to failed tasks during parallel execution to ensure system stability and security during large-scale concurrent writes.
[0309] In a specific embodiment, the parameters are set as follows:
[0310] (1) Geometry and net reconstruction: Angle tolerance is 2°–3°, alignment tolerance is 0.5mm–0.8mm, maximum merging gap is 1.0mm–1.5mm, minimum line segment threshold is 1.5mm–2.5mm; extremely short noise segments are ignored.
[0311] (2) Table recognition and cell generation: The threshold for the proportion of significant lines is 0.60–0.70, the minimum number of cells is not less than 6, and the tolerance for intersection determination is 0.3mm–0.5mm; normalization processing is enabled in scenarios with inconsistent line widths and line types.
[0312] (3) Text cleaning and attribution: Character cleaning is enabled; the row clustering threshold is 0.5–0.6 times the height of the median character, and the column separation threshold is 0.6–0.7 times the width of the median character; the text attribution uses the joint cost of distance and the intersection-union ratio of the outer boundary, and the outer boundary ratio is 0.10–0.20.
[0313] (4) Task Parallelism and Steady-State Control: The recommended concurrency level is 8–32, with 16 being commonly used; the timeout for a single task is 60–180 seconds; the maximum number of retries on failure is 2–3, with exponential backoff, a base of 1.5–2.0, and a maximum backoff of ≤30 seconds; the maximum number of audit points per dispatch package can be set to 2000. During the dispatch and scheduling phase, the priority scoring of audit points adopts the method described in step 304. and weight , For non-negative configurable parameters, preferred relative weights are (0.6, 0.7, 0.8, 0.5) and normalized during calculation. In the results measurement phase, problem severity and confidence (or treatment priority) are calculated using step 505. and weight The It is non-negative and preferably satisfies It can be configured according to business line / drawing type or calibrated based on the effects of historical projects.
[0314] (5) Activation and rollback strategy: The product can only be deployed when the activation flag is "yes", the status is "effective", and it falls into the specified group or subgroup; the gray scale ratio is recommended to be progressively from 5% to 25% to 100%; when the pass rate drops by more than 5% for two consecutive batches or the coverage drops by more than 0.01, automatic rollback will be triggered.
[0315] Model Evaluation:
[0316] We selected drawing samples from different engineering projects, de-identified them, and constructed a self-built engineering drawing dataset, covering various types of drawings including primary main wiring, secondary circuits, grounding and lightning protection, panel layout, equipment lists, and terminal tables. We also performed stratified sampling and manual annotation of table cells and text blocks for quality verification of structured parsing and attribution determination. Under recommended parameters, the accuracy and recall of table region recognition were approximately 0.964 and 0.961, respectively, with F1 ≈ 0.962; the cell generation accuracy was approximately 0.953; and the text attribution accuracy was approximately 0.948. Fluctuations did not exceed 2 percentage points even under conditions of slight rotation, inconsistent line widths, and a small amount of noise. Compared to the baseline of traditional fixed scripts and manual review, table- Figure One Consistency indicators decreased by an average of approximately 65%–70%; cross-page reference coverage improved to approximately 0.95; and the manual rework rate for numbered issues decreased significantly.
[0317] Under 16-way concurrency and general computing resource conditions, page-level processing throughput increased from approximately 2.6 pages / second to approximately 6.9 pages / second; the failure retry rate was approximately 1.6%, and all converged within no more than 2 retries, with no duplicate entries or dirty data found.
[0318] The results above demonstrate that this method maintains stable structured quality and consistent judgment even under varying output styles and noise levels. Furthermore, through fine-grained task decomposition and parallel scheduling, it enables rapid rule deployment and rollback without interrupting business operations, significantly reducing average processing latency and improving overall throughput for batch processing. This meets the dual requirements of efficiency and consistency in centralized review scenarios. The above evaluations and parameters are preferred embodiments used to illustrate the method's effectiveness and are not intended to limit the scope of protection. Specific thresholds and weights can be adjusted and optimized based on project characteristics.
[0319] Application Example: Automatic Decomposition and Parallel Execution of Multi-Objective Review Tasks for Power Drawings:
[0320] This technology was successfully applied in the design drawing review project for the 35kV outgoing line bay of a 220kV substation, enabling intelligent review of low-voltage power distribution system drawings. The project focused on addressing multi-dimensional review needs, including equipment selection matching, protection configuration rationality, and parameter setting standardization. Through a dynamic rule engine and multi-objective automatic decomposition technology for review tasks, it significantly improved review efficiency and quality.
[0321] The system first retrieves the standard document "General Technical Guidelines for Distribution Networks" (Source: National Standard GB / T 45418-2025) from the national rule database. Using the semantic parsing algorithm of this invention, it converts the natural language rules into a structured intermediate representation. Taking the rule of matching the breaking capacity of low-voltage incoming circuit breakers with transformer capacity as an example, the system parses it into a structured result containing rule ID, name, type, priority, conditions, calculation formula, and reference standards. During the rule governance process, the system automatically detects logical conflicts and parameter contradictions between rules. Using the gray-scale release mechanism of this invention, it first verifies 5% of the drawings. After verification, the rules officially take effect and are included in the review rule database, ensuring the security and stability of rule changes. After receiving the low-voltage distribution system drawings in DWG format, the system applies the geometric reconstruction algorithm of this invention to extract geometric elements such as lines and symbols. The algorithm parameters are carefully optimized, setting an angle tolerance of 2.5°, an alignment tolerance of 0.6mm, and a maximum merging gap of 1.2mm to ensure the accuracy and completeness of geometric element extraction. Meanwhile, the system automatically identified the equipment parameter tables in the drawings and accurately extracted key technical parameters such as the short-circuit breaking capacity of incoming line cabinet AA-1 (50kA), the compensation capacity of compensation cabinet AA-2 (180kVar), and the rated capacity of transformer T1 (630kVA). These structured results provided an important foundation for subsequent auditing tasks.
[0322] Based on the extracted structured results, the system selects 28 applicable rules from the rule base according to the drawing type and content, and automatically determines the suitability of each rule with the drawing content, ultimately generating 15 valid review points. To optimize review efficiency, the system uses the multi-factor scoring algorithm of this invention to calculate the priority of each review point, with the formula: Priority = 0.6 × Category Importance + 0.7 × Historical Risk + 0.8 × Scope of Impact + 0.5 × Dependency. According to the priority scoring results, the system packages the review tasks into three priority task packages: a high-priority equipment selection matching task package containing 5 review points, a medium-priority protection configuration rationality task package containing 7 review points, and a low-priority parameter setting standardization task package containing 3 review points. The system uses the LPT+EFT hybrid scheduling algorithm of this invention to intelligently schedule the review tasks. This algorithm combines the advantages of LPT (Longest Processing Time First) and EFT (Earliest Completion Time), first sorting by task complexity and then optimizing the task allocation strategy. The system is configured with a maximum concurrency of 16 and a single task timeout of 120 seconds to ensure efficient resource utilization and timely task completion. During distributed parallel execution, the system distributes audit tasks to multiple execution nodes for simultaneous processing, employs an exponential backoff retry strategy for failed tasks, and monitors task execution progress and resource utilization in real time.
[0323] Actual audit case analysis
[0324] Case 1: Selection and Matching Audit of Incoming Line Cabinet Equipment
[0325] In the selection and matching review of incoming line cabinet equipment, the system applies the matching rule (R001) between the low-voltage incoming circuit breaker capacity and the transformer capacity. First, the transformer capacity parameter S=630kVA is extracted from the drawings. Then, the breaking capacity of the AA-1 circuit breaker in the incoming line cabinet is extracted as 50kA. According to the rule, the minimum required breaking capacity is calculated to be 35kA. The system automatically determines that 50kA ≥ 35kA, meeting the rule requirement, and the review result is compliant.
[0326] During the review process, the system not only automatically extracted and calculated parameters but also generated detailed review criteria and thought process records. The review criteria clearly stated that "the capacity of the low-voltage incoming circuit breaker should match the transformer capacity," and the thought process detailed the complete process of parameter extraction, calculation analysis, and judgment logic. The entire review process took only 8.5 seconds, demonstrating the system's efficiency and accuracy.
[0327] Case 2: Review of the Reasonableness of Compensation Cabinet Capacity Configuration
[0328] The rationality review of the compensation cabinet capacity configuration is based on the matching rule (R008) between the total reactive power compensation capacity and the transformer capacity. The system extracts the compensation capacity of AA-2 as 180kVar, and calculates the compensation capacity ratio as 180÷630=28.57%. Verification confirms that this ratio is within the standard requirement of 20%-40%.
[0329] During the audit process, the system automatically identified the equipment type and technical parameters of the compensation cabinet, accurately calculated the capacity configuration ratio, and compared it with the standard requirements for verification. The audit basis was clearly stated as "the total reactive power compensation capacity should match the transformer capacity (20%-40%)", and the thought process was meticulously recorded, documenting the complete audit chain from parameter extraction to ratio calculation and standard verification. The audit result was compliant, with a processing time of only 6.2 seconds, demonstrating the system's rapid response capability when handling complex calculation tasks.
[0330] Case 3: Review of the rationality of current transformer selection
[0331] The review of the rationality of current transformer selection applies the protection current transformer ratio selection rule (R015). The system first calculates the circuit rated current as 260A, and calculates the required CT ratio as 260 × 1.3 = 338A according to the protection requirements. Then, the actual CT ratio is extracted as 400 / 5. The system intelligently verifies whether 400A is the closest to the standard specification of 338A, and finally determines that the selection is reasonable, and the review result is compliant.
[0332] During the review process, the system demonstrated strong capabilities in applying technical specifications. The review was based on the principle that "the selection of the current transformer ratio for protection should be reasonable," and the system meticulously documented the professional technical judgment process, including rated current calculation, ratio requirement analysis, and standard specification matching. The system not only completed basic parameter verification but also demonstrated a deep understanding and professional application of power engineering design specifications. The entire processing time was 11.8 seconds, showcasing the system's professionalism in applying technical specifications.
[0333] Through the application of this invention, the project achieved significant performance improvements. Review efficiency was drastically reduced from 4 hours for traditional manual review to 28 minutes for automated review, an efficiency increase of 857%. Review coverage increased from 85% for manual review to 96.5% for automated review, and review accuracy increased from 92% to 94.8%. In terms of quality and efficiency, the system improved the problem detection rate by 60% compared to manual review, identifying 3 potential problems missed by manual review. By providing precise problem localization and rectification suggestions, the first-time rectification pass rate increased from 75% to 91%. The system implemented a standardized review process, eliminating human error, while automatically recording review experience and continuously enriching the rule base and case library.
[0334] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A dynamic rule engine and multi-objective review task decomposition method for power drawings, characterized in that, Includes the following steps: Step 10: Obtain the power rule file, parse and verify it to generate qualified rules, and filter the qualified rules to obtain a pool of valid rules, including: Whether a rule enters the valid rule pool is determined based on the activation flag, rule status, and group / subgroup range, using an indicator function: ; In the formula, For a single rule; Indicates activation; Indicates the rule status; For the subgroup to which the rule belongs; This refers to the current set of subgroups being deployed. This is an indicator function; it takes the value 1 if the condition is true, and 0 otherwise. Only when the enable flag is yes and the rule status is valid, i.e., only when At that time, the rules Only then can it enter the valid rule pool; Step 20: By preprocessing the power engineering drawings, candidate areas are retained, and structured cells are generated through line segment classification and merging and table detection. After extracting and cleaning the text, it is assigned to the corresponding cells to form a structured result. Step 30: Filter candidate rules from the effective rule pool, extract audit objects from the structured results, generate audit points, calculate the priority of audit points, and package them into a set of dispatch units that can be executed in parallel; Step 40: Based on the set of dispatch units, in the execution environment with maximum concurrency, a dynamic model and a greedy algorithm are used to optimize task allocation, and task execution is optimized by both quantitative benefits and rule verification; wherein, the dynamic model includes calculating the estimated execution time of the dispatch unit based on the total number of line segments, total number of text, total number of cells and total number of rule items in the dispatch unit. Step 50: Determine the results of the task execution based on rules and measure the results.
2. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 1, characterized in that, Step 10 includes: Obtain the power rule file, extract the rule metadata, and register it as a rule index list. The rule index list is a structured index table used to locate and trace the rule file itself. Read the rule file body one by one according to the rule index list, perform rule semantic parsing on the file content, convert it into a unified structured rule object, and perform field validation. Those that pass the validation are recorded as qualified rules. Based on the rule category identifier in the qualified rules, establish a mapping relationship combining rule name, rule category identifier, and version identifier, and save it with rule name + rule category identifier + version identifier as the unique key; Qualified rules are filtered for effectiveness and added to the valid rule pool; parsed and effective rules are written with status, timestamp, and operator information.
3. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 1, characterized in that, Step 20 includes: Read the power engineering drawing files and preprocess them, retaining the graphic content within the candidate areas; Based on each line segment in the preprocessed power engineering drawing file, calculate the line segment angle at its two endpoints; based on the line segment angle, preset angle tolerance, preset alignment tolerance, and maximum gap, classify and merge collinear lines, and remove line segments with a length less than the minimum length threshold. The proportion of significant lines in the candidate region is calculated. The table is determined by comparing the proportion of significant lines in the candidate region with the proportion threshold, and by checking whether the number of cells reaches the minimum cell threshold. Then, cells are generated. Text is extracted from the preprocessed power engineering drawing file, and a cleaning operation is performed to obtain a set of clean text and the coordinates of the insertion point of the clean text in the power engineering drawing file. By minimizing the distance from the text point to the cell center, the text is assigned to the corresponding cell; The structured results and their decision tags are written into an intermediate data cache. The structured results include tables, cells, text, and their relationships.
4. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 3, characterized in that, Based on the line segment angle and preset angle tolerance, preset alignment tolerance, and maximum gap, line segment classification and collinear merging are performed, including: If the angle difference between two line segments is within the preset angle tolerance range, the projection alignment deviation of the two line segments is less than the preset alignment tolerance threshold, and the maximum gap between the nearest endpoints is less than the preset maximum gap threshold, then the collinear segments will be merged.
5. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 3, characterized in that, The percentage of salient lines in candidate regions is calculated by comparing this percentage with a threshold, and the table is determined by checking if the number of cells reaches a minimum cell threshold. Cells are then generated, including: For each candidate region in the power engineering drawing file, calculate the total length of the significant lines that make up the table boundary; calculate the total length of all line segments within the candidate region. The proportion of significant lines is obtained by calculating the ratio of the total length of significant lines to the total length of line segments in the candidate region. The proportion of significant lines is then compared with a pre-set proportion threshold. If the proportion of significant lines is greater than or equal to the proportion threshold, it indicates that the candidate region is preliminarily determined to have a table. The number of cells in the candidate area is detected and compared with a pre-set minimum cell threshold. When the number of detected cells is greater than or equal to the minimum cell threshold, the candidate area is finally confirmed as a table area. Generate specific cells based on the table's boundaries and the distribution of line segments within it.
6. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 3, characterized in that, By minimizing the distance from the text point to the cell center, text is assigned to the corresponding cell, including: For all extracted text, calculate the median character height; based on the calculated median character height, give the row clustering threshold; when the vertical distance between two texts is less than the row clustering threshold, they are determined to be in the same row; Calculate the median character width for all texts, and based on the median character width, give a column separation threshold; when the horizontal distance between two texts is greater than the column separation threshold, the two texts are considered to belong to different columns; For each text, iterate through all candidate cell sets, calculate the cost from the text to each candidate cell, and select the candidate cell with the lowest cost as the final cell to which the text belongs.
7. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 1, characterized in that, Step 30 includes: The candidate rule set is filtered from the effective rule pool based on the target type and grouping attribute of the rule. Extract audit objects from the structured results; generate audit points by considering all audit rules involved in each audit object through restricted Cartesian mapping; Based on the importance of rule categories, historical risk weights, cross-page and cross-table impact scope, and dependency, a priority score is calculated for each audit point, and the scores are packaged into a set of dispatch units that can be executed in parallel.
8. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 1, characterized in that, Step 40 includes: Initialize the parallelizer and build a thread pool; calculate the estimated execution time of the dispatch unit, and optimize thread allocation using a greedy algorithm to achieve an approximate minimization of the total completion time; By using a dual mechanism of quantifying parallel benefits and rule verification, the efficiency of parallel task execution and the accuracy of business logic are optimized. All dispatch packages are merged and the results are written back after completion or termination conditions are met. Wherein, the quantized parallel benefit is: denoted as the total serial duration as... The total parallel execution time is Parallel overhead is Then the speedup ratio S is: ; If S>1, it means that parallel execution effectively improves efficiency; if S≤1, then the parallel strategy is optimized. The rule verification includes each dispatch unit independently determining the rules for its internal audit points.
9. The dynamic rule engine and multi-objective review task decomposition method for power drawings according to claim 1, characterized in that, Step 50 includes: geometric consistency and dimensional verification, naming convention verification, consistency assessment of equipment information in tables and drawings, assessment of whether cross-page references in documents are completely closed, measurement of problem severity and confidence, measurement of annotation box merging, and measurement of progress and pass rate.
Citation Information
Patent Citations
Ai large model reasoning method based on knowledge graph enhancement
CN120450043A
Report verification batch parallel execution optimization method based on pluggable rule engine framework
CN120492451A