Power data analysis method and device based on hierarchical query generator, terminal equipment and storage medium

By using a hierarchical query generator approach, power business requirements are automatically decomposed into executable sub-problems and queried, solving the problem of low efficiency in power data analysis in existing technologies and achieving efficient power data analysis.

CN121144342APending Publication Date: 2025-12-16POWER DISPATCHING CONTROL CENT OF GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511290174.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Existing power data analysis methods rely on manual simple searches or basic aggregation operations on single tables, resulting in slow data analysis efficiency.

Method used

A hierarchical query generator-based approach is adopted. By obtaining the power business requirements and database description information input by the user, a high-level generator is used to generate high-level questions, and a low-level generator is used to decompose them into executable sub-questions. Combined with the database structure information, queries are performed to generate a power data analysis report.

Benefits of technology

It enables the automatic generation of power data analysis reports without the need for manual SQL statement writing, significantly improving data analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144342A_ABST
    Figure CN121144342A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power data analysis method and device based on a hierarchical query generator, terminal equipment and a storage medium, and belongs to the technical field of electric power data analys.The method comprises the steps that electric power business requirements input by a user and database description information and database structure information of a preset electric power database are obtained; generating a power business sub-problem according to the power business demand, the database description information, the database structure information, a preset low-level generator and a preset high-level generator; according to the power business sub-problems, querying a power problem query result corresponding to each power business sub-problem from a preset power database; and finally, generating an electric power data analysis report corresponding to the electric power business demand according to an electric power problem query result. By implementing the method and the device, the problem of relatively low data analysis efficiency of a data analysis method for performing simple retrieval or basic aggregation operation on a single table depending on manual work in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power data analysis technology, and in particular to a power data analysis method, apparatus, terminal equipment, and storage medium based on a hierarchical query generator. Background Technology

[0002] Database-driven analytics technologies in the power sector primarily include traditional database queries, specialized power management systems, and some intelligent auxiliary analysis tools. Currently, the power industry widely uses relational database management systems to store operational data, including equipment parameters, operating status, and historical records.

[0003] Traditional power data analysis methods rely on professionals extracting data from various business systems, including SCADA system data, power grid equipment parameters, and load forecasting data. They then write complex SQL queries and manually analyze and organize the results. However, this data analysis method often depends on manual simple table searches or basic aggregation operations, resulting in slow data analysis efficiency. Summary of the Invention

[0004] This invention provides a power data analysis method, apparatus, terminal device, and storage medium based on a hierarchical query generator, which can solve the problem of slow data analysis efficiency in existing data analysis methods that rely on manual simple retrieval or basic aggregation operations on a single table.

[0005] An embodiment of the present invention provides a power data analysis method based on a hierarchical query generator, comprising:

[0006] Obtain user-inputted power service requirements, database description information of the preset power database, and database structure information;

[0007] Input the above power business requirements and database description information into the preset high-level generator to generate several high-level questions for power business queries corresponding to the above power business requirements.

[0008] Based on the above database description information, database structure information, high-level questions for power business queries, and preset low-level generators, the power business sub-questions corresponding to each high-level question for power business queries are obtained.

[0009] Based on the above power business sub-problems, the power problem query results corresponding to each power business sub-problem are obtained from the above-preset power database;

[0010] Based on the above power issue query results, generate a power data analysis report corresponding to the above power business requirements.

[0011] Furthermore, based on the aforementioned database description information, database structure information, high-level power business query questions, and preset low-level generators, the power business sub-questions corresponding to each high-level power business query question are obtained, including:

[0012] The database description information, database structure information, and the high-level question of the power business query are input into the preset low-level generator so that the preset low-level generator decomposes the high-level question of the power business query into several original power business sub-questions.

[0013] Based on the aforementioned original power business sub-problems and the aforementioned database structure information, executable power business sub-problems are identified.

[0014] Furthermore, based on the aforementioned original power business sub-problems and the aforementioned database structure information, the executable power business sub-problems identified include:

[0015] The original power business sub-problems described above are transformed to obtain the sub-problem feature vectors corresponding to the original power business sub-problems.

[0016] For each sub-problem feature vector, calculate the similarity between the sub-problem feature vector and each structural information clause in the database structure information.

[0017] From all similarities, determine the maximum similarity of the feature vectors of each sub-problem, and select the feature vectors of the sub-problems whose maximum similarity is greater than a preset similarity threshold as the selected feature vectors of the sub-problems.

[0018] The original power business sub-problems corresponding to the feature vectors of the selected sub-problems are taken as executable power business sub-problems.

[0019] Furthermore, based on the aforementioned sub-problems in the power business, the power problem query results corresponding to each sub-problem are obtained from the aforementioned preset power database, including:

[0020] Based on the above power business sub-problems, database description information, and database structure information, the above power business sub-problems are transformed into sub-problem query statements;

[0021] The corresponding power problem query results are obtained by querying the preset power database using the above sub-question query statement.

[0022] Furthermore, based on the above-mentioned electricity problem query results, a power data analysis report corresponding to the above-mentioned electricity business needs is generated, including:

[0023] Input the above power problem query results and preset prompt words into the preset large language model to generate the above power business requirements initial power analysis report;

[0024] Repeat the report update operation until the illusion score function value of the current power data analysis report is not less than the preset function threshold or the number of updates is not less than the preset maximum number of updates threshold, and then use the current power analysis report as the aforementioned power data analysis report.

[0025] The aforementioned report update operations include:

[0026] Obtain the current power analysis report; the initial power analysis report is the aforementioned initial power analysis report.

[0027] Extract the current report analysis results for each sub-issue of the power business from the current power analysis report;

[0028] Based on the current report analysis results and the above-mentioned electricity problem query results, the current hallucination rating function value is calculated;

[0029] If the current hallucination score function value is less than the preset function threshold, and the current update count is less than the preset maximum update count threshold, then the current power analysis report will be updated based on the current report analysis results and the above power problem query results.

[0030] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments;

[0031] This invention provides a power data analysis device based on a hierarchical query generator, comprising:

[0032] The system includes a data acquisition module, a high-level question generation module, a sub-question generation module, a sub-question query module, and a report generation module.

[0033] The aforementioned data acquisition module is used to acquire the user's input of electricity service requirements, the database description information of the preset electricity database, and the database structure information;

[0034] The aforementioned high-level question generation module is used to input the aforementioned power business requirements and database description information into a preset high-level generator to generate several high-level questions for power business queries corresponding to the aforementioned power business requirements.

[0035] The aforementioned sub-problem generation module is used to obtain the power business sub-problem corresponding to each power business query high-level question based on the aforementioned database description information, database structure information, power business query high-level question and preset low-level generator.

[0036] The aforementioned sub-problem query module is used to query the power problem query results corresponding to each power business sub-problem from the aforementioned preset power database based on the aforementioned power business sub-problems;

[0037] The aforementioned report generation module is used to generate power data analysis reports corresponding to the aforementioned power business needs based on the results of the aforementioned power issue query.

[0038] Furthermore, the aforementioned sub-problem generation module includes:

[0039] Sub-problem decomposition unit and sub-problem determination unit;

[0040] The aforementioned sub-problem decomposition unit is used to input the aforementioned database description information, database structure information, and the aforementioned high-level power business query problem into a preset low-level generator, so that the preset low-level generator decomposes the aforementioned high-level power business query problem into several original power business sub-problems.

[0041] The aforementioned sub-problem determination unit is used to determine the executable power business sub-problem based on the aforementioned original power business sub-problem and the aforementioned database structure information.

[0042] Furthermore, the aforementioned sub-problem determination unit includes:

[0043] Feature vector transformation subunit, similarity calculation subunit, feature vector selection subunit for sub-problems, and sub-problem filtering subunit;

[0044] The aforementioned feature vector transformation subunit is used to transform the features of the original power business sub-problem to obtain the sub-problem feature vector corresponding to the original power business sub-problem.

[0045] The aforementioned similarity calculation subunit is used to calculate the similarity between the feature vector of each sub-problem and each structural information clause in the aforementioned database structural information for each sub-problem feature vector.

[0046] The aforementioned selected sub-problem feature vector sub-unit is used to determine the maximum similarity of each sub-problem feature vector from all similarities, and to take the sub-problem feature vector with the maximum similarity greater than the preset similarity threshold as the selected sub-problem feature vector;

[0047] The aforementioned sub-problem filtering sub-unit is used to select the original power business sub-problems corresponding to the feature vectors of the selected sub-problems as executable power business sub-problems.

[0048] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment;

[0049] The present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power data analysis method based on a hierarchical query generator described in any embodiment of the present invention.

[0050] Based on the above method embodiments, the present invention provides a corresponding storage medium embodiment;

[0051] The present invention provides a storage medium including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power data analysis method based on a hierarchical query generator described in any embodiment of the present invention.

[0052] The embodiments of the present invention have the following beneficial effects:

[0053] This invention provides a power data analysis method, apparatus, terminal device, and storage medium based on a hierarchical query generator. The method includes: acquiring user-input power service requirements, database description information of a preset power database, and database structure information; then inputting the power service requirements and database description information into a preset high-level generator to generate several high-level power service query questions corresponding to the power service requirements; then, based on the database description information, database structure information, high-level power service query questions, and the preset low-level generator, obtaining power service sub-questions corresponding to each high-level power service query question; querying the preset power database to obtain power problem query results corresponding to each power service sub-question based on the power service sub-questions; finally, generating a power data analysis report corresponding to the power service requirements based on the power problem query results. Therefore, this invention automatically generates a power data analysis report by breaking down the user's power service requirements into executable sub-questions and then automatically generating the power data analysis report based on the results of these sub-questions. The entire process does not require manual SQL statement writing for related queries and data analysis, thus greatly improving data analysis efficiency. Attached Figure Description

[0054] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0055] Figure 1This is a flowchart illustrating a power data analysis method based on a hierarchical query generator, provided in an embodiment of the present invention.

[0056] Figure 2 This is a schematic diagram of the structure of a power data analysis device based on a hierarchical query generator provided in an embodiment of the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0059] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0060] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0061] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0062] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0063] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0064] See Figure 1 To address the issue of slow data analysis efficiency in existing data analysis methods that rely on manual retrieval or basic aggregation operations on single tables, this invention provides a power data analysis method based on a hierarchical query generator, comprising:

[0065] Step S101: Obtain the user's input of electricity service requirements, the database description information of the preset electricity database, and the database structure information;

[0066] Specifically, the power service requirements input by the user are macro-level power service requirements provided by the user, such as: analyzing the load level change characteristics of a certain region in a certain month, or analyzing whether the total output of a certain power plant meets the peak-shaving requirements during a certain period.

[0067] Specifically, if the preset power database already contains table descriptions and database structure information, it can be directly retrieved and used as the aforementioned database description information and database structure information, respectively; otherwise, a relevant large model can be used to automatically generate a supplementary description of the preset power database in conjunction with preset power neighborhood prompts, thereby obtaining the aforementioned database description information and database structure information.

[0068] Step S102: Input the above-mentioned power business requirements and database description information into the preset high-level generator to generate several high-level power business query questions corresponding to the above-mentioned power business requirements.

[0069] Specifically, the aforementioned preset high-level generator generates several business query requirements based on the user's macro-level business needs and database description information, namely the aforementioned high-level power business query questions. The core functionality of the preset high-level generator is represented by the following function:

[0070] HL-G(Q0,short(D info ))→h1,h2,...,hk

[0071] In the formula, HL-G represents the preset high-rise generator, Q0 represents the power business demand, and D... info Represents database description information, short(D info () represents the simplified database description information, h1, h2, ..., h k This indicates that inquiries about high-level matters are being made by various power-related business departments.

[0072] Preferably, the preset high-level generator generates several high-level power business query questions from a more global perspective by controlling the amount of detailed information input from the power database.

[0073] Step S103: Based on the above database description information, database structure information, high-level questions for power business queries, and preset low-level generators, obtain the power business sub-questions corresponding to each high-level question for power business queries;

[0074] Preferably, the low-level generator further decomposes high-level power business query problems into sub-problems that can be directly executed by SQL statements, making complex power system analysis tasks more systematic and operable, and realizing the decomposition and transformation from macro-analysis requirements to specific executable problems.

[0075] In a preferred embodiment, the process of obtaining the power business sub-problem corresponding to each power business query high-level problem based on the aforementioned database description information, database structure information, high-level power business query problem, and preset low-level generator includes:

[0076] The database description information, database structure information, and the high-level question of the power business query are input into the preset low-level generator so that the preset low-level generator decomposes the high-level question of the power business query into several original power business sub-questions.

[0077] Specifically, the preset low-level generator is used to decompose high-level problems into subproblems, and its function is represented as follows:

[0078] LL-G(h i D info D schema )→s i1 ,…,s ik

[0079] In the formula, LL-G represents the preset low-level generator, and D schema Represents database structure information, s i1 ,…,s ik This indicates a high-level inquiry regarding power business. i The various sub-problems of the power business are natural language texts that can be directly converted into SQL statements.

[0080] Based on the aforementioned original power business sub-problems and the aforementioned database structure information, executable power business sub-problems are identified.

[0081] Preferably, the aforementioned preset low-level generator ensures that the generated sub-problems can be directly mapped to specific data tables and fields by introducing complete database descriptions and structural information, thus laying the foundation for the generation of subsequent SQL statements.

[0082] In this preferred embodiment, a low-level generator is used to break down the high-level problem of power business query into power business sub-problems.

[0083] In another preferred embodiment, determining the executable power business sub-problem based on the original power business sub-problem and the database structure information includes:

[0084] The original power business sub-problems described above are transformed to obtain the sub-problem feature vectors corresponding to the original power business sub-problems.

[0085] For each sub-problem feature vector, calculate the similarity between the sub-problem feature vector and each structural information clause in the database structure information.

[0086] Specifically, by calculating cosine similarity, the similarity between the feature vector of the sub-problem and each clause of the structural information in the above database structure information is obtained:

[0087]

[0088] In the formula, v(s) ik ) represents the original power business subproblem s ik The eigenvectors of the subproblem, v(e i ) represents the feature vector corresponding to the structural information clause in the i-th database structural information, e i Sim(v(s) represents the structural information clause in the i-th database structural information. ik ),v(e i )) indicates the similarity mentioned above.

[0089] From all similarities, determine the maximum similarity of the feature vectors of each sub-problem, and select the feature vectors of the sub-problems whose maximum similarity is greater than a preset similarity threshold as the selected feature vectors of the sub-problems.

[0090] Specifically, the feature vector of the selected sub-problem corresponding to the maximum similarity is determined by the following formula:

[0091]

[0092] In the formula, S(s)ik ) represents the original power business subproblem s ik The maximum similarity, where E represents the set of all structural information sentences in the database structure information.

[0093] Specifically, the executability determination function for a subproblem is constructed using the following formula: a value of 1 indicates executability, and a value of 0 indicates difficulty in execution.

[0094]

[0095] In the formula, Exec(s) ik ) represents the original power business subproblem s ik The executability determination function, where τ represents the preset similarity threshold.

[0096] The original power business sub-problems corresponding to the feature vectors of the selected sub-problems are taken as executable power business sub-problems.

[0097] Preferably, when the executability determination function value corresponding to a certain original power business sub-problem is 0, it is considered that the original power business sub-problem is difficult to execute. At this time, the original power business sub-problem can be recorded separately, and a manual correction prompt can be triggered. After the correction is made by inputting natural language, the low-level generator is used again to generate the sub-problem, thereby improving the quality of the analysis process in a closed loop.

[0098] Preferably, the feasibility of the generated original power business sub-problems is assessed based on cosine similarity, eliminating problems that are difficult to execute, improving the efficiency of subsequent analysis, and ensuring the quality of the generated power business sub-problems.

[0099] Preferably, the feature vector of the sub-problem will be matched with all the structural information clauses of the database structure information by cosine similarity to ensure that the obtained power business sub-problems are not only in line with the characteristics of the power field, but also can effectively support subsequent specific data queries and analysis.

[0100] In this preferred embodiment, an executable power business sub-problem is determined based on the original power business sub-problem and the database structure information.

[0101] Step S104: Based on the above power business sub-problems, query the power problem query results corresponding to each power business sub-problem from the above preset power database;

[0102] In another preferred embodiment, the above-mentioned method of obtaining the power problem query result corresponding to each power business sub-problem from the preset power database based on the above-mentioned power business sub-problem includes:

[0103] Based on the above power business sub-problems, database description information, and database structure information, the above power business sub-problems are transformed into sub-problem query statements;

[0104] Specifically, Chained Thinking (CoT) technology is used to enhance Text-to-SQL conversion capabilities, enabling the query agent to handle complex queries specific to the power sector:

[0105] QAgent(s ik D info D schema )→q ik

[0106] In the formula, QAgent represents the query agent, q ik Represents the sub-problem s of the power business ik The sub-question query statement is a type of SQL query statement.

[0107] Specifically, the above process first uses step-by-step reasoning to understand the query intent of the sub-problems in the power business, determines the data tables and fields involved, and then uses a query agent to construct SQL statements that conform to the characteristics of the preset power database, paying particular attention to common needs in power data analysis such as time-series data queries and multi-table joins.

[0108] The corresponding power problem query results are obtained by querying the preset power database using the above sub-question query statement.

[0109] Preferably, after obtaining the sub-question query statements, query optimization functions can be implemented based on the characteristics of power big data. This focuses on addressing issues such as time dimension optimization, table join strategies, and the use of aggregate functions in power data queries, ensuring query efficiency and accuracy when processing large-scale power data. Simultaneously, a specific caching strategy is designed to store frequently used intermediate results, reducing redundant calculations and improving overall performance.

[0110] Preferably, the text-to-SQL capability is enhanced using mind chain technology to ensure that the generated SQL query statement can accurately query the power database.

[0111] In this preferred embodiment, the query results for each power business sub-problem are obtained from a preset power database.

[0112] Step S105: Based on the above power problem query results, generate a power data analysis report corresponding to the above power business requirements.

[0113] In a preferred embodiment, generating a power data analysis report corresponding to the power service demand based on the power problem query results includes:

[0114] Input the above power problem query results and preset prompt words into the preset large language model to generate the above power business requirements initial power analysis report;

[0115] Specifically, the construction of the aforementioned preset prompts includes the following aspects: First, the text description of the prompts needs to be constructed, for example: "This invention describes an intelligent power data analysis task. You need to act as a professional power data analyst, using the given structure and content of a preset power database to generate insightful and accurate analysis reports." At the same time, the model's role, task scope, and report output format requirements should be clearly defined to ensure the standardization of the generated content. Second, since the preset large language model requires key words to activate the knowledge contained in the neural network parameters, appropriate power field terms need to be selected in the preset prompts, such as "grid load analysis," "unit output curve," and "equipment health status assessment," to ensure that the large language model's agent can accurately understand the user's analytical intent. Simultaneously, considering the special structure of the preset power database, the preset prompts need to include descriptions of inter-table relationships and typical data examples, enabling the large language model to understand how to establish connections between multiple tables and perform effective queries. Finally, adjustments need to be made promptly during testing based on the quality of the analysis reports, especially considering the unique data characteristics of the power field, such as temporal sequence, periodicity, and spatial correlation. By adding analysis examples with different voltage levels and scheduling levels, the adaptability of preset prompts to power scenarios is enriched. At the same time, differentiated prompt templates are designed according to different analysis task types (such as trend analysis, anomaly detection, correlation analysis, etc.) to improve the relevance of generated analysis reports.

[0116] In summary, the professional pre-defined prompts have been constructed. Before executing power data analysis tasks, the pre-defined large language model will input optimized pre-defined prompts to clarify how it understands the power database structure, analysis task objectives, and report output specifications, thereby significantly improving the accuracy and insight of power data analysis.

[0117] Specifically, the query results for power-related issues are first converted into natural language descriptions, and then an initial power analysis report is generated by combining preset prompts and a preset large language model.

[0118] verb(R i →v i

[0119]

[0120] In the formula, R i v represents the query result for the i-th electricity problem. i V represents the natural language text converted from the query result of the i-th electricity question, and V represents the set of natural language texts. (0)This indicates the initial power analysis report, summ indicates the report generation operation of the preset large language model, and verb indicates the natural language conversion operation.

[0121] Repeat the report update operation until the illusion score function value of the current power data analysis report is not less than the preset function threshold or the number of updates is not less than the preset maximum number of updates threshold, and then use the current power analysis report as the aforementioned power data analysis report.

[0122] Specifically, the report update operation is terminated if one of the following conditions is met:

[0123]

[0124] i = i max

[0125] In the formula, τ h This represents a preset function threshold to ensure that the quality of the generated power analysis report meets the set standards. max This indicates a preset maximum update threshold to prevent infinite loops.

[0126] The aforementioned report update operations include:

[0127] Obtain the current power analysis report; the initial power analysis report is the aforementioned initial power analysis report.

[0128] Extract the current report analysis results for each sub-issue of the power business from the current power analysis report;

[0129] Based on the current report analysis results and the above-mentioned electricity problem query results, the current hallucination rating function value is calculated;

[0130] Specifically, the hallucination rating function value is calculated using the following formula:

[0131]

[0132] Formula, score h (I (i) V) represents the power analysis report I obtained from the i-th update. (i) The corresponding hallucination rating function values, Precision represents precision, Recall represents recall, and F I Indicates the report's analysis results, F VThis represents the natural language text corresponding to the query results for electricity-related issues. β represents the weight, used to balance precision and recall. As β increases, the penalty for missed information by the illusion scoring function increases, and vice versa. When the weight value is 1, recall and precision are equally weighted, and the penalty for missed information is the same.

[0133] If the current hallucination score function value is less than the preset function threshold, and the current update count is less than the preset maximum update count threshold, then the current power analysis report will be updated based on the current report analysis results and the above power problem query results.

[0134] Specifically, if the current hallucination scoring function value is less than a preset function threshold, and the current update count is less than a preset maximum update count threshold, then the current report analysis result is compared with the above power problem query result. For report analysis results that are present in the current report analysis result but not in the power problem query result (i.e., the report analysis result is incorrect), they are deleted from the current power analysis report. At the same time, based on the preset large language model, the corresponding power problem query result for the deleted report analysis result is regenerated to generate the corresponding report content. For power problem query results that are missing in the current report analysis result but exist in the power problem query result (i.e., the current power analysis report omits the report analysis result corresponding to this power problem query result), the corresponding report content for this power problem query result is regenerated based on the preset large language model and added to the appropriate position in the current power analysis report. To illustrate, assume the sub-problems of the power business are A, B, C, and D, and the query results are A1, B1, C1, and D1. The current power analysis report extracts four report analysis results: A1, B1, C2, and D1. Result C2 represents an error in the power analysis report and needs to be deleted. Simultaneously, based on C1, the corresponding report content is regenerated using a pre-defined large language model to obtain an updated power analysis report. Alternatively, if the current power analysis report extracts A1, B1, and C1, it means D1 is missing. Therefore, the corresponding report content for D1 needs to be regenerated using the pre-defined large language model, and the newly generated report content is added to the appropriate position in the current power analysis report to obtain an updated power analysis report.

[0135] Specifically, if the current hallucination rating function value is less than the preset function threshold, and the current update count is less than the preset maximum update count threshold, let i = i + 1, I (i+1) =reflect(I (i) Continue with the report update operation (V).

[0136] Preferably, a cognitive self-calibration mechanism is used to iteratively correct report content, eliminating potential misleading information and ensuring consistency between the report and actual data. The analysis level is dynamically adjusted according to the needs of different dispatching perspectives, enabling the report to provide both macro-level analysis and focus on micro-level issues. The report structure and presentation are optimized to ensure concise and clear content, highlighting key power analysis results and supporting data to provide a reliable basis for dispatching decisions.

[0137] In this preferred embodiment, the report is continuously updated based on the results of the power problem query, generating a power data analysis report corresponding to the power business needs.

[0138] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.

[0139] like Figure 2 As shown, an embodiment of the present invention provides a power data analysis device based on a hierarchical query generator, comprising:

[0140] The system includes a data acquisition module, a high-level question generation module, a sub-question generation module, a sub-question query module, and a report generation module.

[0141] The aforementioned data acquisition module is used to acquire the user's input of electricity service requirements, the database description information of the preset electricity database, and the database structure information;

[0142] The aforementioned high-level question generation module is used to input the aforementioned power business requirements and database description information into a preset high-level generator to generate several high-level questions for power business queries corresponding to the aforementioned power business requirements.

[0143] The aforementioned sub-problem generation module is used to obtain the power business sub-problem corresponding to each power business query high-level question based on the aforementioned database description information, database structure information, power business query high-level question and preset low-level generator.

[0144] The aforementioned sub-problem query module is used to query the power problem query results corresponding to each power business sub-problem from the aforementioned preset power database based on the aforementioned power business sub-problems;

[0145] The aforementioned report generation module is used to generate power data analysis reports corresponding to the aforementioned power business needs based on the results of the aforementioned power issue query.

[0146] In a preferred embodiment, the above-mentioned sub-problem generation module includes:

[0147] Sub-problem decomposition unit and sub-problem determination unit;

[0148] The aforementioned sub-problem decomposition unit is used to input the aforementioned database description information, database structure information, and the aforementioned high-level power business query problem into a preset low-level generator, so that the preset low-level generator decomposes the aforementioned high-level power business query problem into several original power business sub-problems.

[0149] The aforementioned sub-problem determination unit is used to determine the executable power business sub-problem based on the aforementioned original power business sub-problem and the aforementioned database structure information.

[0150] In another preferred embodiment, the sub-problem determination unit includes:

[0151] Feature vector transformation subunit, similarity calculation subunit, feature vector selection subunit for sub-problems, and sub-problem filtering subunit;

[0152] The aforementioned feature vector transformation subunit is used to transform the features of the original power business sub-problem to obtain the sub-problem feature vector corresponding to the original power business sub-problem.

[0153] The aforementioned similarity calculation subunit is used to calculate the similarity between the feature vector of each sub-problem and each structural information clause in the aforementioned database structural information for each sub-problem feature vector.

[0154] The aforementioned selected sub-problem feature vector sub-unit is used to determine the maximum similarity of each sub-problem feature vector from all similarities, and to take the sub-problem feature vector with the maximum similarity greater than the preset similarity threshold as the selected sub-problem feature vector;

[0155] The aforementioned sub-problem filtering sub-unit is used to select the original power business sub-problems corresponding to the feature vectors of the selected sub-problems as executable power business sub-problems.

[0156] It should be noted that the device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort. The above schematic diagrams are merely examples of a power data analysis device based on a hierarchical query generator and do not constitute a limitation on a power data analysis device based on a hierarchical query generator. It may include more or fewer components than illustrated, or combine certain components, or use different components.

[0157] Based on the above method embodiments, the present invention provides corresponding terminal device embodiments.

[0158] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power data analysis method based on a hierarchical query generator described in any embodiment of the present invention.

[0159] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the device.

[0160] The aforementioned terminal devices can be computing devices such as desktop computers, laptops, handheld computers, and cloud servers. These devices may include, but are not limited to, processors and memory.

[0161] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the device, connecting various parts of the device via various interfaces and lines.

[0162] The aforementioned memory can be used to store the aforementioned computer programs and / or modules. The aforementioned processor implements various functions of the aforementioned device by running or executing the computer programs and / or modules stored in the aforementioned memory, and by calling data stored in the memory. The aforementioned memory may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0163] Based on the above method embodiments, the present invention provides corresponding storage medium embodiments.

[0164] Another embodiment of the present invention provides a storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute the power data analysis method based on a hierarchical query generator described in any embodiment of the present invention.

[0165] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0166] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A power data analysis method based on a hierarchical query generator, characterized in that, include: Obtain user-inputted power service requirements, database description information of the preset power database, and database structure information; Input the power service requirements and database description information into a preset high-level generator to generate several high-level power service query questions corresponding to the power service requirements. Based on the database description information, database structure information, high-level questions for power business queries, and a preset low-level generator, the power business sub-question corresponding to each high-level question for power business queries is obtained. Based on the power business sub-problem, the power problem query result corresponding to each power business sub-problem is obtained from the preset power database; Based on the results of the power issue query, a power data analysis report corresponding to the power business requirements is generated.

2. The power data analysis method based on a hierarchical query generator according to claim 1, characterized in that, The process of obtaining the power business sub-problems corresponding to each high-level power business query problem based on the database description information, database structure information, high-level power business query problems, and a preset low-level generator includes: The database description information, database structure information, and the high-level question of the power business query are input into a preset low-level generator so that the preset low-level generator decomposes the high-level question of the power business query into several original power business sub-questions. Based on the original power business sub-problem and the database structure information, an executable power business sub-problem is determined.

3. The power data analysis method based on a hierarchical query generator according to claim 2, characterized in that, The step of determining the executable power business sub-problem based on the original power business sub-problem and the database structure information includes: The original power business sub-problem is transformed to obtain the sub-problem feature vector corresponding to the original power business sub-problem; For each sub-problem feature vector, calculate the similarity between the sub-problem feature vector and each structural information clause in the database structural information; From all similarities, determine the maximum similarity of the feature vectors of each sub-problem, and select the feature vectors of the sub-problems whose maximum similarity is greater than a preset similarity threshold as the selected feature vectors of the sub-problems. The original power business sub-problem corresponding to the selected sub-problem feature vector is taken as the executable power business sub-problem.

4. The power data analysis method based on a hierarchical query generator according to claim 3, characterized in that, The step of retrieving the power problem query result corresponding to each power business sub-problem from the preset power database based on the power business sub-problem includes: Based on the power business sub-problem, database description information, and database structure information, the power business sub-problem is transformed into a sub-problem query statement; The corresponding power problem query results are obtained from the preset power database by querying the sub-question query statement.

5. The power data analysis method based on a hierarchical query generator according to claim 4, characterized in that, The step of generating a power data analysis report corresponding to the power business demand based on the power problem query results includes: The query results for the power problem and the preset prompt words are input into a preset large language model to generate an initial power analysis report for the power business requirements; Repeat the report update operation until the illusion score function value of the current power data analysis report is not less than the preset function threshold or the number of updates is not less than the preset maximum number of updates threshold, and then use the current power analysis report as the power data analysis report; The report update operation includes: Obtain the current power analysis report; wherein, the initial power analysis report is the initial power analysis report; Extract the current report analysis results for each sub-issue of the power business from the current power analysis report; Based on the current report analysis results and the power issue query results, the current hallucination rating function value is calculated; If the current hallucination rating function value is less than the preset function threshold, and the current update count is less than the preset maximum update count threshold, then the current power analysis report will be updated based on the current report analysis results and the power problem query results.

6. A power data analysis device based on a hierarchical query generator, characterized in that, include: The system includes a data acquisition module, a high-level question generation module, a sub-question generation module, a sub-question query module, and a report generation module. The data acquisition module is used to acquire the user's input power service requirements, the database description information of the preset power database, and the database structure information; The high-level question generation module is used to input the power business requirements and database description information into a preset high-level generator to generate several high-level questions for power business queries corresponding to the power business requirements. The sub-problem generation module is used to obtain the power business sub-problem corresponding to each power business query high-level question based on the database description information, database structure information, high-level power business query questions, and a preset low-level generator. The sub-problem query module is used to query the preset power database to obtain the power problem query result corresponding to each power business sub-problem based on the power business sub-problem; The report generation module is used to generate a power data analysis report corresponding to the power business requirements based on the power problem query results.

7. The power data analysis device based on a hierarchical query generator according to claim 6, characterized in that, The sub-problem generation module includes: Sub-problem decomposition unit and sub-problem determination unit; The sub-problem decomposition unit is used to input the database description information, database structure information and the high-level problem of power business query into a preset low-level generator, so that the preset low-level generator decomposes the high-level problem of power business query into several original power business sub-problems. The sub-problem determination unit is used to determine an executable power business sub-problem based on the original power business sub-problem and the database structure information.

8. The power data analysis device based on a hierarchical query generator according to claim 7, characterized in that, The sub-problem determination unit includes: Feature vector transformation subunit, similarity calculation subunit, feature vector selection subunit for sub-problems, and sub-problem filtering subunit; The feature vector transformation subunit is used to transform the original power business sub-problem to obtain the sub-problem feature vector corresponding to the original power business sub-problem. The similarity calculation subunit is used to calculate the similarity between the feature vector of each sub-problem and each structural information clause in the database structural information for each sub-problem feature vector. The selected sub-problem feature vector sub-unit is used to determine the maximum similarity of each sub-problem feature vector from all similarities, and to take the sub-problem feature vector with the maximum similarity greater than a preset similarity threshold as the selected sub-problem feature vector. The sub-problem filtering sub-unit is used to select the original power business sub-problems corresponding to the selected sub-problem feature vectors as executable power business sub-problems.

9. A terminal device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a power data analysis method based on a hierarchical query generator as described in any one of claims 1 to 5.

10. A storage medium, characterized in that, The storage medium includes a stored computer program, wherein, when the computer program is running, it controls the device where the storage medium is located to execute a power data analysis method based on a hierarchical query generator as described in any one of claims 1 to 5.