A prompt word model construction method for generating a work ticket data analysis report

By constructing a prompt word graph model for power work order data analysis reports, and combining it with the Neo4j graph database and large language model, the adaptability and quality issues of power work order data analysis report generation in existing technologies have been resolved. This has enabled efficient and automated report generation, improving the professionalism and consistency of the reports.

CN122242451APending Publication Date: 2026-06-19CHINA THREE GORGES CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA THREE GORGES CORPORATION
Filing Date
2026-03-25
Publication Date
2026-06-19

Smart Images

  • Figure CN122242451A_ABST
    Figure CN122242451A_ABST
Patent Text Reader

Abstract

This invention provides a method for constructing a prompt word model for generating work order data analysis reports. Addressing the industry-specific needs of generating power work order data analysis reports, it constructs a data analysis report prompt word graph model adapted to the characteristics of power business. A graph database is used to achieve a structured mapping between the report structure and analysis logic, enabling standardized management and efficient reuse of prompt words. Simultaneously, during the decoding stage of the report generation using a large language model, a DeAL framework is introduced to design a dynamic alignment strategy. A comprehensive multi-objective reward function, integrating consistency, content quality, and language professionalism, is used as a heuristic function to evaluate the alignment degree of the generated content in real time and guide the selection of the optimal generation path. Ultimately, this achieves efficient and automated generation of power work order data analysis reports, significantly improving the report's professionalism, standardization, and content accuracy. This effectively solves the core shortcomings of existing technologies in adapting to the dynamic analysis needs of complex business data processing and in industry-specific quality control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas overhead pipeline technology, and in particular to a method for constructing a prompt word model for generating work order data analysis reports. Background Technology

[0002] In existing technologies, several intelligent report generation solutions based on large language models and database technologies have been proposed and patented. Typical examples include: a general report generation technology based on large language models, which generates reports by constructing problem tags, structuring target data, and combining report templates; and a flywheel mechanism to fine-tune the model to improve report generation quality and relevance. Another example is intelligent due diligence report generation technology for the financial non-performing asset sector, which uses natural language processing to analyze user needs, dynamically generate report templates, and combines NL2SQL technology and online retrieval tools to complete data collection and processing, ultimately generating due diligence reports that conform to industry standards. A third example is analytical report generation technology for tax statements, which preprocesses historical report data, performs semantic segmentation and vectorized storage, combines a large programming model to complete report data analysis, and generates analytical reports based on preset models. Finally, an automatic report generation technology for the technology novelty search field extracts and expands keywords after modularizing the text to be searched, retrieves relevant technical texts from the database, filters and matches them, constructs a causal relationship chain, and generates a logically coherent novelty search report. The technologies mentioned above have all automated report generation in their respective application areas, effectively improving report generation efficiency, reducing manual intervention, and providing technical reference for cross-domain intelligent report generation.

[0003] However, when the aforementioned existing technologies are applied to the scenario of generating power work order data analysis reports, there are obvious adaptation defects: First, they are difficult to handle the multi-dimensional and multi-logical relationships of power work order data, and their ability to process complex data structures is insufficient; second, they have poor adaptability to dynamic analysis needs, with some technologies failing to accurately capture complex user needs, and some lacking a structured management mechanism for prompt words, resulting in low reuse and update efficiency; third, they focus on text processing and lack the ability to deeply analyze structured business data of power work orders; and fourth, they lack a generation quality control system adapted to the characteristics of the power industry, making it impossible to guarantee the report style, professionalism, and logic, and requiring a large amount of manual review and modification of the generated content.

[0004] The aforementioned shortcomings of existing technologies prevent them from being directly applied to the generation of power work order data analysis reports. Currently, there is a lack of efficient generation strategies in the field that can adapt to the characteristics of power work order data, support dynamic demand adjustments, and ensure the quality of report generation. This makes it difficult to meet the actual business needs of the power industry for value mining of work order data, and there is an urgent need to propose targeted technical solutions. Summary of the Invention

[0005] This invention provides a method for constructing a prompt word model to generate work order data analysis reports. It solves the technical problem that existing intelligent report generation technologies cannot adapt to the characteristics of power work order data, and have deficiencies in complex data processing, dynamic demand response, prompt word management, and industry-specific quality control, making it difficult to efficiently generate work order data analysis reports that meet the professional requirements of the power industry.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for constructing a prompt word model for generating work order data analysis reports, comprising the following steps: S1. Construct a data analysis report prompt word graph model: Obtain the raw data of the power work order and store it in a relational database. According to the writing specifications of the power work order data analysis report, create multi-type nodes with corresponding report structure and analysis logic in the Neo4j graph database, and establish the relationship between nodes to form a complete prompt word graph model. Extract the corresponding content from the prompt word graph model through Cypher graph query statements, and assemble it into a complete prompt word containing task instructions, alignment prompts, and input prompts. The prompt word integrates dynamically adjustable SQL query statements. S2. Dynamic alignment generation during the decoding stage: During the decoding stage of the large language model generating a report based on the prompt words, the DeAL framework is introduced to construct a dynamic alignment strategy. At each decoding step, the comprehensive score is calculated from the top-k candidate generation actions output by the large model through the action selection function, and the candidate action with the highest comprehensive score is selected as the generation action for the current step. S3 Constructing a comprehensive multi-objective reward function: Design a comprehensive reward function that integrates consistency, content quality, and language professionalism. Use this comprehensive reward function as a heuristic function for the action selection function in step S2 to evaluate the alignment effect of candidate generation paths in real time and guide the generation path selection of the large model.

[0007] Preferably, in step S1, the multiple types of nodes include document nodes, chapter nodes, subsection nodes, analysis task nodes, analysis dimension nodes, and SQL method nodes; the relationships between the nodes include the "containing chapter" relationship between document nodes and chapter nodes, the "containing subsection" relationship between chapter nodes and subsection nodes, the "containing analysis" relationship between subsection nodes and analysis task nodes, the "corresponding dimension" relationship between analysis task nodes and analysis dimension nodes, and the "call query" relationship between analysis dimension nodes and SQL method nodes.

[0008] Preferably, in step S1, the task instruction of the prompt word is used to define the core task of text generation of the large language model, the alignment prompt is used to define the format, constraints and alignment targets that the generated content must meet, and the input prompt is used to input the power work ticket data context that the large model needs to process; the dynamic adjustment of the SQL query statement includes the introduction of filtering parameters such as time range, station range and work ticket type to realize targeted query and analysis of power work ticket data under the corresponding dimensions.

[0009] Preferably, in step S2, the expression for the action selection function is:

[0010] in: This represents the text fragment generated in the current step; It is the generation probability based on a large language model, representing the generated text sequence given the prompt word p. The logarithm of the probability; is a hyperparameter used to balance the impact of generation probability and alignment reward; l represents lookahead length, which determines how many words the model will look ahead to aid decision-making; It is a heuristic function used to evaluate whether candidate paths meet the alignment target.

[0011] Preferably, the expression for the comprehensive reward function is:

[0012] in: For consistent reward function, For content quality reward function, A reward function for language expertise; , , Let be the weight coefficients of the corresponding reward function, and satisfy . =1, used to balance the importance of different alignment targets.

[0013] Preferably, the consistency reward function The expression used to assess the consistency of format and style in generated reports is: ; Where y is the content of the generated report; These are two adjacent paragraphs in the report; K is the number of paragraphs. This is a style similarity function.

[0014] Preferably, the content quality reward function The expression used to evaluate the overall content quality of the generated report is: ; in, It is the p-th quality standard, including language fluency, logical coherence, data accuracy, and formatting standardization; P is the total number of quality standards. It is a quality scoring function used to evaluate the score of the generated content on each quality standard. It uses BERTScore to calculate the degree of matching between the generated content and the standard reference report text to obtain the corresponding quality score.

[0015] Preferably, the language proficiency reward function (y) is used to assess the power industry-specific suitability of the generated report, and its expression is: ; in, It is the t-th sentence or paragraph in the report; T is the total number of sentences or paragraphs. It is a language professionalism scoring function that evaluates the language professionalism of each sentence or paragraph; it calculates the professionalism score by combining the professional terminology coverage of the corresponding sentence or paragraph with TF-IDF weights through a pre-built glossary of professional terms in the power industry.

[0016] Preferably, in step S1, the original data of the power work order includes the work type code, specific site, work order type, work order number, work content, work supervisor information, number of people in the work shift, work order permit time, and work order planned completion time, and the relational database is a MySQL database.

[0017] Preferably, it also includes the dynamic updating and expansion steps of the prompt word graph model: according to the new analysis requirements, add corresponding nodes in the graph database, adjust the relationship between nodes, or add analysis dimensions and analysis task nodes to realize the dynamic iteration of the prompt word graph model and adapt to different power work ticket analysis report generation requirements.

[0018] This invention provides a method for constructing a prompt word model for generating work order data analysis reports, which has the following beneficial effects: 1. Improve the quality of generated reports. Through dynamic alignment strategies and a comprehensive multi-objective reward function, the generated reports are significantly improved in terms of style consistency, language professionalism, and logical fluency, approaching the quality of the final published reports and reducing the workload of manual review and modification.

[0019] 2. Improve generation efficiency: The construction of the prompt word graph model makes the report generation process more efficient. Relevant prompt words are quickly extracted through the graph database and assembled into a complete prompt word set according to logical order, thereby improving the speed and accuracy of report generation.

[0020] 3. Enhanced customization capabilities: Users can adjust the weights of each sub-reward function in the comprehensive reward function according to specific needs, flexibly balance the importance of different objectives, and achieve highly customized report generation strategies.

[0021] 4. Adapting to diverse needs: The prompt word graph model supports dynamic updates and expansion, enabling rapid adjustment of the report structure and content based on new analytical requirements, thus adapting to diverse needs in different scenarios. Attached Figure Description

[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0023] like Figure 1 As shown, a method for constructing a prompt word model to generate a work order data analysis report includes the following steps: S1. Construct a data analysis report prompt word graph model: Obtain the raw data of the power work order and store it in a relational database. According to the writing specifications of the power work order data analysis report, create multi-type nodes with corresponding report structure and analysis logic in the Neo4j graph database, and establish the relationship between nodes to form a complete prompt word graph model. Extract the corresponding content from the prompt word graph model through Cypher graph query statements, and assemble it into a complete prompt word containing task instructions, alignment prompts, and input prompts. The prompt word integrates dynamically adjustable SQL query statements. S2. Dynamic alignment generation during the decoding stage: During the decoding stage of the large language model generating a report based on the prompt words, the DeAL framework is introduced to construct a dynamic alignment strategy. At each decoding step, the comprehensive score is calculated from the top-k candidate generation actions output by the large model through the action selection function, and the candidate action with the highest comprehensive score is selected as the generation action for the current step. S3 Constructing a comprehensive multi-objective reward function: Design a comprehensive reward function that integrates consistency, content quality, and language professionalism. Use this comprehensive reward function as a heuristic function for the action selection function in step S2 to evaluate the alignment effect of candidate generation paths in real time and guide the generation path selection of the large model.

[0024] This paper presents a complete report generation solution adapted to the power work order scenario, which solves the core defect of insufficient industry adaptability of existing technologies, improves the quality and efficiency of report generation, realizes automated and accurate report generation, greatly reduces manual intervention, and can effectively handle the complex data relationships of multi-dimensional work orders to meet dynamic analysis needs.

[0025] Preferably, in step S1, the multiple types of nodes include document nodes, chapter nodes, subsection nodes, analysis task nodes, analysis dimension nodes, and SQL method nodes; the relationships between the nodes include the "containing chapter" relationship between document nodes and chapter nodes, the "containing subsection" relationship between chapter nodes and subsection nodes, the "containing analysis" relationship between subsection nodes and analysis task nodes, the "corresponding dimension" relationship between analysis task nodes and analysis dimension nodes, and the "call query" relationship between analysis dimension nodes and SQL method nodes.

[0026] By defining multiple types of nodes and their corresponding relationships, a clear and complete mapping between the report structure and analysis logic is constructed, enabling structured management of prompt words, improving the reusability and assembly efficiency of prompt words, strengthening the ability to process multi-dimensional and multi-logical data from work tickets, and ensuring that the generated reports comply with industry writing standards.

[0027] These relationships help build a complete data analysis report prompt word graph model, as follows:

[0028]

[0029] in, This represents the entire analysis report. A Chapter represents the individual chapters within the report. A Section represents the subsections within a chapter. An AnalysisTask represents the specific analysis task. An AnalysisDimension represents the specific dimension of the analysis. An SQLMethod represents the method for extracting data from the database.

[0030] Preferably, in step S1, the task instruction of the prompt word is used to define the core task of text generation for the large language model; the alignment prompt is used to define the format, constraints, and alignment targets that the generated content must meet; and the input prompt is used to input the power work order data context that the large model needs to process. The dynamic adjustment of the SQL query statement includes introducing filtering parameters such as time range, site range, and work order type to achieve targeted querying and analysis of power work order data under corresponding dimensions. By clearly defining the three-part structure of the prompt word and the dynamic adjustment mechanism of the SQL, the task objectives and constraints of the large model generation are clearly defined, ensuring accurate alignment between the generated content and analysis requirements. Simultaneously, it enables targeted querying and analysis of multi-dimensional work order data, significantly improving the adaptability to dynamic analysis needs.

[0031] Using the Cypher graph query, relevant prompts are extracted from the graph model based on the report's chapter and section structure, and assembled in logical order to form a complete prompt p. The SQL query within the prompt can be dynamically adjusted according to user needs. For example, by introducing a time range parameter, the SQL query can flexibly perform work ticket data analysis within the corresponding time period. This dynamic adjustment capability allows the prompts to adapt to different data requirements, ensuring that the generated content highly matches the actual analysis needs.

[0032] The cue word 'p' not only the starting point for text generation, but also contains important information such as task instructions and alignment goals:

[0033] Among them, task instructions The main task of text generation is defined. It typically involves specific instructions or questions that the model must answer, such as comprehensively analyzing the basic information of a work order, evaluating work data, providing opinions based on your expertise, and aligning prompts. The alignment target for text generation is defined. It includes whether the generated content meets specific requirements or constraints of the data analysis report, such as: the description needs to be clearer (this could be site-specific); input suggestions. This refers to the input content of the task, that is, the data or contextual information that the model needs to process. For example, the average planned travel time per ticket at each station.

[0034] Furthermore, the cue word graph model supports dynamic updates and expansion, enabling rapid adjustments to the report's structure and content based on new analytical needs. This not only improves report generation efficiency but also ensures the accuracy and consistency of the generated content, providing an efficient and flexible tool for generating data analysis reports in the power industry.

[0035] In the process of generating data analysis reports from prompt words using a large language model, specifically during the decoding phase, a dynamic alignment strategy is designed using the DeAL framework. The model can evaluate the alignment degree of the generated content in real time and guide the generation path through heuristic functions. In each decoding step, the candidate action with the highest alignment reward is selected from the top-k candidate actions provided by the large model as the next action. This strategy significantly improves the quality of the generated report and reduces the workload of manual review and modification.

[0036] Preferably, in step S2, the expression for the action selection function is:

[0037] in: This represents the text fragment generated in the current step; It is the generation probability based on a large language model, representing the generated text sequence given the prompt word p. The logarithm of the probability; is a hyperparameter used to balance the impact of generation probability and alignment reward; l represents lookahead length, which determines how many words the model will look ahead to aid decision-making; It is a heuristic function used to evaluate whether candidate paths meet the alignment target. By limiting the action selection function in the decoding stage, it achieves real-time alignment control at each step of the generation process, flexibly balancing generation smoothness and target matching, accurately guiding the generation path of large models, significantly improving the fit between report content and expected goals, and reducing the workload of subsequent manual review and modification.

[0038] A comprehensive multi-objective reward function was designed to evaluate the quality of generated report content. This function determines the alignment effect of the generated content, ensuring consistent report style, professional language, and logical flow. In data analysis report generation, the report content needs to simultaneously meet multiple alignment objectives, including consistency, content quality, and professional language. By defining multiple reward functions, the performance of the generated content on different dimensions is evaluated respectively. These reward functions are then linearly combined to form a comprehensive reward function, the output range of which is [0,1].

[0039] Preferably, the expression for the comprehensive reward function is:

[0040] in: For consistent reward function, For content quality reward function, A reward function for language expertise; , , Let be the weight coefficients of the corresponding reward function, and satisfy . =1, used to balance the importance of different alignment objectives. By adjusting the weights of these reward functions, the importance of different objectives can be flexibly balanced during report generation. This multi-objective reward function design not only improves the overall quality of the generated content but also provides users with a high degree of customization, enabling them to adjust the report generation strategy according to specific needs.

[0041] By defining the combination of comprehensive reward functions, a multi-dimensional quantitative evaluation system for generated quality is established. This system allows for flexible adjustment of the weighting of different alignment targets, enabling customized control over report generation and ensuring overall consistency in report style, content quality, and industry professionalism.

[0042] Preferably, the consistency reward function The expression used to assess the consistency of format and style in generated reports is: ; Where y is the content of the generated report; These are two adjacent paragraphs in the report; K is the number of paragraphs. This is a style similarity function. By defining the calculation method of the consistency reward function, the uniformity of the report's format and style can be quantitatively evaluated and ensured, improving the report's standardization and readability, avoiding stylistic discontinuities between paragraphs, and ensuring that the generated content meets the publication standards of formal reports.

[0043] Preferably, the content quality reward function The expression used to evaluate the overall content quality of the generated report is: ; in, It is the p-th quality standard, including language fluency, logical coherence, data accuracy, and formatting standardization; P is the total number of quality standards. This is a quality scoring function used to evaluate the generated content's score on each quality criterion. It uses BERTScore to calculate the matching degree between the generated content and the standard reference report text to obtain the corresponding quality score. By limiting the calculation method of the content quality reward function, it controls content quality from multiple dimensions, including language fluency, logical coherence, data accuracy, and format compliance, ensuring that the generated content closely approximates the officially released report standards and significantly reducing the cost of manual review and verification.

[0044] Preferably, the language proficiency reward function (y) is used to assess the power industry-specific suitability of the generated report, and its expression is: ; in, It is the t-th sentence or paragraph in the report; T is the total number of sentences or paragraphs. This is a language professionalism scoring function that assesses the language professionalism of each sentence or paragraph. It calculates the professionalism score by combining the coverage rate of professional terms in the corresponding sentence or paragraph with TF-IDF weights using a pre-built glossary of power industry professional terms. By limiting the calculation method of the language professionalism reward function, it can quantitatively ensure that the generated report conforms to the professional standards of the power industry, accurately matches the requirements for the use of industry terminology, enhances the professionalism and authority of the report, and adapts to the specific industry needs of power work order business.

[0045] Preferably, in step S1, the original data of the power work order includes the work type code, specific site, work order type, work order number, work content, work supervisor information, number of workers in the work shift, work order permit time, and work order planned completion time. The relational database is a MySQL database. By clearly defining the core data dimensions of the work order and the MySQL storage method, standardized storage and efficient retrieval of all-dimensional business data are achieved, providing a complete and standardized data foundation for report analysis and ensuring the comprehensiveness, accuracy, and retrieval efficiency of data analysis.

[0046] Preferably, the method also includes dynamic updating and expansion steps for the prompt word graph model: based on new analytical requirements, corresponding nodes are added to the graph database, the relationships between nodes are adjusted, or analytical dimensions and task nodes are added, enabling dynamic iteration of the prompt word graph model to adapt to different power work order analysis report generation needs. By supplementing the dynamic updating and expansion mechanism of the prompt word graph model, flexible model iteration is achieved, which can quickly adapt to new analytical requirements and business scenarios, significantly improving the applicability and lifecycle of the method, and meeting the diverse report generation needs of the power industry.

[0047] The steps for using this method are as follows: 1. Data preparation and storage Collect work order data: Obtain various information related to work orders, including but not limited to work type code, specific site, work order type, work order number, work content, work supervisor and their contact information, number of people in the work shift, work order permit time, planned completion time, etc.

[0048] Store in a relational database: Store the collected work order data in a relational database (MySQL) for subsequent data querying and management.

[0049] 2. Construction of the prompt word graph model Create nodes: Based on the requirements for writing data analysis reports, create various types of nodes in the Neo4j graph database, including document nodes, chapter nodes, section nodes, analysis task nodes, analysis dimension nodes, and SQL method nodes. Each node represents a specific entity.

[0050] Establish relationships: Based on the structure and logic of the analysis report, establish relationships between nodes. For example, establish a "contains chapter" relationship between document nodes and chapter nodes, a "contains section" relationship between chapter nodes and subsection nodes, and a "contains analysis" relationship between subsection nodes and analysis task nodes, etc. These relationships together constitute a complete data analysis report prompt word graph model.

[0051] 3. Prompt word generation Using Cypher queries: Cypher queries extract relevant keywords from the graph model based on the report's chapter and section structure.

[0052] Dynamically Adjustable Prompt Keywords: Based on user needs, such as introducing time range parameters, the SQL query portion of the prompt keywords can be dynamically adjusted to flexibly execute work ticket data analysis within the corresponding time period. This dynamic adjustment capability allows the prompt keywords to adapt to different data requirements, ensuring that the generated content highly matches the actual analysis needs.

[0053] Composition of the prompt: The prompt consists of three parts—task instruction. Alignment instructions and task input Task instructions Define the main tasks of text generation, alignment instructions Define the alignment target for text generation, task input It is the data or context information that the model needs to process.

[0054] 4. Implementation of dynamic alignment strategy Define the reward function and its weights: Define a consistent reward function according to specific requirements. Content quality reward function and language expertise reward function Among them, the consistency reward uses the Transformer encoder to calculate the cosine similarity between adjacent paragraphs; the content quality reward uses BERTScore to evaluate the matching degree with the reference text; and the language professionalism reward is calculated through the coverage of the power terminology vocabulary and TF-IDF weights.

[0055] Action Selection: During the decoding phase of the report generation using the large language model, an action selection function is applied. In each decoding step, the candidate action with the highest alignment reward is selected from the top-k candidate actions provided by the large model as the next action. The overall reward score guides the decoding process, ensuring that the generated content meets the expected alignment target and improving the quality of the generated report. The specific steps are as follows: (1) Calculate the generation probability: Based on the large language model, calculate the log probability of the text segment generated in the current step. This means generating a text sequence given the prompt word p. The logarithm of the probability.

[0056] (2) Evaluate alignment rewards: using heuristics Evaluate the alignment effect of candidate paths. The lookahead length *l* determines how many words the model will look ahead to aid in decision-making.

[0057] (3) Calculation of comprehensive score: The generation probability and alignment reward are weighted and summed to obtain the comprehensive score. , where λ is a hyperparameter used to balance the effects of generation probability and alignment reward.

[0058] (4) Select the best action: Compare the overall scores of all candidate actions, select the one with the highest score as the best action for the current step, and add it to the generated text sequence.

[0059] 5. Update and expand the prompt word graph model Dynamically update the prompt word graph model: Update the prompt word graph model in a timely manner according to new analysis needs, including adding new nodes and modifying the relationships between nodes, to adapt to constantly changing business requirements.

[0060] Extended cue word graph model: To meet more diverse report generation needs, the cue word graph model is extended by adding new analysis dimensions and tasks, enriching the structure and content of the report.

[0061] This invention provides a method for constructing a prompt word model for generating work order data analysis reports. Addressing the industry-specific needs of generating power work order data analysis reports, it constructs a data analysis report prompt word graph model adapted to the characteristics of power business. A graph database is used to achieve a structured mapping between the report structure and analysis logic, enabling standardized management and efficient reuse of prompt words. Simultaneously, during the decoding stage of the report generation using a large language model, a DeAL framework is introduced to design a dynamic alignment strategy. A comprehensive multi-objective reward function, integrating consistency, content quality, and language professionalism, is used as a heuristic function to evaluate the alignment degree of the generated content in real time and guide the selection of the optimal generation path. Ultimately, this achieves efficient and automated generation of power work order data analysis reports, significantly improving the report's professionalism, standardization, and content accuracy. This effectively solves the core shortcomings of existing technologies in adapting to the dynamic analysis needs of complex business data processing and in industry-specific quality control.

[0062] The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.

Claims

1. A method for constructing a prompt word model to generate a work order data analysis report, characterized in that, Includes the following steps: S1. Construct a data analysis report prompt word graph model: Obtain the raw data of the power work order and store it in a relational database. According to the writing specifications of the power work order data analysis report, create multi-type nodes with corresponding report structure and analysis logic in the Neo4j graph database, and establish the relationship between nodes to form a complete prompt word graph model. Extract the corresponding content from the prompt word graph model through Cypher graph query statements, and assemble it into a complete prompt word containing task instructions, alignment prompts, and input prompts. The prompt word integrates dynamically adjustable SQL query statements. S2. Dynamic alignment generation during the decoding stage: During the decoding stage of the large language model generating a report based on the prompt words, the DeAL framework is introduced to construct a dynamic alignment strategy. At each decoding step, the comprehensive score is calculated from the top-k candidate generation actions output by the large model through the action selection function, and the candidate action with the highest comprehensive score is selected as the generation action for the current step. S3 Constructing a comprehensive multi-objective reward function: Design a comprehensive reward function that integrates consistency, content quality, and language professionalism. Use this comprehensive reward function as a heuristic function for the action selection function in step S2 to evaluate the alignment effect of candidate generation paths in real time and guide the generation path selection of the large model.

2. The method for constructing a prompt word model for generating a work order data analysis report according to claim 1, characterized in that, In step S1, the multiple types of nodes include document nodes, chapter nodes, subsection nodes, analysis task nodes, analysis dimension nodes, and SQL method nodes; the relationships between the nodes include the "contains chapter" relationship between document nodes and chapter nodes, the "contains subsection" relationship between chapter nodes and subsection nodes, the "contains analysis" relationship between subsection nodes and analysis task nodes, the "corresponds to dimension" relationship between analysis task nodes and analysis dimension nodes, and the "call query" relationship between analysis dimension nodes and SQL method nodes.

3. The method for constructing a prompt word model for generating a work order data analysis report according to claim 1, characterized in that, In step S1, the task instruction of the prompt word is used to define the core task of text generation of the large language model, the alignment prompt is used to define the format, constraints and alignment target that the generated content must meet, and the input prompt is used to input the power work ticket data context that the large model needs to process. Dynamic adjustment of SQL query statements, including the introduction of filtering parameters such as time range, site range, and work order type, to achieve targeted query and analysis of power work order data under corresponding dimensions.

4. The method for constructing a prompt word model for generating a work order data analysis report according to claim 1, characterized in that, In step S2, the expression for the action selection function is: ; in: This represents the text fragment generated in the current step; It is the generation probability based on a large language model, representing the generated text sequence given the prompt word p. The logarithm of the probability; is a hyperparameter used to balance the impact of generation probability and alignment reward; l represents the look-ahead length, which determines how many words the model will look ahead to assist in decision-making; It is a heuristic function used to evaluate whether candidate paths meet the alignment target.

5. The method for constructing a prompt word model for generating a work order data analysis report according to claim 4, characterized in that, The expression for the comprehensive reward function is: ; in: For consistent reward function, For content quality reward function, A reward function for language expertise; , , Let be the weight coefficients of the corresponding reward function, and satisfy . =1, used to balance the importance of different alignment targets.

6. The method for constructing a prompt word model for generating a work order data analysis report according to claim 5, characterized in that, The consistency reward function The expression used to assess the consistency of format and style in generated reports is: ; Where y is the content of the generated report; These are two adjacent paragraphs in the report; K is the number of paragraphs. This is a style similarity function.

7. A method for constructing a prompt word model for generating a work order data analysis report as described in claim 5, characterized in that, The content quality reward function The expression used to evaluate the overall content quality of the generated report is: ; in, It is the p-th quality standard, including language fluency, logical coherence, data accuracy, and formatting standardization; P is the total number of quality standards. It is a quality scoring function used to evaluate the score of the generated content on each quality standard. It uses BERTScore to calculate the degree of matching between the generated content and the standard reference report text to obtain the corresponding quality score.

8. The method for constructing a prompt word model for generating a work order data analysis report according to claim 5, characterized in that, The language proficiency reward function (y) is used to assess the power industry-specific suitability of the generated report, and its expression is: ; in, It is the t-th sentence or paragraph in the report; T is the total number of sentences or paragraphs. It is a language professionalism scoring function that evaluates the language professionalism of each sentence or paragraph; it calculates the professionalism score by combining the professional terminology coverage of the corresponding sentence or paragraph with TF-IDF weights through a pre-built glossary of professional terms in the power industry.

9. The method for constructing a prompt word model for generating a work order data analysis report according to claim 1, characterized in that, In step S1, the original data of the power work order includes the work type code, specific site, work order type, work order number, work content, work supervisor information, number of people in the work shift, work order permit time, and work order planned completion time. The relational database is a MySQL database.

10. The method for constructing a prompt word model for generating a work order data analysis report according to claim 1, characterized in that, It also includes dynamic updating and expansion steps for the prompt word graph model: based on the new analysis requirements, add corresponding nodes in the graph database, adjust the relationships between nodes, or add analysis dimensions and analysis task nodes to realize the dynamic iteration of the prompt word graph model and adapt to different power work ticket analysis report generation requirements.