A sensitivity-based power flow adjustment training corpus generation method and system
Patent Information
- Application Number
- CN202610573686.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-28
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明提供一种基于灵敏度的电力潮流调整训练语料生成方法及系统,用以解决现有技术中数据生成方法效率低、关键样本覆盖不足、难以支持课程学习的缺陷,实现覆盖全面、物理合理且难度可控的电力潮流训练语料生成
[0017] The method and system for generating training corpus based on sensitivity-guided power flow adjustment provided by this invention can efficiently find the convergence boundary of the system with the shortest path through sensitivity-guided forward sampling, avoiding the blindness of random sampling. Through a forward-guided, backward-computed model, a complete trajectory is generated that gradually depressurizes from a critical state to a stable state. The samples on this trajectory not only have clear physical meaning but also contain a difficulty gradient from hard to easy, which can be directly used for advanced machine learning training strategies such as course learning, helping to improve the training speed and final performance of the model.
Smart Images

Figure CN122596010A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system analysis and machine learning data generation technology, and in particular to a method and system for generating training corpus based on sensitivity-based power flow adjustment. Background Technology
[0002] In power system analysis, utilizing machine learning models for rapid power flow reasoning has become an important research direction. The performance of these machine learning models is highly dependent on the quality of the training dataset. In power flow reasoning tasks, high-quality training data needs to meet requirements such as comprehensive coverage (especially covering critical states near the convergence boundary), physical plausibility, graded difficulty, and sufficient quantity.
[0003] Currently, the mainstream method for generating power flow training data is the random perturbation method. This method starts from a known convergent state, applies random perturbations to control variables such as generator output and nodal loads, and then verifies whether the new state has converged through power flow calculations, thereby collecting a large number of samples.
[0004] While the above method is simple, it cannot specifically generate difficult samples; a large number of samples are concentrated in the convergence region, resulting in insufficient coverage of boundary samples; furthermore, the perturbations applied by this method lack physical guidance and may generate unreasonable system states; in addition, this method is inefficient and requires a large number of random attempts to find non-convergent samples. Summary of the Invention
[0005] This invention provides a sensitivity-based method and system for generating power flow adjustment training corpus, which addresses the shortcomings of existing data generation methods such as low efficiency, insufficient coverage of key samples, and difficulty in supporting course learning, and achieves the generation of power flow training corpus that is comprehensive, physically reasonable, and has controllable difficulty.
[0006] This invention provides a method for generating training corpus based on sensitivity-based power flow adjustment, comprising: By forward sampling, a forward guiding trajectory of the power flow state of the power system is generated. The forward guiding trajectory contains multiple convergent state points arranged in the order of generation, and records the corresponding sensitivity information of the objective function of each convergent state point to the pre-selected control variables. The forward guiding trajectory eventually leads to a non-convergent state. Starting with the control variables in the non-convergent state as the calculation starting point, and traversing the forward guiding trajectory in the reverse order of generation, a reverse power flow state calculation process is initiated and iterated. After the reverse power flow state calculation process is completed, the stored one or more power flow states and reverse adjustment trajectories are filled into a preset text template as the final training samples. In each iteration: from the forward guiding trajectory, the sensitivity information pre-recorded at the convergence state point corresponding to this iteration is obtained as guidance; based on the obtained sensitivity information, the current control variables are adjusted along the direction of restoring the convergence of the system; power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generated trajectory set.
[0007] According to the sensitivity-based power flow adjustment training corpus generation method provided by the present invention, the positive guidance trajectory is generated through the following positive sampling process: Obtain a converged power flow state of the power system as the starting point; Based on the current convergent power flow state, calculate the sensitivity of the preset objective function used to characterize the system convergence to each control variable, and associate the sensitivity with the current convergence state point. Apply a perturbation to the control variable with the highest sensitivity to update the value of that control variable; Power flow calculations are performed based on the updated control variables to obtain a new power flow state, and it is then determined whether the new power flow state has converged. If convergence is achieved, the new power flow state is taken as the current converged power flow state, and the process returns to calculate the sensitivity. If convergence fails, the new power flow state will be taken as the endpoint of the positive guiding trajectory, and the positive sampling process will end.
[0008] According to the method for generating a sensitivity-based power flow adjustment training corpus provided by the present invention, the objective function used to characterize the system convergence is the maximum mismatch in the power flow equations of the power system.
[0009] According to the sensitivity-based power flow adjustment training corpus generation method provided by the present invention, the calculation of the sensitivity of the preset objective function used to characterize the system convergence to each control variable includes: The gradient or norm of the objective function with respect to each control variable is calculated and used as the result of the sensitivity calculation.
[0010] According to the sensitivity-based power flow adjustment training corpus generation method provided by the present invention, the method further includes: A difficulty assessment is performed on one or more power flow states stored in the reverse-generated trajectory set.
[0011] According to the sensitivity-based power flow adjustment training corpus generation method provided by the present invention, the difficulty assessment is based on a comprehensive score selected from at least one or more of the following indicators, including: The condition number of the Jacobian matrix for power flow calculation; Unbalance quantities in power flow equations; The number of adjustment steps required to reach the current power flow state from the initial non-convergent state; Convergence margin of control variables.
[0012] The method for generating training corpus based on sensitivity-based power flow adjustment according to the present invention further includes: Based on the difficulty assessment results, one or more power flow states stored in the reverse generated trajectory set are organized into one or more difficulty-level datasets for course learning.
[0013] This invention also provides a sensitivity-based power flow adjustment training corpus generation system, comprising the following modules: The forward trajectory generation module is used to generate a forward guiding trajectory of the power flow state of the power system through forward sampling. The forward guiding trajectory contains multiple convergence state points arranged in the generation order, and records the corresponding sensitivity information of the objective function to the pre-selected control variables at each convergence state point. The forward guiding trajectory eventually leads to a non-convergent state. The reverse iteration module is used to start a reverse power flow state calculation process by taking the control variables in the non-converged state as the starting point of the calculation and traversing the forward guidance trajectory in the reverse order of generation. In each iteration: from the forward guiding trajectory, the sensitivity information pre-recorded at the convergence state point corresponding to this iteration is obtained as guidance; based on the obtained sensitivity information, the current control variables are adjusted along the direction of restoring the convergence of the system; power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generation trajectory set; The sample output module is used to fill one or more power flow states and reverse iteration trajectories stored in the reverse generated trajectory set into a preset text template after the reverse power flow state calculation process is completed, as the final training samples.
[0014] The present invention also provides an electronic 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 sensitivity-based power flow adjustment training corpus generation method as described above.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the sensitivity-based power flow adjustment training corpus generation method as described above.
[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the sensitivity-based power flow adjustment training corpus generation method as described above.
[0017] The method and system for generating training corpus based on sensitivity-guided power flow adjustment provided by this invention can efficiently find the convergence boundary of the system with the shortest path through sensitivity-guided forward sampling, avoiding the blindness of random sampling. Through a forward-guided, backward-computed model, a complete trajectory is generated that gradually depressurizes from a critical state to a stable state. The samples on this trajectory not only have clear physical meaning but also contain a difficulty gradient from hard to easy, which can be directly used for advanced machine learning training strategies such as course learning, helping to improve the training speed and final performance of the model. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the method for generating training corpus for sensitivity power flow adjustment provided by the present invention.
[0020] Figure 2 This is a schematic diagram of the process for generating a positive guiding trajectory provided by the present invention.
[0021] Figure 3 This is a schematic diagram of the structure of the sensitivity-based power flow adjustment training corpus generation system provided by the present invention.
[0022] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] The present invention will now be described in detail with reference to the accompanying drawings. The specific operation methods in the method embodiments can also be applied to the device embodiments or system embodiments. In the description of the present invention, unless otherwise stated, "at least one" includes one or more. "Multiple" refers to two or more. For example, at least one of A, B, and C includes: A existing alone, B existing alone, A and B existing simultaneously, A and C existing simultaneously, B and C existing simultaneously, and A, B, and C existing simultaneously. In the present invention, " / " means "or". For example, A / B can mean A or B. The "and / or" in this document 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.
[0025] The present invention will now be described in detail with reference to specific embodiments.
[0026] Training data is the foundation of machine learning models. In power flow reasoning tasks, high-quality training data must meet the following requirements: (1) Comprehensive coverage: including normal operating conditions and extreme operating conditions, especially the critical state near the convergence boundary. (2) Physically reasonable: conforms to the operating laws and constraints of the power system. (3) Difficulty levels: from easy to difficult, supporting course learning (4) Sufficient quantity: Supports large-scale model training (usually requires thousands to tens of thousands of samples) However, existing random perturbation methods have several insurmountable drawbacks, such as low generation efficiency, uneven sample coverage, weak physical meaning, and difficulty in supporting advanced training strategies.
[0027] In view of this, the present invention provides a method and system for generating training corpus based on sensitivity of power flow adjustment. Through sensitivity analysis and bidirectional trajectory sampling technology, a high-quality, high-coverage training dataset is automatically generated for training power flow inference models.
[0028] The present invention will now be described in further detail with reference to the accompanying drawings.
[0029] In some specific embodiments of the present invention, such as Figure 1 As shown, this scheme provides a method for generating training corpus based on sensitivity-based power flow adjustment, including: S1. A forward guiding trajectory for the power flow state of the power system is generated through forward sampling. The forward guiding trajectory contains multiple convergence state points arranged in the generation order, and records the corresponding sensitivity information of the objective function to the pre-selected control variables at each convergence state point. The forward guiding trajectory eventually leads to a non-convergent state. S2. Taking the control variables in the non-convergent state as the starting point of the calculation, and traversing the positive guidance trajectory in the reverse order of generation, a reverse power flow state calculation process is initiated and iterated. In each iteration: S21. Obtain the pre-recorded sensitivity information at the convergence state point corresponding to this iteration from the positive guidance trajectory as guidance; S22. Based on the acquired sensitivity information, adjust the current control variables along the direction of restoring the convergence of the system; S23. Perform power flow calculation based on the adjusted control variables to obtain a new power flow state, and store the new power flow state into the reverse generated trajectory set; S3. After the reverse power flow state calculation process is completed, fill one or more power flow states and reverse iteration trajectories stored in the reverse generated trajectory set into a preset text template as the final training samples.
[0030] The above steps will be explained in detail below through specific embodiments.
[0031] Essentially, this invention comprises a forward guided trajectory generation stage and a backward computation generation stage. The purpose of forward guided trajectory generation is to efficiently explore the path from a stable state to the system's instability boundary and record key information along this path, such as state points and corresponding sensitivities, to provide a path for backward computation.
[0032] S1. A forward guiding trajectory for the power flow state of the power system is generated through forward sampling. The forward guiding trajectory contains multiple convergence state points arranged in the generation order, and records the corresponding sensitivity information of the objective function to the pre-selected control variables at each convergence state point. The forward guiding trajectory eventually leads to a non-convergent state. In some possible embodiments of the present invention, such as Figure 2 As shown, the forward guidance trajectory is generated through the following forward sampling process: S101. Obtain a converged power flow state of the power system as the starting point; Specifically, this initial state can be a known, stable standard power system example, such as standard power flow profile data from IEEE 30-node or 118-node systems. This state serves as the starting reference point for the entire generation process.
[0033] S102. Based on the current converged power flow state, calculate the sensitivity of the preset objective function used to characterize the system convergence to each control variable, and associate the sensitivity with the current convergence state point. In a preferred embodiment, the objective function used to characterize the system convergence is the maximum mismatch in the power flow equations of the power system.
[0034] The power flow equation can be expressed as: (1), in, These are state variables, such as voltage magnitude and phase angle; For control variables, such as generator active power output and node injected power.
[0035] Optionally, the objective function is the maximum mismatch, which is expressed as: The closer this value is to 0, the closer the system is to convergence.
[0036] In a preferred embodiment, the calculation of the sensitivity of the preset objective function characterizing the system convergence to each control variable includes: The gradient or norm of the objective function with respect to each control variable is calculated and used as the result of the sensitivity calculation.
[0037] Specifically, sensitivity is the objective function with respect to the i-th control variable. Sensitivity Represented as: (2).
[0038] In a preferred embodiment, the sensitivity calculation can be efficiently performed using automatic differentiation techniques.
[0039] For example, the power flow equations can be organized into a computational graph format. This graph can be constructed using deep learning frameworks such as PyTorch. Sensitivity calculations are then performed using the framework's built-in automatic differentiation toolkit. It's important to note that the gradient calculation requires the differentiable component to be a scalar; therefore, we choose the maximum mismatch in the power flow equations as the differentiable component.
[0040] The built-in automatic differentiation toolkit of the framework can be used to accurately calculate the gradient (i.e., sensitivity) of the scalar of maximum mismatch with respect to all control variables. The calculated sensitivity information (a vector) is associated with the current power flow state point (containing the values of all state variables and control variables) as a data pair and stored, forming a node of the positive steering trajectory.
[0041] S103. Apply a disturbance to the control variable with the highest sensitivity to update the value of the control variable; Based on the sensitivity vector calculated in step S102, the control variable that has the greatest impact on system stability can be identified.
[0042] In a preferred embodiment, this step selects the control variable with the highest absolute value of sensitivity. And apply a perturbation to it that aims to enhance the system's non-convergence (i.e., increase the maximum mismatch). For example, (3), in, For a small disturbance amplitude, For the objective function with respect to the j-th control variable Sensitivity, This is the symbol for the sensitivity.
[0043] S104. Perform power flow calculation based on the updated control variables to obtain a new power flow state, and determine whether the new power flow state has converged: If convergence occurs, the new power flow state is taken as the current converged power flow state, and the process returns to step S102. If convergence fails, the new power flow state will be taken as the endpoint of the positive guiding trajectory, and the positive sampling process will end.
[0044] Using the updated control variables from step S103, perform a complete Newton-Raphson method or other power flow calculation.
[0045] If convergence occurs, it indicates that the system is still within the stable region. At this point, this new converged state is taken as the current converged power flow state, and the process returns to step S102 to continue calculating the sensitivity under the new state, recording information, and applying perturbations. This cycle repeats, adding a new node to the forward guiding trajectory.
[0046] If convergence fails, it means the disturbance caused the system state to cross the convergence boundary. At this point, record this non-convergent state (primarily recording the values of its control variables) and end the forward sampling process. Thus, a complete forward guiding trajectory, containing multiple ordered convergent state points and their corresponding sensitivity information, ultimately pointing to a non-convergent state, has been generated.
[0047] S2. Taking the control variables in the non-convergent state as the starting point of the calculation, and traversing the positive guidance trajectory in the reverse order of generation, a reverse power flow state calculation process is initiated and iterated. This step is the process of generating the final training data. Using the positive guiding trajectory generated in S1 as a guide, a sample trajectory is generated in reverse through a completely new and independent calculation process, gradually recovering from the non-convergence boundary to a stable state.
[0048] In each iteration: S21. Obtain the pre-recorded sensitivity information at the convergence state point corresponding to this iteration from the positive guidance trajectory as guidance; For example, the first step of the reverse computation involves extracting the sensitivity information recorded at the last convergence point from the forward guiding trajectory. The second step extracts the sensitivity information recorded at the second-to-last convergence point, and so on.
[0049] S22. Based on the acquired sensitivity information, adjust the current control variables along the direction of restoring the convergence of the system; This step is the reverse of step S103. Again, using the control variable with the highest sensitivity mentioned above... For example, adjust the direction to reduce the maximum mismatch of the system. (4), in, The control variable with the highest sensitivity after adjustment. This is the control variable with the highest sensitivity before adjustment. Here... It is the pre-stored value retrieved from the forward guide trajectory in step S21.
[0050] S23. Perform power flow calculation based on the adjusted control variables to obtain a new power flow state, and store the new power flow state into the reverse generated trajectory set; After performing the power flow calculation, a new state point is obtained (theoretically, this point should be closer to convergence than the previous step). Regardless of whether it has fully converged, it is treated as a valid sample point and stored in an initially empty set of reverse-generated trajectories.
[0051] By repeatedly executing the iterative process of S21-S23 until the forward guiding trajectory is completely traversed in reverse order once, a complete and progressively recovering convergent reverse generation trajectory is obtained.
[0052] S3. After the reverse power flow state calculation process is completed, fill one or more power flow states and reverse iteration trajectories stored in the reverse generated trajectory set into a preset text template as the final training samples.
[0053] All the samples in this set together constitute a high-quality training dataset.
[0054] In a specific embodiment of the present invention, the forward sampling of the power flow state of the power system from convergence to non-convergence is achieved through the following algorithmic steps: Input: Initial convergence state Current perturbation steps k, maximum perturbation steps Disturbance range Output: Sampling trajectory Initialization: O ← , k ← 0, Traj ← While k< : Calculate the Jacobian matrix J of the current state. Calculate the sensitivity of each control variable. Sort by sensitivity and select the top-K most sensitive variables. Randomly select one of the variables Generate random perturbations ~ Uniform( , ) renew: ← × (1 + ) Perform power flow calculation: If convergence: O ← New state, Traj ← Traj ∪ {O}, k ← k + 1 Else: Record the first failure point Break To further improve training effectiveness, this invention can also assess the difficulty of the generated training samples.
[0055] In a preferred embodiment, sample difficulty can be quantified by a comprehensive scoring function, which may be based on one or more of the following metrics: Condition number of the Jacobian matrix for power flow calculation This reflects the degree of system pathology; the larger the value, the closer it is to singularity, and the higher the difficulty. Unbalance in power flow equations This reflects how close the solution is to convergence; the larger the value, the more difficult the solution is. The number of adjustment steps k required to reach the current power flow state from the initial non-convergent state is smaller, indicating that the process is closer to the non-convergent boundary and is more difficult. The convergence margin of a control variable reflects the margin by which the control variable moves away from its upper and lower limits; the smaller the margin, the more difficult the convergence.
[0056] By normalizing and weighting these indicators, a quantization difficulty score can be obtained for each sample. For example, the quantization difficulty score... The specific calculation formula can be expressed as: (5).
[0057] Furthermore, based on the results of the difficulty assessment, samples from the back-generated trajectory set can be organized into one or more difficulty-level datasets to support course learning. For example, training data can be provided to machine learning models in descending order of difficulty (i.e., consistent with the generation order of the back-computed model).
[0058] This invention utilizes sensitivity-guided forward sampling to efficiently find the system's convergence boundary using the shortest path, avoiding the blindness of random sampling. Through a forward-guided, backward-computed approach, a complete trajectory is generated, gradually recovering from a critical state to a stable state. The samples on this trajectory not only have clear physical meaning but also naturally contain a difficulty gradient from hard to easy. The core sensitivity calculation is performed only once during the forward sampling phase and stored for reuse; the backward-computed phase directly calls the pre-stored information, avoiding redundant calculations and significantly improving the overall efficiency of data generation. The backward-generated trajectory itself is a sequence of decreasing difficulty, which can be directly used for advanced machine learning training strategies such as course learning, helping to improve the training speed and final performance of the model.
[0059] In some specific embodiments of the present invention, such as Figure 2 As shown, this scheme provides a sensitivity-based power flow adjustment training corpus generation system, including: The forward trajectory generation module 10 is used to generate a forward guiding trajectory of the power flow state of the power system through forward sampling. The forward guiding trajectory includes multiple convergence state points arranged in the generation order, and records the corresponding sensitivity information of the objective function to the pre-selected control variables at each convergence state point. The forward guiding trajectory eventually leads to a non-convergent state. The reverse iteration module 20 is used to start a reverse power flow state calculation process and iterate by taking the control variables in the non-converged state as the starting point and traversing the forward guidance trajectory in the reverse order of generation. In each iteration: From the positive guidance trajectory, obtain the pre-recorded sensitivity information at the convergence state point corresponding to this iteration as guidance; Based on the acquired sensitivity information, the current control variables are adjusted in the direction of restoring the convergence of the system. Power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generated trajectory set. The sample output module 30 is used to fill one or more power flow states and reverse iteration trajectories stored in the reverse generated trajectory set into a preset text template after the reverse power flow state calculation process is completed, as the final training samples.
[0060] The method and system for generating training corpus based on sensitivity-based power flow adjustment provided by this invention achieves efficient and high-quality training corpus generation through the following innovations: First, this invention utilizes automatic differentiation technology to extract system sensitivity information, guiding the sampling direction. It employs a bidirectional trajectory sampling strategy to comprehensively cover the entire difficulty spectrum from easy to difficult. By automatically identifying convergence boundaries and generating critical state samples, this invention significantly improves data generation efficiency, reducing invalid samples by more than 70% compared to random methods. Furthermore, this invention supports difficulty gradation, making it suitable for application scenarios such as constructing course learning datasets.
[0061] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a sensitivity-based power flow adjustment training corpus generation method. This method includes: generating a forward guidance trajectory of the power flow state of the power system through forward sampling; the forward guidance trajectory contains multiple convergence state points arranged in the generation order, and records the corresponding sensitivity information of the objective function to pre-selected control variables at each convergence state point; the forward guidance trajectory ultimately leads to a non-convergent state; using the control variables in the non-convergent state as the starting point for calculation, and traversing the forward guidance trajectory in the reverse order of generation, a reverse power flow is initiated. The state calculation process is iterative. After the reverse power flow state calculation process is completed, one or more stored power flow states and reverse iteration trajectories are filled into a preset text template as the final training samples. In each iteration: the sensitivity information pre-recorded at the convergence state point corresponding to the current iteration is obtained from the forward guidance trajectory as guidance; the current control variables are adjusted along the direction of restoring system convergence based on the obtained sensitivity information; power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generation trajectory set.
[0062] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the sensitivity-based power flow adjustment training corpus generation method provided by the above methods. This method includes: generating a forward guidance trajectory of the power flow state of the power system through forward sampling, wherein the forward guidance trajectory includes multiple convergence state points arranged in the generation order, and recording the corresponding sensitivity information of the objective function to pre-selected control variables at each convergence state point; the forward guidance trajectory ultimately leads to a non-convergent state; and the control variables in the non-convergent state are used as the starting point for calculation. The system iterates through the forward guidance trajectory in the reverse order of generation, initiating a reverse power flow state calculation process. After the reverse power flow state calculation process is completed, one or more stored power flow states and reverse iteration trajectories are filled into a preset text template as the final training samples. In each iteration: the system obtains the pre-recorded sensitivity information at the convergence point corresponding to the current iteration from the forward guidance trajectory as guidance; based on the obtained sensitivity information, the current control variables are adjusted along the direction of restoring system convergence; power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generation trajectory set.
[0064] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a sensitivity-based power flow adjustment training corpus generation method provided by the methods described above. This method includes: generating a forward guiding trajectory of the power flow state of a power system through forward sampling, the forward guiding trajectory containing multiple convergent state points arranged in the generation order, and recording the corresponding sensitivity information of the objective function to pre-selected control variables at each convergent state point; the forward guiding trajectory ultimately leads to a non-convergent state; using the control variables in the non-convergent state as the starting point for calculation, and proceeding in the reverse order of generation... Following the aforementioned forward guidance trajectory, a reverse power flow state calculation process is initiated and iterated. After the reverse power flow state calculation process is completed, one or more stored power flow states and the reverse iteration trajectory are filled into a preset text template as the final training samples. In each iteration: the sensitivity information pre-recorded at the convergence point corresponding to this iteration is obtained from the forward guidance trajectory as guidance; based on the obtained sensitivity information, the current control variables are adjusted along the direction of restoring system convergence; power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generation trajectory set.
[0065] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; 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. Those skilled in the art can understand and implement this without any creative effort.
[0066] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0067] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating training corpus for power flow adjustment based on sensitivity, characterized in that, include: By forward sampling, a forward guiding trajectory of the power flow state of the power system is generated. The forward guiding trajectory contains multiple convergent state points arranged in the order of generation, and records the corresponding sensitivity information of the objective function of each convergent state point to the pre-selected control variables. The forward guiding trajectory eventually leads to a non-convergent state. Starting with the control variables in the non-convergent state as the calculation starting point, and traversing the forward guiding trajectory in the reverse order of generation, a reverse power flow state calculation process is initiated and iterated. After the reverse power flow state calculation process is completed, the stored one or more power flow states and the reverse iteration trajectory are filled into a preset text template as the final training sample. In each iteration: from the positive guidance trajectory, the sensitivity information pre-recorded at the convergence state point corresponding to this iteration is obtained as guidance; based on the obtained sensitivity information, the current control variables are adjusted along the direction of restoring the convergence of the system. Power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generated trajectory set.
2. The method for generating training corpus based on sensitivity-based power flow adjustment according to claim 1, characterized in that, The positive guidance trajectory is generated through the following positive sampling process: Obtain a converged power flow state of the power system as the starting point; Based on the current convergent power flow state, calculate the sensitivity of the preset objective function used to characterize the system convergence to each control variable, and associate the sensitivity with the current convergence state point. Apply a perturbation to the control variable with the highest sensitivity to update the value of that control variable; Power flow calculations are performed based on the updated control variables to obtain a new power flow state, and it is then determined whether the new power flow state has converged. If convergence is achieved, the new power flow state is taken as the current converged power flow state, and the process returns to calculate the sensitivity. If convergence fails, the new power flow state will be taken as the endpoint of the positive guiding trajectory, and the positive sampling process will end.
3. The method for generating training corpus based on sensitivity-based power flow adjustment according to claim 2, characterized in that, The objective function used to characterize the system convergence is the maximum mismatch in the power flow equations of the power system.
4. The method for generating training corpus based on sensitivity-based power flow adjustment according to claim 3, characterized in that, The calculation of the sensitivity of the pre-defined objective function characterizing the system convergence to each control variable includes: The gradient or norm of the objective function with respect to each control variable is calculated and used as the result of the sensitivity calculation.
5. The method for generating training corpus based on sensitivity-based power flow adjustment according to claim 1, characterized in that, The method further includes: A difficulty assessment is performed on one or more power flow states stored in the reverse-generated trajectory set.
6. The method for generating training corpus based on sensitivity-based power flow adjustment according to claim 5, characterized in that, The difficulty assessment is based on a comprehensive score selected from at least one or more of the following indicators: The condition number of the Jacobian matrix for power flow calculation; Unbalance quantities in power flow equations; The number of adjustment steps required to reach the current power flow state from the initial non-convergent state; Convergence margin of control variables.
7. The method for generating training corpus based on sensitivity power flow adjustment according to claim 5 or 6, characterized in that, The method also includes: Based on the difficulty assessment results, one or more power flow states stored in the reverse generated trajectory set are organized into one or more difficulty-level datasets for course learning.
8. A sensitivity-based power flow adjustment training corpus generation system, characterized in that, include: The forward trajectory generation module is used to generate a forward guiding trajectory of the power flow state of the power system through forward sampling. The forward guiding trajectory contains multiple convergence state points arranged in the generation order, and records the corresponding sensitivity information of the objective function to the pre-selected control variables at each convergence state point. The forward guiding trajectory eventually leads to a non-convergent state. The reverse iteration module is used to start a reverse power flow state calculation process by taking the control variables in the non-converged state as the starting point of the calculation and traversing the forward guidance trajectory in the reverse order of generation, and performing iteration. In each iteration: from the forward guiding trajectory, the sensitivity information pre-recorded at the convergence state point corresponding to this iteration is obtained as guidance; based on the obtained sensitivity information, the current control variables are adjusted along the direction of restoring the convergence of the system; power flow calculation is performed based on the adjusted control variables to obtain a new power flow state, and the new power flow state is stored in the reverse generation trajectory set; The sample output module is used to fill one or more stored power flow states and reverse iteration trajectories into a preset text template after the reverse power flow state calculation process is completed, as the final training samples.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the sensitivity-based power flow adjustment training corpus generation method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the sensitivity-based power flow adjustment training corpus generation method as described in any one of claims 1 to 7.