Power format document generation method and system based on structured alignment and medium

By using a structured alignment method for generating power system documents, the problem of aligning tabular data with document content has been solved, enabling efficient and reliable document generation and verification, and meeting the State Grid's requirements for digital and standardized data management.

CN121581005APending Publication Date: 2026-02-27QINHUANGDAO POWER SUPPLY COMPANY OF STATE GRID JIBEI ELECTRIC POWER COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511748616.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In the engineering construction, material management and completion archiving of power companies, existing technologies are unable to accurately align tabular data with document content, resulting in low efficiency and high error rates in the generation process, which cannot meet the State Grid's needs for digital archiving and standardized management of data.

Method used

A structured alignment-based method for generating power standard documents is adopted. Through a closed-loop process of structured parsing and standardization, semantic alignment and constrained generation, template filling and export verification, the method achieves accurate matching and consistency verification between tabular data and document content, including field normalization, unit conversion, semantic consistency assessment and regeneration operations.

Benefits of technology

It improves the accuracy of field alignment and the consistency of generated content, reduces the cost of manual review and template maintenance, supports full-process tracking and result traceability, and enhances the automation and reliability of the system in scenarios such as engineering construction, material management, and completion archiving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121581005A_ABST
    Figure CN121581005A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power format document generation method and system based on structured alignment and a medium, and belongs to the technical field of electric power informatization and artificial intelligence document processing. S2, performing semantic alignment and constrained generation; and S3, template filling and export re-checking. The system comprises a structured analysis and standardization module, a semantic alignment and constrained generation module, a template filling and export rechecking module, a knowledge and rule base module, a control and parameter management module and a hardware processing module. By adopting the method, the system and the medium, the problems that table data and format documents are difficult to align, the generation efficiency is low and verification depends on manual work in national power grid business are solved, document automatic generation and tracing are achieved through data standardization, semantic alignment and threshold regeneration and template filling verification, the efficiency and consistency are improved, and the verification efficiency is improved. The method meets the digitization requirements of state grid data, and is suitable for material management, engineering filing and other scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power information technology and artificial intelligence document processing technology, and in particular to a method, system and medium for generating power standard documents based on structured alignment. Background Technology

[0002] In the engineering construction, materials management, and completion archiving of power companies, a large number of material inventory forms need to be manually verified and generated by comparing them with standardized Word documents. Due to inconsistent field naming, significant format differences, and weak semantic relationships between various business systems, the existing template replacement method is difficult to achieve an accurate correspondence between table data and document content, often resulting in inconsistencies in information, field mismatches, and a large workload for manual verification.

[0003] As the State Grid Corporation of China transforms into a "digital power grid," the demand for automated business processes and standardized data assets is becoming increasingly urgent. Existing technologies lack "structured semantic alignment" capabilities (unable to solve the problem of accurate matching between fields and document slots) and "built-in verification and correction" mechanisms (unable to replace manual verification), resulting in low efficiency, high error rates, and heavy reliance on manual labor in the standardized document generation process. This makes it difficult to meet the strategic requirements of the State Grid Corporation of China for digital archiving and standardized management of data. Therefore, there is an urgent need for an intelligent document generation solution that can achieve automatic data alignment, accurate content generation, and reliable result verification. Summary of the Invention

[0004] The purpose of this invention is to provide a method, system, and medium for generating power standard documents based on structured alignment, to solve technical problems in State Grid engineering construction, material management, and completion archiving, such as the difficulty in accurately aligning material inventory table data with standard Word document content at the semantic level, insufficient automatic generation capabilities, and reliance on manual consistency verification.

[0005] To achieve the above objectives, this invention provides a method for generating power system documents based on structured alignment, comprising the following steps: Step S1, Structured Parsing and Standardization: Receive raw tabular data from the material inventory or business database of the power industry, parse the raw tabular data, normalize the fields, convert units and scale the data to generate standardized structured data. Step S2, Semantic Alignment and Constrained Generation: Based on the preset slot template, the standardized structured data is aligned with the slots in the template through similarity calculation to generate candidate text for each slot; and the semantic consistency and numerical accuracy of the candidate text are evaluated. If the evaluation result does not meet the preset semantic consistency threshold, a constrained regeneration operation is performed until the threshold requirement is met or the iteration limit is reached. Step S3, Template Filling and Export Verification: Fill the slot text that meets the threshold requirements in Step S2 into the power system document template, perform format rendering and global consistency verification; if the verification passes, export the final power system document; if the verification fails, go back to Step S2 for targeted correction.

[0006] Preferably, step S1 specifically includes: Step S11: Parse each record in the original table data into a triplet in the form of field-value-unit; Step S12: Based on the preset power industry vocabulary, rule base and lightweight classifier, perform synonym merging on the fields in the triplet to unify the scope and obtain a standard field set. Synonym merging and scope unification are achieved through a mapping function. Fields that cannot be mapped or have unit anomalies are entered into an anomaly queue for manual or offline rule processing and then returned. Step S13: Based on the target unified unit in the power standard document, perform unit conversion on the fields in the triplet and record the conversion trajectory. The unit conversion includes at least one of the following: scale factor, offset, temperature scale or ratio rule, and record the original unit, target unit and conversion parameters. Step S14: Scale the unit conversion results according to the preset normalization function, and set up zero-deletion micro-terms to enhance the robustness of outliers, and finally generate standardized structured data and corresponding metadata.

[0007] Preferably, step S2 specifically includes: Step S21: Encode the standardized structured data using a field encoder and encode the preset slot template using a slot encoder to generate field vectors and slot vectors respectively. The slot template contains multiple slots, and each slot is associated with at least a template prompt fragment, target unit, and precision rule. Step S22: Calculate the alignment weight from field to slot based on similarity, and perform weighted aggregation on the field vector based on the alignment weight to obtain the slot semantic summary for each slot. Step S23: Using template hint fragments and slot semantic summaries as conditions, drive the generative language model to generate slot text for the corresponding slots; Step S24: Based on the target unit and precision rules associated with slots, write back the unit and precision of key values ​​in the slot text; Step S25: Select the field with the highest semantic relevance to the current slot from the standardized structured data, and construct an evidence string based on the triple information of the field with the highest relevance. Step S26: Jointly evaluate the semantic consistency and numerical deviation of the generated text and the evidence string to obtain a comprehensive consistency score; the semantic consistency score is generated by a dual-tower or cross-encoder, and the numerical deviation is the relative error or the interval deviation within the template's allowable tolerance. The two are fused according to configurable weights. Step S27: For evaluation results that do not meet the preset semantic consistency threshold, perform a constrained regeneration operation until the semantic consistency threshold is met or the iteration limit is reached. If the semantic consistency threshold is still not met after reaching the iteration limit, select the candidate text with the highest comprehensive consistency score as the final output. The iteration limit is a configurable parameter with a range of 3-10 times and a system default of 5 times. The semantic consistency threshold is also a configurable parameter with a range of 0.7-0.95 and a system default of 0.85.

[0008] Preferably, in the constrained regeneration process of step S27, allowed or prohibited words are determined by the template specification and the business terminology library; unit and decimal place locking is performed according to the template slot precision rules; key values ​​are preferentially copied directly from the structured data and concatenated with the surrounding grammatical templates of the text.

[0009] Preferably, step S3 specifically includes: Step S31: Fill the slot text that meets the semantic consistency threshold requirement in step S2 back into the corresponding placeholder in the power system document template; Step S32: Based on the conversion trajectory recorded in step S13 and the preset precision rules in the template, perform rendering processing on the key values ​​in the backfill text to adjust the units and decimal places. Step S33: Calculate the consistency between slot coverage and the full-text average; Step S34: Compare the slot coverage with the preset coverage threshold, and compare the full-text average consistency with the preset semantic consistency threshold; if both meet the criteria, execute document export; if either does not meet the criteria, go back to step S2 to perform targeted correction on the unqualified slot; the coverage threshold is a configurable parameter, ranging from 0.8 to 1.0, with a system default of 0.9. Step S35: Export an editable Word document and an archived PDF document, and simultaneously output the field and slot mapping table, the differences and revision records of slot text, the list of uncovered fields, timestamps, template versions, threshold parameters, and rendering logs.

[0010] Preferably, in step S2, semantic alignment is achieved in the following way: Perform name-value fusion encoding on field names and numerical contexts in standardized structured data to obtain field vectors; Encode the structural information of the slot template and the metadata of each slot to obtain the slot vector; Calculate the cosine similarity between the field vector and the slot vector, and normalize the cosine similarity, or use a soft maximum variant of cosine similarity to obtain the alignment weight from field to slot.

[0011] Preferably, the template filling in step S3 includes uniform rendering of title numbering, table style, and terminology.

[0012] Preferably, in step S33, the slot coverage is calculated based on the number of qualified slots already generated relative to the total number of required slots.

[0013] This invention also provides a power standard document generation system based on structured alignment, applied to the above method, comprising the following modules: The structured parsing and standardization module is used to receive raw table data, complete field synonym merging and standardization, unit conversion, scaling processing and metadata recording, and execute step S1; the module sets up an exception queue and a return interface to accept entries that cannot be automatically mapped or have unit errors, and fills in the standardization results after completion. The semantic alignment and constrained generation module is used to perform vectorization processing on standardized structured data and slot templates, calculate alignment weights, generate slot text, evaluate text consistency, and perform constrained regeneration operations when the consistency is not met, executing step S2; the module includes a field encoder, a slot encoder, a similarity calculator, a generative language model, a consistency evaluator, and a regeneration controller; the regeneration controller first compares the output of the evaluator with a preset semantic consistency threshold, selects a constraint strategy based on the comparison result, and drives the generative language model to decode again; The template filling and export verification module is used for template placeholder backfilling, unit and precision rendering, slot coverage and full-text consistency acceptance, document export and reconciliation log output, and executes step S3; the module can select the corresponding rendering rule according to the template version identifier and record the template version information in the export results; The knowledge and rule base module stores the power industry vocabulary, synonym merging and standardization rules, unit conversion rules, template precision rules, and constraint vocabulary, which are used to support rule calling and constraint generation in each step. The control and parameter management module is used to configure thresholds, iteration limits, weight parameters and trigger rollback processes, and coordinate the parameter control and process management of execution steps S1 to S3. The hardware processing module includes a memory and a processor, which is used to drive the above modules to work together to execute the above methods.

[0014] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for generating electrical standard documents based on structured alignment.

[0015] Therefore, the present invention adopts the above-mentioned method, system and medium for generating power system documents based on structured alignment, which reduces the cost of manual review and template maintenance, improves the accuracy of field alignment and the consistency of generated content, supports full-process tracking and result traceability, and enhances the automation and reliability of the system in scenarios such as engineering construction, material management and completion archiving.

[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0017] Figure 1 This is a flowchart of a method according to an embodiment of the present invention; Figure 2 This is a structural diagram of the structured analysis and standardization module in an embodiment of the present invention; Figure 3 This is a structural diagram of the semantic alignment and constrained generation module in an embodiment of the present invention; Figure 4 This is a structural diagram of the template filling and export verification module in an embodiment of the present invention. Detailed Implementation

[0018] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0019] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0020] Example 1 like Figure 1 As shown, the method for generating power standard documents based on structured alignment includes the following steps: Step S1, Structured Parsing and Standardization: Receive raw tabular data from the power industry's material inventory or business database, parse the raw tabular data, normalize fields, convert units, and scale the data to generate standardized structured data.

[0021] Step S11: Parse each record in the original table data into a triplet in the form of field-value-unit; Step S12: Based on the preset power industry vocabulary, rule base and lightweight classifier, perform synonym merging on the fields in the triplet to unify the scope and obtain a standard field set. Synonym merging and scope unification are achieved through a mapping function. Fields that cannot be mapped or have unit anomalies are entered into an anomaly queue for manual or offline rule processing and then returned. Step S13: Based on the target unified unit in the power standard document, perform unit conversion on the fields in the triplet and record the conversion trajectory. The unit conversion includes at least one of the following: scale factor, offset, temperature scale or ratio rule, and record the original unit, target unit and conversion parameters. Step S14: Scale the unit conversion results according to the preset normalization function, and set up zero-deletion micro-terms to enhance the robustness of outliers, and finally generate standardized structured data and corresponding metadata.

[0022] Step S2, Semantic Alignment and Constrained Generation: Based on the preset slot template, the standardized structured data is aligned with the slots in the template through similarity calculation to generate candidate text for each slot; and the semantic consistency and numerical accuracy of the candidate text are evaluated. If the evaluation result does not meet the preset semantic consistency threshold, a constrained regeneration operation is performed until the threshold requirement is met or the iteration limit is reached.

[0023] Semantic alignment is achieved in the following ways: Perform name-value fusion encoding on field names and numerical contexts in standardized structured data to obtain field vectors; Encode the structural information of the slot template and the metadata of each slot to obtain the slot vector; Calculate the cosine similarity between the field vector and the slot vector, and normalize the cosine similarity, or use a soft maximum variant of cosine similarity to obtain the alignment weight from field to slot.

[0024] Step 2 specifically includes: Step S21: Encode the standardized structured data using a field encoder and encode the preset slot template using a slot encoder to generate field vectors and slot vectors respectively. The slot template contains multiple slots, and each slot is associated with at least a template prompt fragment, target unit, and precision rule. Step S22: Calculate the alignment weight from field to slot based on similarity, and perform weighted aggregation on the field vector based on the alignment weight to obtain the slot semantic summary for each slot. Step S23: Using template hint fragments and slot semantic summaries as conditions, drive the generative language model to generate slot text for the corresponding slots; Step S24: Based on the target unit and precision rules associated with slots, write back the unit and precision of key values ​​in the slot text; Step S25: Select the field with the highest semantic relevance to the current slot from the standardized structured data, and construct an evidence string based on the triple information of the field with the highest relevance. Step S26: Jointly evaluate the semantic consistency and numerical deviation of the generated text and the evidence string to obtain a comprehensive consistency score; the semantic consistency score is generated by a dual-tower or cross-encoder, and the numerical deviation is the relative error or the interval deviation within the template's allowable tolerance. The two are fused according to configurable weights. Step S27: For evaluation results that do not meet the preset semantic consistency threshold, perform a constrained regeneration operation until the semantic consistency threshold is met or the iteration limit is reached. The iteration limit is an externally adjustable parameter, usually set between 3 and 10 iterations. In this embodiment, 5 iterations are used. When the regeneration iteration reaches the limit and the semantic consistency threshold is still not met, the system will select the candidate text with the highest comprehensive consistency score from all iteration results as the final output. The semantic consistency threshold is a configurable parameter that can be flexibly set according to business needs. The recommended range is 0.7-0.95, and the system default is 0.85.

[0025] During the constrained regeneration process, allowed or prohibited words are determined by the template specification and business terminology library; unit and decimal place locking is performed according to the template slot precision rules; key values ​​are preferentially copied directly from standardized structured data and concatenated with the surrounding grammatical templates of the text.

[0026] Step S3, Template Filling and Export Verification: Fill the slot text that meets the threshold requirements in Step S2 into the power system document template, perform format rendering and global consistency verification; if the verification passes, export the final power system document; if the verification fails, go back to Step S2 for targeted correction. Template filling includes uniform rendering of title numbering, table styles, and terminology.

[0027] Step S31: Fill the slot text that meets the semantic consistency threshold requirement in step S2 back into the corresponding placeholder in the power system document template; Step S32: Based on the conversion trajectory recorded in step S13 and the preset precision rules in the template, perform rendering processing on the key values ​​in the backfill text to adjust the units and decimal places. Step S33: Calculate the consistency between slot coverage and the full text average; slot coverage is calculated based on the number of qualified slots generated relative to the total number of required slots. Step S34: Compare the slot coverage with the preset coverage threshold, and compare the full-text average consistency with the preset semantic consistency threshold; if both meet the criteria, execute document export; if either does not meet the criteria, go back to step S2 to perform targeted correction on the unqualified slot; the coverage threshold is a configurable parameter, the recommended range is 0.8-1.0, and the system default is 0.9; Step S35: Export an editable Word document and an archived PDF document, and simultaneously output the field and slot mapping table, the differences and revision records of slot text, the list of uncovered fields, timestamps, template versions, threshold parameters, and rendering logs.

[0028] The power system document generation system based on structured alignment includes the following modules: Structured parsing and standardization module: Used to receive raw table data, complete field synonym merging, standardization, unit conversion, scaling and metadata recording, and execute step S1; This module sets up an exception queue and a reflow interface to handle entries that cannot be automatically mapped or have unit exceptions, and then fills in the standardized results after completing the entries. like Figure 2 As shown, this module receives raw tables from a materials list or business database as input. The goal is to standardize the records in the materials list / database to a unified standard and unit, and the output can be used for downstream alignment and generation of a stable representation. Assume the original table is: ,in, For field names, For numbers or text, For units of measurement, Represents the original data table. Indicates the record number. This indicates the quantity recorded in the original materials inventory. This representation clarifies the three-part structure of the input data—field, value, and unit—facilitating subsequent unified processing.

[0029] To eliminate the impact of differences in field naming across different systems or forms on subsequent processing, this module uses an industry thesaurus, rule base, and lightweight classifier to perform synonym merging on each field to unify the definition and map them to a standard field set. The correspondence is maintained as follows: ,in This module provides a synonym / caliber mapping function, and the mapping relationship is traceable in subsequent export and auditing. To ensure dimensional consistency and rewritability across data sources, this module sets a unified unit of measurement. Each field is converted to its original unit, and the conversion process is fully recorded for final document rendering and auditing. .in, Unit conversion functions (including rules for scale factors, offsets, temperature scales / ratios, etc.) Indicates the first Each record contains standardized values ​​after unit unification. The conversion trajectory is saved along with the original units to ensure that it can be written back to the specified units and precision according to the template requirements. To reduce the impact of differences in units and magnitudes on modeling and generation, and to improve robustness to outliers, the converted values ​​are scaled: ,in, Indicates the first The final value of each record after unit conversion and further normalization processing. This represents the mean value obtained by statistically analyzing a specific field (or a category of fields). This indicates the standard deviation of the corresponding field's data within the historical or current window. This represents a very small constant used to prevent division by zero anomalies. , It can be obtained by statistical analysis based on historical data or business cycles.

[0030] After completing the above processing, standardized structured data is output for direct use by downstream modules, as well as metadata for write-back and auditing: ,in, This represents the final output dataset of the structured parsing and normalization module, along with the output field mapping function. Trajectory conversion with units The records are used to support dimensional write-back, format unification, and full-process traceability during the template rendering stage.

[0031] Semantic alignment and constrained generation module: This step S2 is used to perform vectorization processing on standardized structured data and slot templates, calculate alignment weights, generate slot text, evaluate text consistency, and perform constrained regeneration operations when the consistency is not met. This module includes a field encoder, a slot encoder, a similarity calculator, a generative language model, a consistency evaluator, and a regeneration controller. The regeneration controller first compares the output of the evaluator with a preset semantic consistency threshold, selects a constraint strategy based on the comparison result, and drives the generative language model to decode again. like Figure 3 As shown, this module first encodes each standard field and each template slot into a vector. and Using cosine similarity Calculate the alignment score, then normalize the field dimensions to obtain the weights. Based on this, the semantic summary of the data required for the slot is obtained. In the generation phase, slot text is generated using "template hints + summary" as conditions, and key numerical values ​​are written back according to the template units and precision to ensure consistency. Subsequently, an evidence string is constructed from the fields most relevant to the slot, and a joint consistency assessment of "semantic + numerical" is performed on the generated text, where the semantic score is... The relative deviation of the values ​​is Consistency is denoted as ,in, This represents the weighting coefficient of semantic consistency score in the overall consistency evaluation. The sensitivity coefficient represents the numerical deviation attenuation factor. Below the threshold When this happens, initiate a constrained regeneration: restrict allowed / prohibited words for the slot, lock units and decimal places, and prioritize copying the source field value until consistency is achieved or the maximum number of iterations is reached. This ensures that fields, values, and units are faithfully presented in the text and consistent with the entire document.

[0032] Template filling and export review module: Used for template placeholder backfilling, unit and precision rendering, slot coverage and full text consistency acceptance, document export and reconciliation trace output, execute step S3; The module can select the corresponding rendering rule according to the template version identifier and record the template version information in the exported results. When the template version is updated (such as adding or deleting slots or changing precision rules), the historical standardized data (S1 output) does not need to repeat the structured parsing. It only needs to re-execute the slot vector encoding (S21) and alignment weight calculation (S22) through the semantic alignment module to adapt to the new template. like Figure 4 As shown, this module is used to backfill the slot text that has passed the semantic consistency threshold in the previous module according to the template specification and complete the overall acceptance and reconciliation output: the system maps each segment according to the field → slot mapping. Write the corresponding placeholders into the Word template, and simultaneously perform unit conversion backwriting and decimal rendering according to the previously recorded unit conversion trajectory and template precision rules to ensure consistency in numbering, headings, table styles, and terminology; then perform a full-page acceptance test to calculate slot coverage completeness. Consistency with the average of the whole text ,in, This indicates the total number of slots that need to be filled in the template, only when... and If the final document is generated on time, otherwise return to the previous module and trigger a constrained regeneration. The coverage threshold represents the integrity of slot coverage. This represents the average consistency threshold for the entire text. During the export phase, the system generates editable Word documents and archived PDFs according to the template version requirements, and simultaneously generates reconciliation and record-keeping materials, including a "Field-Slot Mapping Table" (providing the main alignment weights), "Difference and Revision Records" (listing the preceding and following text, the constraints used, and the reasons), and a "List of Uncovered Fields." It also records timestamps, template versions, threshold parameters, and rendering logs to meet the State Grid's requirements for data auditing and full-process traceability.

[0033] The knowledge and rule base module stores the power industry vocabulary, synonym merging and standardization rules, unit conversion rules, template precision rules, and constraint vocabulary, which are used to support rule calling and constraint generation in each step. The control and parameter management module is used to configure thresholds, iteration limits, weight parameters and trigger rollback processes, and coordinate the parameter control and process management of execution steps S1 to S3. The hardware processing module includes a memory and a processor, which are used to drive the above modules to work together to execute the method of the present invention.

[0034] Therefore, this invention adopts the aforementioned method, system, and medium for generating power standard documents based on structured alignment. Through a closed-loop process of "structured parsing and standardization - semantic alignment constraint generation - template filling, verification, and export," combined with field synonym merging, unit conversion trajectory recording, semantic and numerical joint consistency assessment, and threshold-triggered forced correction mechanisms, it effectively solves the problems of semantic alignment difficulties, low efficiency of manual verification, and poor information consistency in the State Grid business scenario between material inventory table data and power standard documents. It realizes the automated generation of editable and archived documents conforming to State Grid standards from table data. At the same time, the supporting system, through functional unit collaboration and full-process traceability design (output mapping table, revision record, etc.), ensures the uniformity of generated documents in terms of field scope, numerical accuracy, and format specifications, reduces manual operation costs and mismatch risks, and meets the State Grid's needs for data digitization, standardization, and intelligence in engineering construction, material management, and completion archiving. It provides an efficient and reliable technical solution for the generation of standard documents and data consistency verification in the power industry.

[0035] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for generating power system documents based on structured alignment, characterized in that, Includes the following steps: Step S1, Structured Parsing and Standardization: Receive raw tabular data from the material inventory or business database of the power industry, parse the raw tabular data, normalize the fields, convert units and scale the data to generate standardized structured data. Step S2, Semantic Alignment and Constrained Generation: Based on the preset slot template, the standardized structured data is aligned with the slots in the template through similarity calculation to generate candidate text for each slot; and the semantic consistency and numerical accuracy of the candidate text are evaluated. If the evaluation result does not meet the preset semantic consistency threshold, a constrained regeneration operation is performed until the threshold requirement is met or the iteration limit is reached. Step S3, Template Filling and Export Verification: Fill the slot text that meets the threshold requirements in step S2 into the power system document template, and perform format rendering and global consistency verification. If the verification passes, the final power standard document is exported; if the verification fails, the process reverts to step S2 for targeted correction.

2. The method for generating power system documents based on structured alignment according to claim 1, characterized in that, Step S1 specifically includes: Step S11: Parse each record in the original table data into a triplet in the form of field-value-unit; Step S12: Based on the preset power industry vocabulary, rule base and lightweight classifier, perform synonym merging on the fields in the triplet to unify the scope and obtain a standard field set. Synonym merging and scope unification are achieved through a mapping function. Fields that cannot be mapped or have unit anomalies are entered into an anomaly queue for manual or offline rule processing and then returned. Step S13: Based on the target unified unit in the power standard document, perform unit conversion on the fields in the triplet and record the conversion trajectory. The unit conversion includes at least one of the following: scale factor, offset, temperature scale or ratio rule, and record the original unit, target unit and conversion parameters. Step S14: Scale the unit conversion results according to the preset normalization function, and set up zero-deletion micro-terms to enhance the robustness of outliers, and finally generate standardized structured data and corresponding metadata.

3. The method for generating power system documents based on structured alignment according to claim 1, characterized in that, Step S2 specifically includes: Step S21: Encode the standardized structured data using a field encoder and encode the preset slot template using a slot encoder to generate field vectors and slot vectors respectively. The slot template contains multiple slots, and each slot is associated with at least a template prompt fragment, target unit, and precision rule. Step S22: Calculate the alignment weight from field to slot based on similarity, and perform weighted aggregation on the field vector based on the alignment weight to obtain the slot semantic summary for each slot. Step S23: Using template hint fragments and slot semantic summaries as conditions, drive the generative language model to generate slot text for the corresponding slots; Step S24: Based on the target unit and precision rules associated with slots, write back the unit and precision of key values ​​in the slot text; Step S25: Select the field with the highest semantic relevance to the current slot from the standardized structured data, and construct an evidence string based on the triple information of the field with the highest relevance. Step S26: Jointly evaluate the semantic consistency and numerical deviation of the generated slot text and evidence string to obtain a comprehensive consistency score; the semantic consistency score is generated by a dual-tower or cross-encoder, and the numerical deviation is the relative error or the interval deviation within the template's allowable tolerance. The two are fused according to configurable weights. Step S27: For evaluation results that do not meet the preset semantic consistency threshold, perform a constrained regeneration operation until the semantic consistency threshold is met or the iteration limit is reached. If the semantic consistency threshold is still not met after reaching the iteration limit, select the candidate text with the highest comprehensive consistency score as the final output. The iteration limit is a configurable parameter with a range of 3-10 times and a system default of 5 times. The semantic consistency threshold is also a configurable parameter with a range of 0.7-0.95 and a system default of 0.

85.

4. The method for generating power system documents based on structured alignment according to claim 3, characterized in that, In the constrained regeneration process of step S27, allowed or prohibited words are determined by the template specification and the business terminology library; unit and decimal place locking is performed according to the template slot precision rules. Key numerical values ​​are first copied directly from structured data and concatenated with the surrounding grammatical templates of the text.

5. The method for generating power system documents based on structured alignment according to claim 2, characterized in that, Step S3 specifically includes: Step S31: Fill the slot text that meets the semantic consistency threshold requirement in step S2 back into the corresponding placeholder in the power system document template; Step S32: Based on the conversion trajectory recorded in step S13 and the preset precision rules in the template, perform rendering processing on the key values ​​in the backfill text to adjust the units and decimal places. Step S33: Calculate the consistency between slot coverage and the full-text average; Step S34: Compare the slot coverage with the preset coverage threshold, and compare the full-text average consistency with the preset semantic consistency threshold; if both meet the criteria, execute document export; if either does not meet the criteria, go back to step S2 to perform targeted correction on the unqualified slot; the coverage threshold is a configurable parameter, ranging from 0.8 to 1.0, with a system default of 0.

9. Step S35: Export an editable Word document and an archived PDF document, and simultaneously output the field and slot mapping table, the differences and revision records of slot text, the list of uncovered fields, timestamps, template versions, threshold parameters, and rendering logs.

6. The method for generating power system documents based on structured alignment according to claim 3, characterized in that, In step S2, semantic alignment is achieved in the following way: Perform name-value fusion encoding on field names and numerical contexts in standardized structured data to obtain field vectors; Encode the structural information of the slot template and the metadata of each slot to obtain the slot vector; Calculate the cosine similarity between the field vector and the slot vector, and normalize the cosine similarity, or use a soft maximum variant of cosine similarity to obtain the alignment weight from field to slot.

7. The method for generating power system documents based on structured alignment according to claim 1, characterized in that, The template filling in step S3 includes uniform rendering of title numbering, table style, and terminology.

8. The method for generating power system documents based on structured alignment according to claim 5, characterized in that, In step S33, the slot coverage is calculated based on the number of qualified slots generated relative to the total number of required slots.

9. A power system document generation system based on structured alignment, applied to the power system document generation method based on structured alignment according to any one of claims 1 to 8, characterized in that, Includes the following modules: The structured parsing and standardization module is used to receive raw table data, complete field synonym merging and standardization, unit conversion, scaling processing and metadata recording, and execute step S1 of claim 1; the module sets up an exception queue and a backflow interface to accept entries that cannot be automatically mapped or have unit anomalies, and backfills the standardization results after completing them. The semantic alignment and constrained generation module is used to perform vectorization processing on standardized structured data and slot templates, calculate alignment weights, generate slot text, evaluate text consistency, and perform constrained regeneration operations when the consistency is not met, thus performing step S2 of claim 1. The module includes a field encoder, a slot encoder, a similarity calculator, a generative language model, a consistency evaluator, and a regeneration controller. The regeneration controller first compares the output of the evaluator with a preset semantic consistency threshold, selects a constraint strategy based on the comparison result, and drives the generative language model to decode again. The template filling and export verification module is used for template placeholder backfilling, unit and precision rendering, slot coverage and full-text consistency acceptance, document export and reconciliation trace output, and performs step S3 of claim 1; the module can select the corresponding rendering rule according to the template version identifier and record the template version information in the export result. The knowledge and rule base module stores the power industry vocabulary, synonym merging and standardization rules, unit conversion rules, template precision rules, and constraint vocabulary, which are used to support rule calling and constraint generation in each step. The control and parameter management module is used to configure thresholds, iteration limits, weight parameters and trigger rollback processes, and coordinate the parameter control and process management of execution steps S1 to S3. A hardware processing module, comprising a memory and a processor, is used to drive the aforementioned modules to collaboratively execute the method of any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it implements the method for generating electrical standard documents based on structured alignment as described in any one of claims 1 to 8.