Electric power large language model long-chain reasoning optimization method and related device

By dynamically adjusting the inference boundary of the power big language model and combining probability thresholds and reinforcement learning models, the problem of fixed boundary constraints is solved, improving the depth and accuracy of long-chain inference in power systems and adapting to the needs of complex power tasks.

CN121745288APending Publication Date: 2026-03-27CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing long-chain inference models are limited by fixed inference boundaries, making it difficult to cope with complex scenarios such as diagnosing cascading faults in power systems. This results in limited inference capabilities, making it difficult to expand the depth of analysis based on real-time inference status, and often causing key causal chains to be missed due to premature termination of inference.

Method used

By acquiring the complexity of the power task at the current inference step, and using a pre-trained probability threshold model and an extended inference direction reinforcement learning model, the inference boundary is dynamically adjusted. Combined with power task feature data and category encoding, the power big language model is guided to extend or stop inference.

Benefits of technology

It achieves dynamic reasoning boundary control, enhances the reasoning depth and breadth of the power big language model, improves the accuracy and success rate of reasoning results, and can explore more potential paths in complex and ever-changing power tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121745288A_ABST
    Figure CN121745288A_ABST
Patent Text Reader

Abstract

The invention belongs to the crossing field of artificial intelligence and electric power systems, and discloses an electric power large language model long-chain reasoning optimization method and related device.The method comprises the steps that firstly, the complexity of an electric power task in the current reasoning step is obtained, a pre-trained probability threshold model is input to obtain an extended reasoning probability, and according to the comparison result of the probability and a preset threshold value, the probability is calculated; and whether to continue to expand reasoning or stop reasoning is adaptively judged, so that intelligent control of reasoning boundaries is realized, and the problem of limited reasoning capability caused by fixed boundaries is effectively solved. And in the extension stage, a pre-trained reinforcement learning model is utilized, an optimal extension direction is generated according to the complexity of the power task in the current reasoning step, and a direction is provided for subsequent reasoning operation of the model. Through the combination of dynamic boundary control and direction guidance, the reasoning depth and breadth of an electric power large language model for coping with complex tasks are significantly enhanced, the path exploration capability and the result accuracy are improved, and the intelligent analysis requirements of electric power scenes such as fault diagnosis and scheduling decision are effectively supported.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the cross field of artificial intelligence and power system, and relates to a power large language model long chain reasoning optimization method and a related device. BACKGROUND

[0002] With the in-depth development of artificial intelligence technology, long chain logical reasoning capability has become a core challenge of complex decision-making tasks. In the fields of power system fault analysis, medical intelligent diagnosis, and logistics path planning, multi-step causal reasoning demand grows exponentially. Extensive research has been carried out around long chain thinking chain reasoning technology, forming technical routes such as reasoning framework based on reinforcement learning, hierarchical planning model, and neural-symbolic logic system. However, the existing methods still have significant limitations in dynamic reasoning boundary control.

[0003] At present, the existing long chain reasoning model generally adopts a fixed reasoning boundary design, such as a predefined maximum reasoning step number or a fixed search range. This rigid constraint leads to limited reasoning capability when facing complex scenarios such as power system cascading failure diagnosis, and it is difficult to cope with changing reasoning requirements, difficult to expand the analysis depth according to real-time reasoning state, and often misses key causal chains due to premature termination of reasoning. For example, the IEEE (Institute of Electrical and Electronics Engineers) standard fault diagnosis algorithm significantly reduces the reasoning accuracy when dealing with more than three cascading failures, exposing the limitations of the fixed boundary. SUMMARY

[0004] The purpose of the present application is to overcome the shortcomings of the prior art and provide a power large language model long chain reasoning optimization method and a related device.

[0005] To achieve the above purpose, the following technical solutions are adopted: In a first aspect, the present application provides a power large language model long chain reasoning optimization method, comprising: obtaining the complexity of a power task at a current reasoning step; obtaining an expansion reasoning probability at the current reasoning step through a pre-trained probability threshold model according to the complexity of the power task at the current reasoning step; when the expansion reasoning probability is greater than a preset expansion reasoning probability threshold, obtaining an expansion reasoning direction through a pre-trained expansion reasoning direction reinforcement learning model according to the complexity of the power task at the current reasoning step and sending the expansion reasoning direction to a power large language model for guiding the power large language model to perform a next reasoning step; and when the expansion reasoning probability is not greater than the preset expansion reasoning probability threshold, generating stop information and sending the stop information to the power large language model for guiding the power large language model to stop long chain reasoning.

[0006] Optionally, obtaining the complexity of the power task under the current inference step includes: obtaining the power task feature data and the power task category code; obtaining the number of steps in the current inference step; and extracting the features of the power task feature data after the number of iterations of the gated graph neural network, obtaining the extracted features and concatenating them with the power task category code to obtain the complexity of the power task under the current inference step.

[0007] Optionally, the probability threshold model is constructed based on a logistic regression model.

[0008] Optionally, the extended inference probability threshold is determined as follows: based on a preset initial extended inference probability threshold, the current extended inference probability threshold is obtained using the following formula:

[0009] in, The current extended inference probability threshold, This is the probability threshold for the previous extended inference. This represents the historical extended success rate based on a sliding window statistic of inference steps.

[0010] Optionally, the extended inference direction reinforcement learning model is constructed based on a deep double Q network; the reward function of the extended inference direction reinforcement learning model is:

[0011] in, For the total reward, This represents the total number of reasoning steps in long-chain reasoning. As the intermediate reward decay factor, For the first k Rewards for each reasoning step, For the final reward weight, This is the final reward.

[0012] Among them, the k Rewards for each reasoning step According to the k The final reward is obtained by calculating the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step; The results are obtained based on the final topological consistency score, task timing constraint satisfaction, and physical law matching degree of the long-chain inference.

[0013] Optionally, the topology consistency score We obtain it from the following formula:

[0014] in, This is the predicted topology matrix for the current inference step. This is the actual topological matrix.

[0015] The task timing constraint satisfaction We obtain it from the following formula:

[0016] in, The first step of the current reasoning process Predicted time series parameters for each evaluation time window, For the first The actual timing parameters for each evaluation time window To assess the total number of time windows.

[0017] The degree of matching of physical laws We obtain it from the following formula:

[0018] in, For the current reasoning step, the first Theoretical injection power of each node, For the first The actual injected power of each node To tolerate error, The total number of nodes. For indicator functions, when When satisfied If it is 1, otherwise, It is 0.

[0019] Optionally, the first k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are obtained, including: when the first... k When the first reasoning step does not involve preset key power grid equipment, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are superimposed; when the first inference step... k When a predetermined key power grid device is involved in a reasoning step, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are summed and multiplied by a preset key weight; where the key weight is greater than 1; when the first inference step... k When the physical law matching degree of the first reasoning step is less than the preset physical law matching degree threshold, the long-chain reasoning optimization is terminated and the first step is...k Rewards for each reasoning step Set to the default negative reward.

[0020] Optionally, the extended reasoning direction includes deepening, branching, and backtracking; when the extended reasoning direction is backtracking, it further includes: obtaining the current reasoning chain of the long-chain reasoning of the power big language model, and constructing a directed acyclic graph with the reasoning steps in the current reasoning chain as nodes and the logical dependencies between nodes as edge weights to obtain an initial thought chain graph; using the Monte Carlo dropout method to obtain the confidence of each node in the initial thought chain graph, and updating the edge weights of the edges associated with nodes in the initial thought chain graph that have a confidence lower than a first preset confidence threshold based on the backpropagation optimization algorithm to obtain an updated thought chain graph; using the Monte Carlo dropout method to obtain each node in the updated thought chain graph. The system calculates the confidence level of the target node and identifies nodes in the updated mind graph whose confidence level is less than a second pre-set confidence threshold. Based on a pre-defined power knowledge graph, it obtains several candidate alternative reasoning steps for the target node. According to the updated mind graph and the power task category encoding, a pre-trained alternative branch selection reinforcement learning model is used to select the optimal alternative reasoning branch for the target node from several candidate alternative reasoning branches. This optimal alternative reasoning branch is then used to replace the target node, resulting in an optimized mind graph. Finally, an optimized reasoning chain is obtained from the optimized mind graph and sent to the power big language model to guide it in reasoning based on the optimized reasoning chain.

[0021] Optionally, using the logical dependencies between nodes as edge weights includes obtaining the edge weights using the following formula:

[0022] in, For nodes j With nodes i edge weights, For nodes i Embedded vector, For nodes j The embedding vector.

[0023] The edge weights associated with nodes whose confidence levels are below a first preset confidence threshold in the initial thought graph are updated using the backpropagation optimization algorithm, including: obtaining the updated edge weight values ​​using the following formula:

[0024]

[0025] in, For nodes j With nodes i The edge weights are updated. For learning rate, Let be the error function. For nodes j With nodes i edge weights, For nodes j Confidence level, This refers to the set of nodes whose confidence level is less than a first preset confidence threshold. For nodes The confidence level; Updated to and The sum of values.

[0026] Optionally, it also includes: obtaining the extended inference probability of each inference step in the inference chain of the long-chain inference of the power big language model, and displaying the extended inference probability of each inference step in the form of a heatmap; visually displaying the initial mind chain diagram, the updated mind chain diagram and the optimized mind chain diagram, and visually displaying several candidate alternative inference steps for the target node in the updated mind chain diagram.

[0027] Optionally, before obtaining the complexity of the power task under the current inference step, the method further includes: obtaining the Kirchhoff's law constraint value and the device parameter boundary verification value of the current inference step; when at least one of the Kirchhoff's law constraint value and the device parameter boundary verification value of the current inference step does not meet the preset requirements, the physical verification of the current inference step fails, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference; when both the Kirchhoff's law constraint value and the device parameter boundary verification value of the current inference step meet the preset requirements, the subsequent steps continue.

[0028] In a second aspect, the present invention provides a long-chain inference optimization system for a power big language model, comprising: a data acquisition module for acquiring the complexity of a power task in the current inference step; an expansion probability module for obtaining an expansion inference probability in the current inference step based on the complexity of the power task in the current inference step using a pre-trained probability threshold model; an expansion control module for obtaining an expansion inference direction based on the complexity of the power task in the current inference step using a pre-trained expansion inference direction reinforcement learning model when the expansion inference probability is greater than a preset expansion inference probability threshold, and sending it to the power big language model to guide the power big language model to proceed to the next inference step; and a stop control module for generating a stop message and sending it to the power big language model when the expansion inference probability is not greater than a preset expansion inference probability threshold, to guide the power big language model to stop long-chain inference.

[0029] Optionally, the data acquisition module is specifically used to: acquire power task feature data and power task category code of the power task; acquire the number of steps in the current inference step; and extract the features of the power task feature data after the number of iterations based on the gated graph neural network, obtain the extracted features and concatenate them with the power task category code to obtain the complexity of the power task in the current inference step.

[0030] Optionally, the probability threshold model is constructed based on a logistic regression model.

[0031] Optionally, the extended inference probability threshold is determined as follows: based on a preset initial extended inference probability threshold, the current extended inference probability threshold is obtained using the following formula:

[0032] in, The current extended inference probability threshold, This is the probability threshold for the previous extended inference. This represents the historical extended success rate based on a sliding window statistic of inference steps.

[0033] Optionally, the extended inference direction reinforcement learning model is constructed based on a deep double Q network; the reward function of the extended inference direction reinforcement learning model is:

[0034] in, For the total reward, This represents the total number of reasoning steps in long-chain reasoning. As the intermediate reward decay factor, For the first k Rewards for each reasoning step, For the final reward weight, This is the final reward.

[0035] Among them, the k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step are used to obtain the final reward; the final reward is obtained based on the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the final long-chain reasoning.

[0036] Optionally, the topology consistency score We obtain it from the following formula:

[0037] in, This is the predicted topology matrix for the current inference step. This is the actual topological matrix.

[0038] The task timing constraint satisfaction We obtain it from the following formula:

[0039] in, The first step of the current reasoning process Predicted time series parameters for each evaluation time window, For the first The actual timing parameters for each evaluation time window To assess the total number of time windows.

[0040] The degree of matching of physical laws We obtain it from the following formula:

[0041] in, For the current reasoning step, the first Theoretical injection power of each node, For the first The actual injected power of each node To tolerate error, The total number of nodes. For indicator functions, when When satisfied If it is 1, otherwise, It is 0.

[0042] Optionally, the first k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are obtained, including: when the first... k When the first reasoning step does not involve preset key power grid equipment, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are superimposed; when the first inference step... k When a predetermined key power grid device is involved in a reasoning step, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are summed and multiplied by a preset key weight; where the key weight is greater than 1; when the first inference step... k When the physical law matching degree of the first reasoning step is less than the preset physical law matching degree threshold, the long-chain reasoning optimization is terminated and the first step is... k Rewards for each reasoning step Set to the default negative reward.

[0043] Optionally, the extended reasoning direction includes deepening, branching, and backtracking; the power large language model long-chain reasoning optimization system further includes an error correction module, which is used to: obtain the current reasoning chain of the power large language model long-chain reasoning, and construct a directed acyclic graph with the reasoning steps in the current reasoning chain as nodes and the logical dependencies between nodes as edge weights to obtain an initial thought chain graph; obtain the confidence of each node in the initial thought chain graph using the Monte Carlo dropout method, and update the edge weights of the edges associated with nodes in the initial thought chain graph that have a confidence lower than a first preset confidence threshold based on the backpropagation optimization algorithm to obtain an updated thought chain graph; obtain the confidence of each node in the initial thought chain graph using the Monte Carlo dropout method. The confidence levels of each node in the mind graph are updated, and nodes with confidence levels less than a second pre-set confidence threshold are identified as target nodes. Several candidate alternative reasoning steps for the target nodes are obtained based on a pre-set power knowledge graph. According to the updated mind graph and the power task category encoding, a pre-trained alternative branch selection reinforcement learning model is used to select the optimal alternative reasoning branch for the target node from several candidate alternative reasoning branches. This optimal alternative reasoning branch is then used to replace the target node, resulting in an optimized mind graph. An optimized reasoning chain is obtained from the optimized mind graph and sent to the power big language model to guide the model in reasoning based on the optimized reasoning chain.

[0044] Optionally, using the logical dependencies between nodes as edge weights includes obtaining the edge weights using the following formula:

[0045] in, For nodes j With nodes i edge weights, For nodes i Embedded vector, For nodes j The embedding vector.

[0046] The edge weights associated with nodes whose confidence levels are below a first preset confidence threshold in the initial thought graph are updated using the backpropagation optimization algorithm, including: obtaining the updated edge weight values ​​using the following formula:

[0047]

[0048] in, For nodes j With nodes i The edge weights are updated. For learning rate, Let be the error function. For nodes j With nodes i edge weights, For nodes j Confidence level, This refers to the set of nodes whose confidence level is less than a first preset confidence threshold. For nodes The confidence level; Updated to and The sum of values.

[0049] Optionally, a visualization module is also included, which is used to: obtain the extended inference probability of each inference step in the inference chain of the long-chain inference of the power big language model, and display the extended inference probability of each inference step in the form of a heat map; visualize the initial thought chain diagram, the updated thought chain diagram and the optimized thought chain diagram, and visualize several candidate alternative inference steps of the target node in the updated thought chain diagram.

[0050] Optionally, the data acquisition module is further configured to: acquire Kirchhoff's law constraint values ​​and equipment parameter boundary verification values ​​for the current inference step before acquiring the complexity of the power task under the current inference step; when at least one of the Kirchhoff's law constraint values ​​and equipment parameter boundary verification values ​​for the current inference step does not meet the preset requirements, the physical verification of the current inference step fails, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference; when both the Kirchhoff's law constraint values ​​and equipment parameter boundary verification values ​​for the current inference step meet the preset requirements, the subsequent steps continue.

[0051] In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described power large language model long-chain inference optimization method.

[0052] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described power large language model long-chain inference optimization method.

[0053] Compared with the prior art, the present invention has the following beneficial effects: This invention presents a long-chain reasoning optimization method for a large-scale power language model. Based on the complexity of the power task at the current reasoning step, it determines the probability of extended reasoning at the current reasoning step through a pre-trained probability threshold model. Then, it combines this with a preset extended reasoning probability threshold to determine whether to continue extending the reasoning, achieving dynamic reasoning boundary control. This effectively overcomes the problem in existing methods where fixed boundary constraints limit reasoning capabilities, making it difficult to cope with constantly changing reasoning requirements. It achieves adaptive changes in the depth and scope of reasoning, thus breaking through existing limitations when facing complex and ever-changing power tasks, uncovering more potential reasoning paths, greatly enhancing the reasoning depth and breadth of the large-scale power language model, and improving the accuracy of reasoning results. Simultaneously, based on the complexity of the power task at the current reasoning step, a pre-trained extended reasoning direction reinforcement learning model is used to obtain extended reasoning directions, which are then sent to the large-scale power language model to guide its subsequent reasoning directions, guiding the reasoning process in the correct direction and improving the success rate of reasoning. Attached Figure Description

[0054] Figure 1 This is a flowchart of the long-chain inference optimization method for the power large language model according to an embodiment of the present invention.

[0055] Figure 2 This is a block diagram of the power large language model long-chain inference optimization system according to an embodiment of the present invention. Detailed Implementation

[0056] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0057] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0058] The present invention will now be described in further detail with reference to the accompanying drawings: See Figure 1 In one embodiment of the present invention, a long-chain inference optimization method for a large power language model is provided, which dynamically adjusts the inference boundary based on the complexity of power tasks, overcoming the defects of existing fixed inference boundaries.

[0059] Specifically, the long-chain inference optimization method for the power large language model of the present invention includes the following steps: S1: Obtain the complexity of the power task at the current inference step.

[0060] S2: Based on the complexity of the power task in the current inference step, the extended inference probability in the current inference step is obtained through a pre-trained probability threshold model.

[0061] S3: When the extended reasoning probability is greater than the preset extended reasoning probability threshold, based on the complexity of the power task in the current reasoning step, the extended reasoning direction is obtained through the pre-trained extended reasoning direction reinforcement learning model and sent to the power big language model to guide the power big language model to perform the next reasoning step.

[0062] S4: When the extended inference probability is not greater than the preset extended inference probability threshold, a stop message is generated and sent to the power big language model to guide the power big language model to stop long chain inference.

[0063] This invention presents a long-chain reasoning optimization method for a large-scale power language model. Based on the complexity of the power task at the current reasoning step, it determines the probability of extended reasoning at the current reasoning step through a pre-trained probability threshold model. Then, it combines this with a preset extended reasoning probability threshold to determine whether to continue extending the reasoning, achieving dynamic reasoning boundary control. This effectively overcomes the problem in existing methods where fixed boundary constraints limit reasoning capabilities, making it difficult to cope with constantly changing reasoning requirements. It achieves adaptive changes in the depth and scope of reasoning, thus breaking through existing limitations when facing complex and ever-changing power tasks, uncovering more potential reasoning paths, greatly enhancing the reasoning depth and breadth of the large-scale power language model, and improving the accuracy of reasoning results. Simultaneously, based on the complexity of the power task at the current reasoning step, a pre-trained extended reasoning direction reinforcement learning model is used to obtain extended reasoning directions, which are then sent to the large-scale power language model to guide its subsequent reasoning directions, guiding the reasoning process in the correct direction and improving the success rate of reasoning.

[0064] In one possible implementation, obtaining the complexity of the power task under the current inference step includes: obtaining power task feature data and power task category code; obtaining the number of steps in the current inference step; and extracting the features of the power task feature data based on the gated graph neural network after the number of iterations of the aforementioned steps, obtaining the extracted features and concatenating them with the power task category code to obtain the complexity of the power task under the current inference step.

[0065] Interpretive, power task characteristic data ,in, Encoding the power grid topology (such as the eigenvalue decomposition result of the adjacency matrix). These are time-series characteristics (such as load volatility and fault propagation delay). These are physical constraint characteristics (such as voltage / current boundaries and device capacity).

[0066] The encoder uses a gated graph neural network (GGNN) to extract... feature:

[0067] in, The initial features for power task characteristic data, For embedded functions, The first of the power task characteristic data Features after the next iteration; The first of the power task characteristic data Features after the next iteration This is a feature aggregation function for neighboring nodes, used to capture the topological correlation of the power grid. It is the set of neighboring nodes.

[0068] Power task in Complexity under each reasoning step ,in, Code the power task categories, and set independent codes for power task categories such as fault diagnosis and load forecasting.

[0069] In one possible implementation, the probability threshold model is constructed based on a logistic regression model.

[0070] For example, the probability threshold model is built on a logistic regression model and can be designed with one fully connected layer plus one activation layer (Sigmoid activation function), as shown in the following equation:

[0071] in, To expand the probability of inference, It is the Sigmoid activation function. These are the weight parameters for the probability threshold model. These are the bias parameters for the probability threshold model.

[0072] In one possible implementation, the extended inference probability threshold is determined as follows: based on a preset initial extended inference probability threshold, the current extended inference probability threshold is obtained using the following formula:

[0073] in, The current extended inference probability threshold, This is the probability threshold for the previous extended inference. This represents the historical extended success rate based on a sliding window statistic of inference steps.

[0074] For example, the preset initial extended inference probability threshold can be 0.5.

[0075] Interpretive approaches, employing a dynamic expansion of inference probability thresholds, can effectively balance expansion exploration and utilization, avoiding overexpansion that leads to wasted computational resources.

[0076] In one possible implementation, the extended inference direction reinforcement learning model is constructed based on a deep double-Q network; the reward function of the extended inference direction reinforcement learning model is:

[0077] in, For the total reward, This represents the total number of reasoning steps in long-chain reasoning. As the intermediate reward decay factor, For the first k Rewards for each reasoning step, For the final reward weight, As the final reward; Among them, the k Rewards for each reasoning step According to the k The final reward is obtained by calculating the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step; The results are obtained based on the final topological consistency score, task timing constraint satisfaction, and physical law matching degree of the long-chain inference.

[0078] Explanatory, based on an extended inference direction reinforcement learning model, selects the optimal extended inference direction from the set of candidate extended inference directions:

[0079] in, For candidate extended reasoning directions, For the candidate extended reasoning direction set, This is the optimal direction for extended reasoning. For state-action value functions, for The parameters.

[0080] The explanatory, extended inference direction reinforcement learning model implements hierarchical reward allocation in its reward function, which includes an intermediate reward component. and final reward portion This effectively suppresses the accumulation of intermediate errors and improves the stability of long-chain inference. Simultaneously, by incentivizing the model with rewards, it guides the reasoning process in the right direction by encouraging better decisions at each step.

[0081] For example, based on the characteristic that power tasks require attention to long-term dependence, an intermediate reward decay factor is set. Set the final reward weight. In order to balance short-term and long-term goals.

[0082] In one possible implementation, the topology consistency score We obtain it from the following formula:

[0083] in, This is the predicted topology matrix for the current inference step. This is the actual topological matrix.

[0084] The task timing constraint satisfaction We obtain it from the following formula:

[0085] in, The first step of the current reasoning process Predicted time series parameters for each evaluation time window, For the first The actual timing parameters for each evaluation time window To assess the total number of time windows.

[0086] The degree of matching of physical laws We obtain it from the following formula:

[0087] in, For the current reasoning step, the first Theoretical injection power of each node, For the first The actual injected power of each node To tolerate error, The total number of nodes. For indicator functions, when When satisfied If it is 1, otherwise, It is 0.

[0088] Explanatory, based on topology consistency scores to prevent power grid structure conflicts, based on timing constraint satisfaction to ensure the rationality of power dynamic processes, and based on physical law matching degree to ensure that reasoning conforms to the physical laws of power systems.

[0089] In one possible implementation, the first k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are obtained, including: when the first... k When the first reasoning step does not involve preset key power grid equipment, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are superimposed; when the first inference step... k When a predetermined key power grid device is involved in a reasoning step, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are summed and multiplied by a preset key weight; where the key weight is greater than 1; when the first inference step... k When the physical law matching degree of the first reasoning step is less than the preset physical law matching degree threshold, the long-chain reasoning optimization is terminated and the first step is... k Rewards for each reasoning step Set to the default negative reward.

[0090] Explanatoryly, the reward allocation strategy incorporates critical node identification and error penalty mechanisms. Critical node identification assigns a reward of a preset critical weight multiple to reasoning steps involving critical power grid equipment (such as transformers and circuit breakers), with the preset critical weight potentially being 3 times. The error penalty mechanism applies if a reasoning step violates physical constraints, such as the first... k The physical law matching degree of each reasoning step is less than the preset physical law matching degree threshold (e.g., ), immediately terminate the reasoning and impose a negative reward (such as ).

[0091] By using a critical node identification mechanism, the model is guided to prioritize the core of power grid security, ensuring the accuracy of inferences about key equipment such as transformers and circuit breakers. At the same time, an error penalty mechanism is used to force the model to comply with physical laws. Once an inference that violates basic physical constraints is detected, it is immediately terminated and a severe penalty is imposed, which effectively prevents the propagation of errors and thus significantly improves the reliability, security and physical consistency of the inference process.

[0092] In one possible implementation, the extended reasoning direction includes deepening, branching, and backtracking; when the extended reasoning direction is backtracking, the long-chain reasoning optimization method for the power big language model further includes: obtaining the current reasoning chain of the long-chain reasoning of the power big language model, and constructing a directed acyclic graph with the reasoning steps in the current reasoning chain as nodes and the logical dependencies between nodes as edge weights to obtain an initial thought chain graph; using the Monte Carlo dropout method to obtain the confidence of each node in the initial thought chain graph, and updating the edge weights of the edges associated with nodes in the initial thought chain graph that have a confidence lower than a first preset confidence threshold based on the backpropagation optimization algorithm to obtain an updated thought chain graph; using the Monte Carlo dropout method to obtain the confidence of each node in the initial thought chain graph. The algorithm obtains the confidence scores of each node in the updated mind graph and identifies nodes with confidence scores less than a second pre-set confidence threshold as target nodes. Based on a pre-defined power knowledge graph, it obtains several candidate alternative reasoning steps for the target nodes. According to the updated mind graph and the power task category encoding, a pre-trained alternative branch selection reinforcement learning model is used to select the optimal alternative reasoning branch for the target node from several candidate alternative reasoning branches. This optimal alternative reasoning branch is then used to replace the target node, resulting in an optimized mind graph. An optimized reasoning chain is obtained from the optimized mind graph and sent to the power big language model to guide it in reasoning based on the optimized reasoning chain.

[0093] For example, the confidence level of each node The first preset reliability threshold is set to 0.6, and the second preset reliability threshold is set to 0.7.

[0094] In an explanatory manner, when obtaining several candidate alternative reasoning steps for a target node based on a pre-set power knowledge graph, several candidate alternative reasoning steps for the target node are obtained by querying context-related entities in the knowledge graph, such as associating "transformer overload" with "cooling system abnormality".

[0095] The interpretable, pre-trained alternative branch selection reinforcement learning model is trained on historical inference data and selected based on updated mind maps and power task category codes.

[0096] Explanatory, traditional reasoning models are often black boxes, making their reasoning process and basis difficult to understand, and errors difficult to locate and correct. In this invention, when the extended reasoning method is backtracking, a mind chain diagram is constructed for backtracking optimization, enabling error location and dynamic correction of the reasoning path. This repairs erroneous reasoning steps in the power large-scale language model, achieving real-time monitoring and correction of the reasoning process, ensuring logical coherence and accuracy, and significantly improving the interpretability and error correction capabilities of the reasoning process. In predictive maintenance of industrial equipment, this method can help engineers quickly locate errors in the reasoning process, trace the cause of failures, improve the efficiency and accuracy of equipment maintenance, and reduce maintenance costs.

[0097] In one possible implementation, using the logical dependencies between nodes as edge weights includes obtaining the edge weights using the following formula:

[0098] in, For nodes j With nodes i edge weights, For nodes i Embedded vector, For nodes j The embedding vector.

[0099] Interpretive, the initial state of edge weights between nodes is characterized by the similarity between the node embedding vectors.

[0100] In one possible implementation, updating the edge weights of edges associated with nodes whose confidence levels are below a first preset confidence threshold in the initial thought graph based on the backpropagation optimization algorithm includes obtaining the edge weight update values ​​using the following formula:

[0101]

[0102] in, For nodes j With nodes i The edge weights are updated. The learning rate can be... , Let be the error function. For nodes j With nodes i edge weights, For nodes j Confidence level, This refers to the set of nodes whose confidence level is less than a first preset confidence threshold. For nodes The confidence level.

[0103] Will Updated to and The sum of values.

[0104] In one possible implementation, the long-chain reasoning optimization method for the power big language model further includes: obtaining the extended reasoning probability of each reasoning step in the reasoning chain of the power big language model, and displaying the extended reasoning probability of each reasoning step in the form of a heatmap; visually displaying the initial thought chain diagram, the updated thought chain diagram, and the optimized thought chain diagram, and visually displaying several candidate alternative reasoning steps for the target node in the updated thought chain diagram.

[0105] Explanatory, through visualization, provides a clear insight into the model's decision confidence at each inference step, the dynamic optimization process of the thought path, and the candidate branches during backtracking and error correction, thereby improving interpretability.

[0106] In one possible implementation, before obtaining the complexity of the power task under the current inference step, the method further includes: obtaining the Kirchhoff's law constraint value and the device parameter boundary check value of the current inference step; when at least one of the Kirchhoff's law constraint value and the device parameter boundary check value of the current inference step does not meet the preset requirements, the physical verification of the current inference step fails, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference; when both the Kirchhoff's law constraint value and the device parameter boundary check value of the current inference step meet the preset requirements, the subsequent steps continue.

[0107] For example, the constraint values ​​of Kirchhoff's laws are:

[0108] in, This represents the constraint value of Kirchhoff's laws, where 1 indicates compliance with Kirchhoff's laws and 0 indicates non-compliance with Kirchhoff's laws. For input current; For output current; The device parameter boundary verification values ​​are:

[0109] in, For equipment i The device parameter boundary check value is 1, which indicates that the device parameter boundary check is met, and 0 indicates that the device parameter boundary check is not met. For indicator functions, When satisfied If it is 1, otherwise, =0; For equipment iPredicted voltage at the current inference step This is the minimum voltage value. This represents the maximum voltage value.

[0110] The preset requirements are that the Kirchhoff law constraint value of the current inference step is 1, and the device parameter boundary check value of the current inference step is 1.

[0111] Interpretive, constructing a power engineering constraint layer to verify inference results in real time, can identify and intercept erroneous paths that violate physical laws or safety constraints in the early stages of inference, avoiding the continued spread of invalid inference, significantly improving inference efficiency and ensuring the physical feasibility and engineering safety of the solution.

[0112] The core principles of this invention's long-chain reasoning optimization method for large-scale power language models lie in three aspects. First, it dynamically adjusts the reasoning path boundary based on the complexity of power tasks, using a probability threshold model to control the direction of boundary expansion, thus overcoming the limitations of traditional fixed boundaries. Second, hierarchical reward allocation, through the design of multi-granularity reward functions, weights the evaluation of key intermediate nodes in the reasoning chain, suppressing the cumulative effect of errors. Third, backtracking optimization transforms the linear thought chain into a directed acyclic graph, using a backpropagation algorithm to locate erroneous nodes and correct the reasoning path. Furthermore, these three innovative points form a closely collaborative closed-loop system, jointly promoting the improvement of long-chain reasoning capabilities. Dynamic reasoning boundary expansion provides a flexible framework for the reasoning process, determining the depth and scope of reasoning, much like defining a dynamically adjustable base for the reasoning activity; hierarchical reward allocation, based on dynamic reasoning boundary expansion, incentivizes the model to make better decisions at each step of reasoning through reasonable reward rules, guiding the reasoning process in the correct direction; and backtracking optimization based on the thought chain graph monitors and corrects the reasoning process in real time, ensuring the logical coherence and accuracy of the reasoning.

[0113] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the apparatus embodiments, please refer to the embodiments of the method of the present invention.

[0114] See Figure 2 In another embodiment of the present invention, a long-chain inference optimization system for a large power language model is provided, which can be used to implement the above-mentioned long-chain inference optimization method for a large power language model. Specifically, the long-chain inference optimization system for a large power language model includes a data acquisition module, an extended probability module, an extended control module, and a stop control module.

[0115] The system comprises the following modules: a data acquisition module for acquiring the complexity of the power task at the current inference step; an expansion probability module for obtaining the expansion inference probability at the current inference step based on the complexity of the power task at the current inference step using a pre-trained probability threshold model; an expansion control module for obtaining the expansion inference direction based on the complexity of the power task at the current inference step using a pre-trained expansion inference direction reinforcement learning model when the expansion inference probability is greater than a preset expansion inference probability threshold, and sending this direction to the power big language model to guide it in the next inference step; and a stop control module for generating stop information and sending it to the power big language model when the expansion inference probability is not greater than a preset expansion inference probability threshold, to guide it to stop long-chain inference.

[0116] In one possible implementation, the data acquisition module is specifically used to: acquire power task feature data and power task category code of the power task; acquire the step number of the current inference step; and extract the features of the power task feature data after the number of iterations of the gated graph neural network, obtain the extracted features and concatenate them with the power task category code to obtain the complexity of the power task under the current inference step.

[0117] In one possible implementation, the probability threshold model is constructed based on a logistic regression model.

[0118] In one possible implementation, the extended inference probability threshold is determined as follows: based on a preset initial extended inference probability threshold, the current extended inference probability threshold is obtained using the following formula:

[0119] in, The current extended inference probability threshold, This is the probability threshold for the previous extended inference. This represents the historical extended success rate based on a sliding window statistic of inference steps.

[0120] In one possible implementation, the extended inference direction reinforcement learning model is constructed based on a deep double-Q network; the reward function of the extended inference direction reinforcement learning model is:

[0121] in, For the total reward, This represents the total number of reasoning steps in long-chain reasoning. As the intermediate reward decay factor, For the first k Rewards for each reasoning step, For the final reward weight, This is the final reward.

[0122] Among them, the k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step are used to obtain the final reward; the final reward is obtained based on the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the final long-chain reasoning.

[0123] In one possible implementation, the topology consistency score We obtain it from the following formula:

[0124] in, This is the predicted topology matrix for the current inference step. This is the actual topological matrix.

[0125] The task timing constraint satisfaction We obtain it from the following formula:

[0126] in, The first step of the current reasoning process Predicted time series parameters for each evaluation time window, For the first The actual timing parameters for each evaluation time window To assess the total number of time windows.

[0127] The degree of matching of physical laws We obtain it from the following formula:

[0128] in, For the current reasoning step, the first Theoretical injection power of each node, For the first The actual injected power of each node To tolerate error, The total number of nodes. For indicator functions, when When satisfied If it is 1, otherwise, It is 0.

[0129] In one possible implementation, the first k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are obtained, including: when the first...k When the first reasoning step does not involve preset key power grid equipment, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are superimposed; when the first inference step... k When a predetermined key power grid device is involved in a reasoning step, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are summed and multiplied by a preset key weight; where the key weight is greater than 1; when the first inference step... k When the physical law matching degree of the first reasoning step is less than the preset physical law matching degree threshold, the long-chain reasoning optimization is terminated and the first step is... k Rewards for each reasoning step Set to the default negative reward.

[0130] In one possible implementation, the extended reasoning direction includes deepening, branching, and backtracking; the power large language model long-chain reasoning optimization system further includes an error correction module, which is used to: obtain the current reasoning chain of the power large language model long-chain reasoning, and construct a directed acyclic graph with the reasoning steps in the current reasoning chain as nodes and the logical dependencies between nodes as edge weights to obtain an initial thought chain graph; use the Monte Carlo dropout method to obtain the confidence of each node in the initial thought chain graph, and update the edge weights of the edges associated with nodes in the initial thought chain graph that have a confidence lower than a first preset confidence threshold based on the backpropagation optimization algorithm to obtain an updated thought chain graph; use the Monte Carlo dropout method to obtain the confidence of each node in the initial thought chain graph. The algorithm obtains the confidence scores of each node in the updated mind graph and identifies nodes with confidence scores less than a second pre-set confidence threshold as target nodes. Based on a pre-defined power knowledge graph, it obtains several candidate alternative reasoning steps for the target nodes. According to the updated mind graph and the power task category encoding, a pre-trained alternative branch selection reinforcement learning model is used to select the optimal alternative reasoning branch for the target node from several candidate alternative reasoning branches. This optimal alternative reasoning branch is then used to replace the target node, resulting in an optimized mind graph. An optimized reasoning chain is obtained from the optimized mind graph and sent to the power big language model to guide it in reasoning based on the optimized reasoning chain.

[0131] In one possible implementation, using the logical dependencies between nodes as edge weights includes obtaining the edge weights using the following formula:

[0132] in, For nodes j With nodes iedge weights, For nodes i Embedded vector, For nodes j The embedding vector.

[0133] The edge weights associated with nodes whose confidence levels are below a first preset confidence threshold in the initial thought graph are updated using the backpropagation optimization algorithm, including: obtaining the updated edge weight values ​​using the following formula:

[0134]

[0135] in, For nodes j With nodes i The edge weights are updated. For learning rate, Let be the error function. For nodes j With nodes i edge weights, For nodes j Confidence level, This refers to the set of nodes whose confidence level is less than a first preset confidence threshold. For nodes The confidence level.

[0136] Will Updated to and The sum of values.

[0137] In one possible implementation, the power big language model long-chain inference optimization system further includes a visualization module, which is used to: obtain the extended inference probability of each inference step in the inference chain of the power big language model long-chain inference, and display the extended inference probability of each inference step in the form of a heatmap; visualize the initial thought chain diagram, the updated thought chain diagram and the optimized thought chain diagram, and visualize several candidate alternative inference steps for the target node in the updated thought chain diagram.

[0138] In one possible implementation, the data acquisition module is further configured to: acquire Kirchhoff's law constraint values ​​and equipment parameter boundary verification values ​​for the current inference step before acquiring the complexity of the power task under the current inference step; when at least one of the Kirchhoff's law constraint values ​​and equipment parameter boundary verification values ​​for the current inference step does not meet the preset requirements, the physical verification of the current inference step fails, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference; when both the Kirchhoff's law constraint values ​​and equipment parameter boundary verification values ​​for the current inference step meet the preset requirements, the subsequent steps continue.

[0139] All relevant content of each step involved in the aforementioned embodiments of the power large language model long chain inference optimization method can be referenced to the functional description of the corresponding functional module of the power large language model long chain inference optimization system in the embodiments of the present invention, and will not be repeated here.

[0140] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0141] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may 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. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of a long-chain inference optimization method for a large power language model.

[0142] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the long-chain inference optimization method for the large power language model in the above embodiments.

[0143] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0144] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxesFigure 1 The function specified in one or more boxes.

[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for optimizing long-chain reasoning in a large-scale power linguistic model, characterized in that, include: Obtain the complexity of the power task at the current inference step; Based on the complexity of the power task at the current inference step, the extended inference probability at the current inference step is obtained through a pre-trained probability threshold model. When the extended reasoning probability is greater than the preset extended reasoning probability threshold, based on the complexity of the power task in the current reasoning step, the extended reasoning direction is obtained through the pre-trained extended reasoning direction reinforcement learning model and sent to the power big language model to guide the power big language model to perform the next reasoning step. When the extended inference probability is not greater than the preset extended inference probability threshold, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference.

2. The long-chain inference optimization method for a large power language model according to claim 1, characterized in that, The complexity of the power acquisition task at the current inference step includes: Obtain power task characteristic data and power task category codes; Obtain the number of steps in the current inference step, and extract the features of the power task based on the gated graph neural network after the number of iterations of the aforementioned steps. Concatenate the extracted features with the power task category code to obtain the complexity of the power task under the current inference step.

3. The long-chain inference optimization method for a large power language model according to claim 1, characterized in that, The probability threshold model is constructed based on a logistic regression model.

4. The long-chain inference optimization method for a large power language model according to claim 1, characterized in that, The extended inference probability threshold is determined in the following manner: Based on the preset initial extended inference probability threshold, the current extended inference probability threshold is obtained using the following formula: in, The current extended inference probability threshold, This is the probability threshold for the previous extended inference. This represents the historical extended success rate based on a sliding window statistic of inference steps.

5. The long-chain inference optimization method for a large power language model according to claim 1, characterized in that, The extended inference direction reinforcement learning model is built based on a deep dual-Q network; The reward function of the extended inference direction reinforcement learning model is: in, For the total reward, This represents the total number of reasoning steps in long-chain reasoning. As the intermediate reward decay factor, For the first k Rewards for each reasoning step, For the final reward weight, As the final reward; Among them, the k Rewards for each reasoning step According to the k The final reward is obtained by calculating the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step; The results are obtained based on the final topological consistency score, task timing constraint satisfaction, and physical law matching degree of the long-chain inference.

6. The power large language model long-chain inference optimization method according to claim 5, characterized in that, The topology consistency score We obtain it from the following formula: in, This is the predicted topology matrix for the current inference step. This is the actual topological matrix; The task timing constraint satisfaction We obtain it from the following formula: in, The first step of the current reasoning process Predicted time series parameters for each evaluation time window, For the first The actual timing parameters for each evaluation time window To assess the total number of time windows; The degree of matching of physical laws We obtain it from the following formula: in, For the current reasoning step, the first Theoretical injection power of each node, For the first The actual injected power of each node To tolerate error, The total number of nodes. For indicator functions, when When satisfied If it is 1, otherwise, It is 0.

7. The long-chain inference optimization method for a large power language model according to claim 5, characterized in that, The first k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step are obtained as follows: When the k When the first reasoning step does not involve preset key power grid equipment, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are superimposed; when the first inference step... k When a predetermined key power grid device is involved in a reasoning step, the first... k Rewards for each reasoning step By the first k The result is obtained by multiplying the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step by a preset key weight; where the key weight is greater than 1. When the k When the physical law matching degree of the first reasoning step is less than the preset physical law matching degree threshold, the long-chain reasoning optimization is terminated and the first step is... k Rewards for each reasoning step Set to the default negative reward.

8. The long-chain inference optimization method for a large power language model according to claim 1, characterized in that, The extended reasoning directions include deepening, branching, and backtracking; When the direction of extended reasoning is backtracking, it also includes: Obtain the current reasoning chain of the long-chain reasoning of the power big language model, and construct a directed acyclic graph with the reasoning steps in the current reasoning chain as nodes and the logical dependencies between nodes as edge weights to obtain the initial thought chain graph. The Monte Carlo dropout method is used to obtain the confidence of each node in the initial mind chain graph, and the edge weights of the edges associated with nodes in the initial mind chain graph that have a confidence of less than the first preset confidence threshold are updated based on the backpropagation optimization algorithm to obtain the updated mind chain graph. The Monte Carlo dropout method is used to obtain the confidence of each node in the updated mind chain diagram, and the nodes in the updated mind chain diagram with a confidence of less than the second preset confidence threshold are selected as target nodes. Several candidate alternative reasoning steps for the target node are obtained based on a pre-set power knowledge graph; Based on the updated mind map and the power task category encoding, the optimal alternative reasoning branch of the target node is selected from several candidate alternative reasoning branches by a pre-trained alternative branch selection reinforcement learning model, and the optimal alternative reasoning branch is used to replace the target node to obtain the optimized mind map. The optimized reasoning chain is obtained from the optimized mind chain diagram and sent to the power big language model to guide the power big language model to reason based on the optimized reasoning chain.

9. The long-chain inference optimization method for a large power language model according to claim 7, characterized in that, The use of logical dependencies between nodes as edge weights includes: The edge weights are obtained using the following formula: in, For nodes j With nodes i edge weights, For nodes i Embedded vector, For nodes j The embedding vector; The edge weights associated with nodes whose confidence levels are below a first preset confidence threshold in the initial thought graph are updated using the backpropagation optimization algorithm, including: The edge weight update value is obtained using the following formula: in, For nodes j With nodes i The edge weights are updated. For learning rate, Let be the error function. For nodes j With nodes i edge weights, For nodes j Confidence level, This refers to the set of nodes whose confidence level is less than a first preset confidence threshold. For nodes Confidence level; Will Updated to and The sum of values.

10. The long-chain inference optimization method for a large power language model according to claim 9, characterized in that, Also includes: Obtain the extended inference probability of each inference step in the long-chain inference of the power big language model, and display the extended inference probability of each inference step in the form of a heatmap. The system visualizes the initial, updated, and optimized mind maps, and also visualizes several candidate alternative reasoning steps for the target node in the updated mind map.

11. The long-chain inference optimization method for a large power language model according to claim 1, characterized in that, Before the complexity of the power acquisition task at the current inference step, it also includes: Obtain the Kirchhoff's law constraint values ​​and device parameter boundary check values ​​for the current inference step; If at least one of the Kirchhoff's law constraint value and the equipment parameter boundary check value in the current inference step fails to meet the preset requirements, the physical verification of the current inference step fails, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference; if both the Kirchhoff's law constraint value and the equipment parameter boundary check value in the current inference step meet the preset requirements, the subsequent steps continue.

12. A long-chain inference optimization system for a large power language model, characterized in that, include: The data acquisition module is used to obtain the complexity of the power task at the current inference step; The extended probability module is used to obtain the extended inference probability of the current inference step based on the complexity of the power task at the current inference step through a pre-trained probability threshold model. An extended control module is used to obtain an extended reasoning direction based on the complexity of the power task in the current reasoning step when the extended reasoning probability is greater than a preset extended reasoning probability threshold, and send it to the power big language model to guide the power big language model to perform the next reasoning step. The stop control module is used to generate stop information and send it to the power big language model when the extended inference probability is not greater than a preset extended inference probability threshold, so as to guide the power big language model to stop long chain inference.

13. The power large language model long-chain inference optimization system according to claim 12, characterized in that, The data acquisition module is specifically used for: Obtain power task characteristic data and power task category codes; Obtain the number of steps in the current inference step, and extract the features of the power task based on the gated graph neural network after the number of iterations of the aforementioned steps. Concatenate the extracted features with the power task category code to obtain the complexity of the power task under the current inference step.

14. The power large language model long-chain inference optimization system according to claim 12, characterized in that, The probability threshold model is constructed based on a logistic regression model.

15. The power large language model long-chain inference optimization system according to claim 12, characterized in that, The extended inference probability threshold is determined in the following manner: Based on the preset initial extended inference probability threshold, the current extended inference probability threshold is obtained using the following formula: in, The current extended inference probability threshold, This is the probability threshold for the previous extended inference. This represents the historical extended success rate based on a sliding window statistic of inference steps.

16. The power large language model long-chain inference optimization system according to claim 12, characterized in that, The extended inference direction reinforcement learning model is built based on a deep dual-Q network; The reward function of the extended inference direction reinforcement learning model is: in, For the total reward, This represents the total number of reasoning steps in long-chain reasoning. As the intermediate reward decay factor, For the first k Rewards for each reasoning step, For the final reward weight, As the final reward; Among them, the k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step are used to obtain the final reward; the final reward is obtained based on the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the final long-chain reasoning.

17. The power large language model long-chain inference optimization system according to claim 16, characterized in that, The topology consistency score We obtain it from the following formula: in, This is the predicted topology matrix for the current inference step. This is the actual topological matrix; The task timing constraint satisfaction We obtain it from the following formula: in, The first step of the current reasoning process Predicted time series parameters for each evaluation time window, For the first The actual timing parameters for each evaluation time window To assess the total number of time windows; The degree of matching of physical laws We obtain it from the following formula: in, For the current reasoning step, the first Theoretical injection power of each node, For the first The actual injected power of each node To tolerate error, The total number of nodes. For indicator functions, when When satisfied If it is 1, otherwise, It is 0.

18. The power large language model long-chain inference optimization system according to claim 16, characterized in that, The first k Rewards for each reasoning step According to the k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step are obtained as follows: When the k When the first reasoning step does not involve preset key power grid equipment, the first... k Rewards for each reasoning step By the first k The topological consistency score, task temporal constraint satisfaction, and physical law matching degree of the inference step are superimposed; when the first inference step... k When a predetermined key power grid device is involved in a reasoning step, the first... k Rewards for each reasoning step By the first k The result is obtained by multiplying the topological consistency score, task temporal constraint satisfaction, and physical law matching degree of each reasoning step by a preset key weight; where the key weight is greater than 1. When the k When the physical law matching degree of the first reasoning step is less than the preset physical law matching degree threshold, the long-chain reasoning optimization is terminated and the first step is... k Rewards for each reasoning step Set to the default negative reward.

19. The power large language model long-chain inference optimization system according to claim 12, characterized in that, The extended reasoning directions include deepening, branching, and backtracking; The power large language model long-chain inference optimization system also includes an error correction module, which is used for: Obtain the current reasoning chain of the long-chain reasoning of the power big language model, and construct a directed acyclic graph with the reasoning steps in the current reasoning chain as nodes and the logical dependencies between nodes as edge weights to obtain the initial thought chain graph. The Monte Carlo dropout method is used to obtain the confidence of each node in the initial mind chain graph, and the edge weights of the edges associated with nodes in the initial mind chain graph that have a confidence of less than the first preset confidence threshold are updated based on the backpropagation optimization algorithm to obtain the updated mind chain graph. The Monte Carlo dropout method is used to obtain the confidence of each node in the updated mind chain diagram, and the nodes in the updated mind chain diagram with a confidence of less than the second preset confidence threshold are selected as target nodes. Several candidate alternative reasoning steps for the target node are obtained based on a pre-set power knowledge graph; Based on the updated mind map and the power task category encoding, the optimal alternative reasoning branch of the target node is selected from several candidate alternative reasoning branches by a pre-trained alternative branch selection reinforcement learning model, and the optimal alternative reasoning branch is used to replace the target node to obtain the optimized mind map. The optimized reasoning chain is obtained from the optimized mind chain diagram and sent to the power big language model to guide the power big language model to reason based on the optimized reasoning chain.

20. The power large language model long-chain inference optimization system according to claim 19, characterized in that, The use of logical dependencies between nodes as edge weights includes: The edge weights are obtained using the following formula: in, For nodes j With nodes i edge weights, For nodes i Embedded vector, For nodes j The embedding vector; The edge weights associated with nodes whose confidence levels are below a first preset confidence threshold in the initial thought graph are updated using the backpropagation optimization algorithm, including: The edge weight update value is obtained using the following formula: in, For nodes j With nodes i The edge weights are updated. For learning rate, Let be the error function. For nodes j With nodes i edge weights, For nodes j Confidence level, This refers to the set of nodes whose confidence level is less than a first preset confidence threshold. For nodes Confidence level; Will Updated to and The sum of values.

21. The long-chain inference optimization method for a large power language model according to claim 9, characterized in that, It also includes a visualization module, which is used for: Obtain the extended inference probability of each inference step in the long-chain inference of the power big language model, and display the extended inference probability of each inference step in the form of a heatmap. The system visualizes the initial, updated, and optimized mind maps, and also visualizes several candidate alternative reasoning steps for the target node in the updated mind map.

22. The power large language model long-chain inference optimization system according to claim 12, characterized in that, The data acquisition module is also used for: Before obtaining the complexity of the power task at the current inference step, obtain the Kirchhoff's law constraint values ​​and the device parameter boundary check values ​​for the current inference step. If at least one of the Kirchhoff's law constraint value and the equipment parameter boundary check value in the current inference step fails to meet the preset requirements, the physical verification of the current inference step fails, a stop message is generated and sent to the power big language model to guide the power big language model to stop long-chain inference; if both the Kirchhoff's law constraint value and the equipment parameter boundary check value in the current inference step meet the preset requirements, the subsequent steps continue.

23. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the long-chain inference optimization method for the power large language model as described in any one of claims 1 to 11.

24. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the long-chain inference optimization method for the power large language model as described in any one of claims 1 to 11.