Topological optimization reconstruction method and system based on machine learning
Through the topological optimization reconstruction method based on machine learning, the XGBoost model is used to predict and screen the state of line switching, combined with the trend check and conflict rollback mechanism, the complexity and real-time requirements of the distribution network reconstruction problem are solved, and efficient and reliable reconstruction strategy optimization is achieved.
Patent Information
- Application Number
- CN202510848005.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Distribution grid reconstruction problem is difficult to quickly adjust due to complexity and real-time requirements in high-voltage distribution networks. Traditional optimization methods have complex calculation time and are difficult to adapt to dynamic changes, resulting in ineffective solution.
The topological optimization reconstruction method based on machine learning is adopted, and the line switching state prediction is predicted using the XGBoost model, combined with predicted probability screening and solution, fixed variables through high confidence decisions, optimize solution space by using low confidence decisions, and combined with the trend check and conflict rollback mechanism to ensure the reliability and security of the reconstruction strategy.
It significantly improves the solution efficiency and reliability of distribution network reconstruction, shortens calculation time, optimizes line power loss, and ensures the safety and reliability of the reconstruction strategy.
Smart Images

Figure CN120389397A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system operation decision-making, and particularly to a topology optimization and reconstruction method and system based on machine learning. Background Art
[0002] Power system operation decision-making involves the optimal allocation and scheduling of power grid resources to ensure the safe, stable and economic operation of the system. In this process, distribution network reconstruction, as an important operation decision-making means, changes the network topology by adjusting the switch states in the distribution network to optimize the operation state of the power grid. The core of the distribution network reconstruction problem lies in how to select the optimal switch combination to achieve specific optimization goals under the premise of meeting the system constraint conditions.
[0003] However, the distribution network reconstruction problem is highly complex. Especially in high-voltage distribution networks, the operation state of the system is dynamically affected by various factors such as load demand, distributed power generation output, and equipment failures. The distribution network reconstruction problem is usually modeled as a mixed-integer quadratic programming (MIQP, Mixed-Integer Quadratic Programming) problem, where the decision variables include both continuous variables (such as voltage and current) and 0-1 integer variables (such as switch states), which makes the solution process complex and time-consuming. Traditional optimization methods can provide accurate solutions at a certain scale, but as the problem scale increases, its calculation time grows exponentially and it is difficult to meet the requirements of real-time decision-making. Moreover, due to the uncertainty of power grid load and distributed power generation output, the distribution network reconstruction decision needs to be dynamically adjusted, while traditional optimization methods usually rely on static models and are difficult to adapt to real-time changes, which exacerbates the difficulty of solving the problem.
[0004] Therefore, how to find a balance between complexity and real-time performance has become an urgent problem to be solved in the research of distribution network reconstruction. Summary of the Invention
[0005] The technical problem to be solved by the present invention is how to quickly adjust the distribution network reconstruction decision according to historical decision data and dynamically changing external parameters. To solve the above technical problem, the present invention provides a topology optimization and reconstruction method and system based on machine learning.
[0006] In the first aspect, an embodiment of the present invention provides a topology optimization and reconstruction method based on machine learning, including: Based on minimizing line power loss, a target distribution network reconstruction model corresponding to the distribution network is constructed, where the decision variables of the target distribution network reconstruction model include line switch states; Obtain the historical reconstruction case data of the distribution network, and perform supervised learning on the initial XGBoost model based on the historical reconstruction case data to obtain the target XGBoost model; Obtain the real-time reconstruction case data of the distribution network, and perform line switch prediction on the real-time reconstruction case data based on the target XGBoost model to obtain the switch prediction value of each line in the distribution network and the prediction probability corresponding to each switch prediction value; Screen each switch prediction value based on the prediction probability to obtain the screening result corresponding to the switch prediction value, where the screening result is a high-confidence decision or a low-confidence decision; Solve the target distribution network reconstruction model based on all the first switch prediction values with the screening result of low confidence decision, and determine the first reconstruction strategy corresponding to the distribution network according to the first solution result and all the second switch prediction values with the screening result of high confidence decision.
[0007] Preferably, after determining the first reconstruction strategy corresponding to the distribution network, it further includes: Perform power flow verification on the first solution result based on the distribution network security constraints to obtain the first verification result; If the first verification result is a failure, roll back the conflicts of all the second switch prediction values to obtain all the third switch prediction values that cause conflicts; Determine the fourth switch prediction value with the lowest confidence among all the third switch prediction values based on the prediction probability corresponding to each third switch prediction value; Solve the target distribution network reconstruction model based on the fourth switch prediction value and all the first switch prediction values to obtain the second solution result; Perform power flow verification on the second solution result based on the distribution network security constraints to obtain the second verification result; If the second verification result is a success, adjust the first reconstruction strategy based on the second solution result, all the second switch prediction values and all the third switch prediction values to obtain the second reconstruction strategy corresponding to the distribution network.
[0008] Preferably, the construction of the target distribution network reconstruction model corresponding to the distribution network based on minimizing the line power loss includes: Construct an initial distribution network reconstruction model corresponding to the distribution network with the goal of minimizing the line power loss; Constrain the initial distribution network reconstruction model to obtain the target distribution network reconstruction model corresponding to the distribution network, where the constraints include power load balance constraints, voltage stability constraints, line load capacity constraints, topological connectivity constraints and equipment capacity constraints.
[0009] Preferably, the target distribution network reconstruction model is characterized by the following formula: where F represents the line power consumption, N represents the number of lines, represents the current of the i-th line, represents the resistance of the i-th line.
[0010] Preferably, obtaining the historical reconstruction case data of the distribution network and performing supervised learning on the initial XGBoost model based on the historical reconstruction case data to obtain the target XGBoost model includes: Obtain the historical reconstruction case data of the distribution network, and perform feature extraction on the historical reconstruction case data to obtain the initial distribution network reconstruction data set; Preprocess the initial distribution network reconstruction data set to obtain the target distribution network reconstruction data set, where the preprocessing includes missing value filling, outlier removal, and data standardization; Solve the target distribution network reconstruction model based on the target distribution network reconstruction data set to obtain the label of each sample in the target distribution network reconstruction data set, where the label is a binary value of the line switch state; Use stratified sampling to divide the target distribution network reconstruction data set into a training set and a test set; Train the initial XGBoost model based on the training set to obtain an intermediate XGBoost model, where the training process includes initializing the model, iteratively constructing decision trees through gradient boosting, and preventing overfitting; Evaluate the intermediate XGBoost model based on the test set, and optimize the intermediate XGBoost model according to the obtained evaluation results to obtain the target XGBoost model, where the evaluation results include accuracy, precision, recall, F1 score, and AUC, and the optimization process includes adjusting the model hyperparameters.
[0011] Preferably, obtaining the real-time reconstruction case data of the distribution network and predicting the line switches based on the target XGBoost model for the real-time reconstruction case data to obtain the switch prediction value of each line in the distribution network and the prediction probability corresponding to each switch prediction value includes: The prediction probability corresponding to the switch prediction value is characterized by the following formula: where represents the prediction probability corresponding to the switch prediction value of the i-th line, represents the switch prediction value of the i-th line.
[0012] Preferably, screening each of the switch prediction values based on the prediction probability to obtain a screening result corresponding to the switch prediction value includes: Screening each of the switch prediction values based on a comparison result between the prediction probability and a preset confidence threshold to obtain a screening result corresponding to the switch prediction value.
[0013] Preferably, screening each of the switch prediction values based on a comparison result between the prediction probability and a preset confidence threshold to obtain a screening result corresponding to the switch prediction value includes: If the prediction probability is greater than or equal to the preset confidence threshold or the prediction probability is less than or equal to the complement of the preset confidence threshold, determining that the screening result corresponding to the switch prediction value is a high-confidence decision; If the prediction probability is less than the preset confidence threshold and the prediction probability is greater than the complement of the preset confidence threshold, determining that the screening result corresponding to the switch prediction value is a low-confidence decision.
[0014] In a second aspect, an embodiment of the present invention provides a topology optimization and reconstruction system based on machine learning, including: A first model construction module, configured to construct a target distribution network reconstruction model corresponding to the distribution network based on minimizing line power loss, where decision variables of the target distribution network reconstruction model include line switch states; A second model construction module, configured to obtain historical reconstruction case data of the distribution network, and perform supervised learning on an initial XGBoost model based on the historical reconstruction case data to obtain a target XGBoost model; A switch prediction module, configured to obtain real-time reconstruction case data of the distribution network, and perform line switch prediction on the real-time reconstruction case data based on the target XGBoost model to obtain a switch prediction value of each line in the distribution network and a prediction probability corresponding to each switch prediction value; A first confidence screening module, configured to screen each of the switch prediction values based on the prediction probability to obtain a screening result corresponding to the switch prediction value, where the screening result is a high-confidence decision or a low-confidence decision; A first strategy determination module, configured to solve the target distribution network reconstruction model based on all first switch prediction values with screening results being low-confidence decisions, and determine a first reconstruction strategy corresponding to the distribution network according to a first solution result and all second switch prediction values with screening results being high-confidence decisions.
[0015] Preferably, it further includes: The first verification module is used to perform power flow verification on the first solution result based on the security constraints of the distribution network to obtain a first verification result; The conflict rollback module is used to, if the first verification result is a failure, perform conflict rollback on all the second switch prediction values to obtain all the third switch prediction values that cause conflicts; The second confidence level screening module is used to determine the fourth switch prediction value with the lowest confidence level among all the third switch prediction values based on the prediction probability corresponding to each third switch prediction value; The model solution module is used to solve the target distribution network reconstruction model based on the fourth switch prediction value and all the first switch prediction values to obtain a second solution result; The second verification module is used to perform power flow verification on the second solution result based on the security constraints of the distribution network to obtain a second verification result; The second strategy determination module is used to, if the second verification result is successful, adjust the first reconstruction strategy based on the second solution result, all the second switch prediction values, and all the third switch prediction values to obtain the second reconstruction strategy corresponding to the distribution network.
[0016] Compared with the prior art, the topology optimization reconstruction method and system based on machine learning in an embodiment of the present invention have the beneficial effects that: by combining the XGBoost algorithm in machine learning to predict the probability of the optimal solution value of 0-1 variables, the solution efficiency and reliability of the distribution network reconstruction are effectively improved; the switch prediction and screening processing based on the prediction probability are performed on the real-time reconstruction case data, different confidence level decisions are distinguished, the prediction variables with high confidence levels are directly locked in values, and the remaining prediction variables with low confidence levels are optimized by solving the target reconstruction model, which not only effectively compresses the solution space dimension of the branch and bound method, but also uses the probability prediction values to establish a feasible solution direction guidance, fundamentally improving the problem of the sharp drop in the solution efficiency caused by the explosion of the dependent variable dimension; the finally determined reconstruction strategy, while reducing the line power loss and optimizing the operation efficiency of the distribution network, ensures the reliability and security of the reconstruction strategy. Description of the Drawings
[0017] Figure 1 is a schematic flow chart of a topology optimization reconstruction method based on machine learning in an embodiment of the present invention; Figure 2 is a schematic flow chart of obtaining the target XGBoost model in an embodiment of the present invention; Figure 3 is a schematic structural diagram of a topology optimization reconstruction system based on machine learning in an embodiment of the present invention; Reference Signs: 1. First model construction module; 2. Second model construction module; 3. Switch prediction module; 4. First confidence screening module; 5. First strategy determination module. Detailed implementation manners
[0018] The following combines the accompanying drawings and embodiments to further describe in detail the specific implementation manners of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.
[0019] In the description of the present invention, it should be understood that the terms "first" and "second" etc. used in the present invention are used to distinguish different objects, rather than to describe a specific order.
[0020] In the description of the present invention, it should be noted that unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as commonly understood by those skilled in the art. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0021] As Figure 1 shown, the embodiment of the present invention provides a topology optimization and reconstruction method based on machine learning, including the steps: S1. Based on minimizing the line power loss, construct a target distribution network reconstruction model corresponding to the distribution network; Specifically, step S1 includes: 1) With the goal of minimizing the line power loss, construct an initial distribution network reconstruction model corresponding to the distribution network; The main goal of the distribution network reconstruction problem is usually to minimize the line power loss and improve the power supply reliability of the system.
[0022] The target distribution network reconstruction model is represented by the following formula: Among them, F represents the line power consumption, N represents the number of lines, represents the current of the i-th line, represents the resistance of the i-th line. The decision variables of the target distribution network reconstruction model include the line switch states.
[0023] 2) Constrain the initial distribution network reconstruction model to obtain the target distribution network reconstruction model corresponding to the distribution network.
[0024] The distribution network reconstruction problem needs to satisfy a series of constraint conditions, which ensure the stability and safety of the power system and the compliance with external demands.
[0025] Specifically, the constraints include power load balance constraints, voltage stability constraints, line load capacity constraints, topological connectivity constraints, and equipment capacity constraints.
[0026] The following specifically describes each constraint: 1) Power load balance constraints In the distribution network reconfiguration, it is necessary to ensure the balance between power supply and load demand. For each node, its power supply and demand powers must satisfy: where, represents the power supply of the -th node, represents the load demand of the -th node, represents the number of nodes.
[0027] 2) Voltage stability constraints The voltage of each node in the distribution network must be maintained within a certain range to ensure the stability of the power system. If the voltage of node is , then for each node, it must satisfy: where, represents the minimum allowable value of the node voltage, represents the maximum allowable value of the node voltage.
[0028] 3) Line load capacity constraints The load of each line must be less than or equal to its maximum carrying capacity to avoid line overload. For each line, its load capacity constraint is: where, represents the maximum load power of the -th line.
[0029] 4) Topological connectivity constraints The distribution network must maintain connectivity to ensure that power can be transmitted from the power source to all load nodes. Specifically, the topological structure of the distribution network should satisfy the following constraint, that is, each load node can be connected to the power source node through a certain path: where, represents the set of lines connected to the load node , represents the connection status of line and load node , if line and load node are connected, then , otherwise , represents the number of load nodes.
[0030] 5) Equipment capacity constraint The load of each transformer and switchgear shall not exceed its maximum capacity. If the maximum capacity of the equipment is , then the following constraints are available: Among them, represents the load of the equipment , represents the number of equipment.
[0031] S2. Obtain the historical reconstruction case data of the distribution network, and perform supervised learning on the initial XGBoost model based on the historical reconstruction case data to obtain the target XGBoost model; In the traditional method for solving the distribution network reconstruction problem, it usually relies on a professional optimization solver. However, when dealing with large-scale distribution network reconstruction problems, due to the large number of variables and constraints involved, and the objective function including non-linear terms, simply relying on traditional solvers to solve often encounters challenges such as a sharp increase in computational complexity and excessive solution time, especially in scenarios with high real-time requirements or large system scales. Therefore, the present invention deeply combines a machine learning model with an operations research optimization method, and uses the efficient prediction ability of machine learning to accelerate the solution process of the distribution network reconstruction problem, thereby greatly improving the computational efficiency.
[0032] Specifically, as Figure 2 shown, step S2 includes: S201. Obtain the historical reconstruction case data of the distribution network, and perform feature extraction on the historical reconstruction case data to obtain the initial distribution network reconstruction data set; When predicting the optimal solution value probability of the 0-1 decision variable for distribution network reconstruction based on the XGBoost algorithm in machine learning, it is necessary to accurately label and reasonably divide the historical distribution network data to generate high-quality samples suitable for model training. Therefore, it is necessary to collect historical reconstruction case data and construct a sample set including distribution network reconstruction problems.
[0033] Specifically, by performing feature extraction on the historical reconstruction case data, an initial distribution network reconstruction data set including distribution network reconstruction problems is obtained. The initial distribution network reconstruction data set includes samples, and the feature vector of each sample includes several extracted features.
[0034] In a specific embodiment, several extracted features include: 1) Graph features in the distribution network topology structure data Node degree, common neighbors, Jaccard coefficient, Adamic-Adar index, preferential attachment. Specifically, the Jaccard coefficient is used to measure the similarity and difference between finite sample sets, and its value is equal to the ratio of the intersection to the union of the sample sets; the Adamic-Adar index is used to measure the similarity between nodes in the distribution network. Its basic idea is to measure node similarity based on the number of common neighbors. The more common neighbors there are, the higher the node similarity; preferential attachment means that new nodes in the distribution network tend to connect to existing nodes with high connectivity degrees.
[0035] 2) Parameter features in the power system data Power system load, transformer power factor, transformer redundancy coefficient.
[0036] 3) Parameter features in the line data Maximum allowable current, resistance, reactance.
[0037] 4) Measurement features in the line data Active power, reactive power, voltage, current, line connection status.
[0038] 5) Switch device status features in the switch-disconnector data Switch status.
[0039] 6) Disconnector device status features in the switch-disconnector data Positive bus disconnector status, negative bus disconnector status.
[0040] 7) Parameter features in the transformer data High-voltage side resistance, medium-voltage side resistance, low-voltage side resistance.
[0041] 8) Measurement features in the transformer data High-voltage side switch status, medium-voltage side switch status, low-voltage side switch status, high-voltage side active power, medium-voltage side active power, low-voltage side active power.
[0042] Through feature extraction, comprehensive data support is provided for subsequent machine learning modeling and optimization solving.
[0043] S202. Preprocess the initial distribution network reconstruction data set to obtain the target distribution network reconstruction data set; To improve data quality and lay a foundation for the training of machine learning models, it is necessary to preprocess the initial distribution network reconstruction data set to obtain the target distribution network reconstruction data set. Specifically, the preprocessing includes missing value filling, outlier removal, and data standardization.
[0044] The following is a specific description of each preprocessing operation: 1) Missing value imputation Missing values are imputed by interpolation. If in the th sample, the value of feature is missing, it can be filled with the mean value of this feature in the remaining samples. The specific formula is as follows: where, represents the value of feature in the th sample, and represents the number of all samples without missing values. Imputing missing values by interpolation ensures the integrity of the data.
[0045] 2) Outlier removal The interquartile range method (IQR, Inter - Quartile Range) is used to detect and remove outliers. If the first quartile of feature is Q1 and the third quartile is Q3, then the interquartile range of this feature is IQR = Q3 - Q1. According to the IQR principle, if the value of a certain sample satisfies or , it is regarded as an outlier and removed. By removing outliers, the adverse effects of extreme data on subsequent model training can be avoided.
[0046] 3) Data standardization Data standardization is used to eliminate the influence of different dimensions on model training and ensure that each feature is processed on the same scale. Specifically, the following formula is used for standardization: where, represents the standardized feature value, represents the mean value of feature , and represents the standard deviation of feature . Through standardization, the mean value of all features is 0 and the standard deviation is 1, which can avoid model training bias caused by different dimensions and is beneficial to improving the stability and convergence speed of the model.
[0047] S203. Solve the target distribution network reconstruction model based on the target distribution network reconstruction dataset to obtain the label of each sample in the target distribution network reconstruction dataset; Specifically, the label is a binary value of the line switch state, where 0 corresponds to off and 1 corresponds to on. Therefore, the target distribution network reconstruction dataset can be defined as: Among them, represents the feature vector of the first sample, represents the label of the first sample, and the remaining variables can be inferred accordingly.
[0048] Furthermore, the generated labels not only need to be consistent with the feature vectors but also should have physical interpretability. Therefore, the importance of features can be evaluated by calculating the correlation between the feature vectors and the labels.
[0049] S204. Use stratified sampling to divide the target distribution network reconstruction dataset into a training set and a test set; To ensure the accuracy and robustness of model training, data balance needs to be guaranteed when dividing the target distribution network reconstruction dataset into a training set and a test set. If in the dataset, the samples with label 1 are positive samples and the samples with label 0 are negative samples, and the numbers of the two types of samples are respectively and , represents the number of positive samples, represents the number of negative samples, then the distribution ratio of the labels is: Among them, represents the proportion of the number of positive samples or the proportion of the number of negative samples, represents the number of samples.
[0050] To keep the label distributions of the training set and the test set consistent with the entire dataset, use the stratified sampling method to sample positive and negative samples in equal proportions. Through stratified sampling, it can effectively prevent the model from overfitting or underfitting to a certain category during the training process. If the proportion of the training set is , and the proportion of the test set is , then the numbers of samples in the training set and the test set are respectively: Among them, represents the number of samples in the training set, represents the number of samples in the test set. Specifically, in this embodiment, the proportion of the training set is set to 0.7 and the proportion of the test set is set to 0.3.
[0051] S205. Train the initial XGBoost model based on the training set to obtain an intermediate XGBoost model; It should be noted that in the line switch state prediction task of distribution network reconstruction, the present invention uses the XGBoost model as the training core, considering that the XGBoost model has high computational performance, excellent prediction accuracy, and strong modeling ability for complex non-linear relationships. Through random feature subset sampling and decision tree ensemble learning, it can effectively mine the deep association between the characteristics of the distribution network and the line switch state, and has good robustness and generalization ability, especially suitable for dealing with the high-dimensional feature space and dynamic operation scenarios of the distribution network. At the same time, the XGBoost model achieves an excellent balance between computational efficiency and model performance, can quickly adapt to the physical characteristics of the reconstruction problem, and ensure the reliability and stability of the prediction results.
[0052] To further improve the accuracy and adaptability of the initial XGBoost model, this step trains the initial XGBoost model based on the training set to obtain an intermediate XGBoost model, thereby enhancing the robustness and practical value of the model. Specifically, the training process includes initializing the model, iteratively constructing decision trees through gradient boosting, and preventing overfitting.
[0053] The following specifically describes each step of the training process: 1) Initialize the model For this binary classification task of predicting the line switch state of distribution network reconstruction, initialize the predicted values of all samples to a constant value. Specifically, the initial predicted value is calculated using the following formula: Among them, represents the initial predicted value, represents the proportion of the number of positive samples.
[0054] 2) Training objective function The objective function of the initial XGBoost model consists of a loss function and a regularization term, and the objective function is characterized by the following formula: Among them, represents the loss function, which is used to measure the difference between the predicted value and the true value , represents the regularization term, which is used to control the complexity of the model and prevent overfitting, represents the th decision tree, represents the number of decision trees.
[0055] Specifically, for the binary classification task, the logarithmic loss is used, that is: Among them, represents the predicted value The corresponding predicted probability.
[0056] Furthermore, the regularization term is characterized by the following formula: where represents the number of leaf nodes, represents the weights of the leaf nodes, and represents the regularization coefficient.
[0057] 3) Construct a decision tree through gradient boosting iteration In each iteration there is: i) For each sample , calculate the first-order gradient and the second-order gradient of the loss function: ii) Generate a decision tree Based on the gradient information, construct a decision tree to minimize the objective function. Specifically, the process of generating a decision tree includes: a) Feature selection Based on the greedy algorithm, select the feature and split point that cause the largest decrease in the objective function.
[0058] b) Calculate the weights of the leaf nodes For each leaf node , calculate the weight using the following formula : where represents the set of samples belonging to the leaf node .
[0059] c) Update the predicted value Add the newly generated decision tree to the model and update the predicted value: where represents the learning rate, which is used to control the contribution of each decision tree.
[0060] 4) Prevent overfitting Specifically, overfitting is prevented through regularization and pruning, including the following methods: 41) Introduce a regularization term Add a regularization term to the objective function to limit the weights of the leaf nodes and the structural complexity of the decision tree.
[0061] 42) Limit the maximum depth Set the maximum depth of the decision tree to avoid generating an overly complex tree.
[0062] 43) Set the minimum loss reduction threshold Set the minimum loss reduction threshold when splitting nodes to avoid ineffective splitting.
[0063] 44) Subsampling Randomly select some samples or features for training in each iteration to improve the generalization ability of the model.
[0064] S206. Evaluate the intermediate XGBoost model based on the test set, and optimize the intermediate XGBoost model according to the obtained evaluation results to obtain the target XGBoost model.
[0065] For the distribution network reconstruction problem, the core of the evaluation stage is to analyze the switch prediction results of each line. Construct a confusion matrix with the prediction results and the true results. The true positives (TP), false positives (FP), false negatives (FN), and true negatives (TN) for each category are defined as follows: TP: The number of samples where the predicted value of the line switch is on and it is actually on; FP: The number of samples where the predicted value of the line switch is on but it is actually not on; FN: The number of samples where the predicted value of the line switch is off but it is actually not off; TN: The number of samples where the predicted value of the line switch is off and it is actually off.
[0066] Based on the above definitions, multiple evaluation results can be calculated. Specifically, the evaluation results include accuracy, precision, recall, F1 score, and AUC.
[0067] The following specifically explains the calculation method of each evaluation result: 1) Accuracy Accuracy Indicates the proportion of correct predictions by the model. The calculation formula is: Accuracy is a measure of the overall classification effect and is suitable for measuring the overall performance of the model.
[0068] 2) Precision Precision Indicates the proportion of true positives in the predictions of a certain category by the model. The calculation formula is: A high precision indicates that the model has fewer misclassifications for the prediction of this category.
[0069] 3) Recall Recall rate It represents the proportion of samples that are actually of a certain category and are correctly classified. The calculation formula is: A high recall rate indicates that the model has fewer misjudgments in predicting this category.
[0070] 4) F1 score The F1 score represents the harmonic mean of precision and recall, and is applicable to comprehensively measuring the classification performance of the model for a certain category. The calculation formula is: 5) AUC AUC (Area Under the Curve), by calculating the area under the ROC (Receiver Operating Characteristic Curve), measures the discrimination ability of the model for samples of a certain category and samples of the remaining categories.
[0071] To comprehensively evaluate the model performance, an overall reliability score can be defined , and the calculation formula is: Among them, respectively represent the precision, recall rate, F1 score, and AUC after taking the macro-average for all categories, and the weights satisfy . Specifically, in this embodiment, each weight is set to 0.2, that is, the weights of each index are equal.
[0072] When the overall performance of the intermediate XGBoost model meets the first preset condition, it is considered that the intermediate XGBoost model has good reliability and generalization ability; when some performance indicators do not reach the second preset condition, the intermediate XGBoost model needs to be optimized to obtain the target XGBoost model.
[0073] Specifically, the first preset condition in this embodiment is , the recall rate of each category and , and the second preset condition is that the recall rate of positive samples is lower than a specific threshold. Further, the optimization process includes: adjusting the model hyperparameters (increasing the number of decision trees, optimizing the sampling ratio of the feature subset), improving the sample distribution (assigning higher weights to difficult samples to balance the category distribution), and introducing more discriminative features to improve the classification performance of the model.
[0074] S3. Obtain the real-time reconstruction case data of the distribution network, and perform line switch prediction on the real-time reconstruction case data based on the target XGBoost model to obtain the switch prediction value of each line in the distribution network and the prediction probability corresponding to each switch prediction value; Specifically, the prediction probability corresponding to the switch prediction value is characterized by the following formula: Wherein, represents the prediction probability corresponding to the switch prediction value of the i-th line, represents the switch prediction value of the i-th line. It should be noted that, is actually the prediction probability corresponding to the switch prediction value of the i-th line when it is turned on.
[0075] S4. Screen each switch prediction value based on the prediction probability to obtain the screening result of the corresponding switch prediction value; Specifically, each switch prediction value is screened based on the comparison result between the prediction probability and the preset confidence threshold to obtain the screening result of the corresponding switch prediction value. The screening result is a high-confidence decision or a low-confidence decision.
[0076] Furthermore, if the prediction probability is greater than or equal to the preset confidence threshold or the prediction probability is less than or equal to the complement of the preset confidence threshold, it is determined that the screening result of the corresponding switch prediction value is a high-confidence decision. In this embodiment, the preset confidence threshold is 0.9. If the prediction probability ≥ 0.9 or the prediction probability ≤ 0.1, it is determined that the screening result of the corresponding switch prediction value is a high-confidence decision, and its binary classification result is directly fixed as 1 or 0.
[0077] Furthermore, if the prediction probability is less than the preset confidence threshold and the prediction probability is greater than the complement of the preset confidence threshold, it is determined that the screening result of the corresponding switch prediction value is a low-confidence decision. In this embodiment, if 0.1 < prediction probability < 0.9, it is determined that the screening result of the corresponding switch prediction value is a low-confidence decision, and its binary classification result is retained as the integer variable to be optimized in the target distribution network reconstruction model.
[0078] S5. Solve the target distribution network reconstruction model based on all the first switch prediction values with screening results of low-confidence decisions, and determine the first reconstruction strategy corresponding to the distribution network according to the first solution result and all the second switch prediction values with screening results of high-confidence decisions.
[0079] By fixing some variables through the high-confidence probability results, the scale of the distribution network reconstruction problem is reduced, the search space of the branch and bound tree is decreased, and the solution of the target distribution network reconstruction model is accelerated. At the same time, the low-confidence probability results are used to provide a feasible solution direction for the target distribution network reconstruction model, avoiding the explosion of the search space caused by random initialization.
[0080] Specifically, based on the first switch prediction values for which all screening results are low-confidence decisions, a solver is used to solve the target distribution network reconstruction model to obtain a first solution result, and based on the first solution result and the second switch prediction values for which all screening results are high-confidence decisions, a first reconstruction strategy corresponding to the distribution network is determined.
[0081] To ensure the feasibility of the final solution to the distribution network reconstruction problem, in an embodiment of the present invention, a topology optimization reconstruction method based on machine learning further includes the following steps after step S5: 1) Conduct a power flow check on the first solution result based on the distribution network security constraints to obtain a first check result; Use a power flow calculation tool to check whether the first solution result meets the distribution network security constraints. If so, determine that the first check result is successful; otherwise, determine that the first check result is failed. Specifically, the distribution network security constraints include line load limits and voltage limits.
[0082] 2) If the first check result is failed, roll back the conflicts for all the second switch prediction values to obtain all the third switch prediction values that cause conflicts; If the first check result does not meet the distribution network security constraints in the power flow calculation, roll back the conflicts for all the second switch prediction values and identify the third switch prediction values that cause conflicts.
[0083] 3) Based on the prediction probabilities corresponding to each third switch prediction value, determine the fourth switch prediction value with the lowest confidence among all the third switch prediction values; Characterize the third switch prediction value corresponding to the minimum prediction probability as the fourth switch prediction value with the lowest confidence among all the third switch prediction values.
[0084] 4) Based on the fourth switch prediction value and all the first switch prediction values, solve the target distribution network reconstruction model to obtain a second solution result; Based on the fourth switch prediction value and all the first switch prediction values, use a solver to solve the target distribution network reconstruction model to obtain a second solution result.
[0085] 5) Conduct a power flow check on the second solution result based on the distribution network security constraints to obtain a second check result; Use a power flow calculation tool to check whether the second solution result meets the distribution network security constraints. If so, determine that the second check result is successful; otherwise, determine that the second check result is failed.
[0086] 6) If the second check result is successful, adjust the first reconstruction strategy based on the second solution result, all the second switch prediction values, and all the third switch prediction values to obtain a second reconstruction strategy corresponding to the distribution network.
[0087] If the second verification result satisfies the distribution network security constraints in the power flow calculation, the first reconstruction strategy is adjusted based on the second solution result, all the second switch prediction values, and all the third switch prediction values to obtain the corresponding second reconstruction strategy for the distribution network. It can be understood that the second reconstruction strategy includes the final switch states of each line in the distribution network.
[0088] It should be noted that the above steps 1) to 6) are actually the power flow verification and conflict rollback mechanism specifically designed for the present invention. For the convenience of understanding, the power flow verification and conflict rollback mechanism will be described from two aspects: the triggering conditions and the data processing process. On the one hand, the mechanism is triggered in two cases: one is that the solver cannot find a feasible solution after fixing the variables, and the other is that the solution of the solver does not satisfy the distribution network security constraints in the power flow calculation. On the other hand, the data processing process includes: first, using a power flow calculation tool to verify whether the optimal solution satisfies the distribution network security constraints such as power balance, power flow constraints, and voltage limits; if the verification fails, conflict rollback is performed, the fixed variables that cause the conflict are identified, and they are sorted according to the confidence level, and the variable with the lowest confidence level is released; then, the solver is called again for optimization, and the power flow verification is repeated until a feasible solution is found or the calculation time limit is reached, so as to ensure that the final reconstruction strategy is further optimized and satisfies the distribution network security constraints.
[0089] In order to verify the effectiveness of an embodiment of a topology optimization reconstruction method based on machine learning of the present invention, in one embodiment, a variety of typical large-scale distribution network reconstruction scenarios are combined, aiming to comprehensively evaluate the applicability and robustness of a topology optimization reconstruction method based on machine learning in practical applications.
[0090] It should be noted that each scenario is modeled based on historical distribution network operation data to ensure the authenticity and representativeness of the experimental environment. Scenario 1 simulates a medium-sized distribution network reconstruction problem, with a system scale of 158 nodes, and the number of constraints in this scenario is 9,638, and the non-linear effect is weak; Scenario 2 simulates a large-scale distribution network reconstruction problem, with a system scale of 642 nodes, and the number of constraints in this scenario is 39,265; Scenario 3 simulates an extra-large-scale distribution network reconstruction problem, with a system scale of 1,090 nodes, and the constraint conditions in this scenario are highly coupled, and the variable dimension is extremely high. Specifically, the experimental results under each scenario are shown in Table 1.
[0091] Table 1 Experimental results under different scenarios Among them, the unit of time consumption is seconds, and the unit of energy consumption is kilowatt-hours. According to the analysis results, compared with the traditional method, the present invention significantly reduces the calculation time in all scenarios. In Scenario 1, the present invention saves approximately 270.4 seconds, and the saving percentage is approximately 25.7%; in Scenario 2, it saves approximately 981.8 seconds, and the saving percentage reaches 30.4%, showing the most significant optimization effect; in Scenario 3, it saves approximately 1619.4 seconds, and the saving percentage is approximately 25.0%. Generally speaking, the present invention can significantly improve the calculation efficiency, reduce the time consumption, and is applicable to various calculation scenarios.
[0092] An embodiment of the present invention provides a topology optimization and reconstruction method based on machine learning, which combines the XGBoost algorithm in machine learning to predict the probability of the optimal solution value of 0-1 variables, effectively improving the solution efficiency and reliability of the distribution network reconstruction; performs switch prediction on the real-time reconstruction case data and screening processing based on the prediction probability, differentiates different confidence decisions, directly locks the values of the high-confidence prediction variables, and optimizes the remaining low-confidence prediction variables by solving the target reconstruction model, which not only effectively compresses the solution space dimension of the branch and bound method, but also uses the probability prediction value to establish a feasible solution direction guidance, fundamentally improving the problem of the sudden drop in the solution efficiency caused by the explosion of the variable dimension; the finally determined reconstruction strategy reduces the line power loss and optimizes the operation efficiency of the distribution network while ensuring the reliability and safety of the reconstruction strategy.
[0093] Based on the above topology optimization and reconstruction method based on machine learning, as Figure 3 shown, an embodiment of the present invention provides a topology optimization and reconstruction system based on machine learning, including: The first model construction module 1 is used to construct a target distribution network reconstruction model corresponding to the distribution network based on minimizing the line power loss, where the decision variables of the target distribution network reconstruction model include the line switch states; The second model construction module 2 is used to obtain the historical reconstruction case data of the distribution network and perform supervised learning on the initial XGBoost model based on the historical reconstruction case data to obtain the target XGBoost model; The switch prediction module 3 is used to obtain the real-time reconstruction case data of the distribution network and perform line switch prediction on the real-time reconstruction case data based on the target XGBoost model to obtain the switch prediction value of each line in the distribution network and the prediction probability corresponding to each switch prediction value; The first confidence screening module 4 is used to screen each switch prediction value based on the prediction probability to obtain the screening result corresponding to the switch prediction value, where the screening result is a high-confidence decision or a low-confidence decision; The first strategy determination module 5 is configured to solve the target distribution network reconstruction model based on the first switch prediction value with low confidence decision for all screening results, and determine the first reconstruction strategy corresponding to the distribution network according to the first solution result and the second switch prediction value with high confidence decision for all screening results.
[0094] Further, an embodiment of the present invention provides a topology optimization reconstruction system based on machine learning, further including: The first verification module is configured to perform power flow verification on the first solution result based on the distribution network security constraints to obtain a first verification result; The conflict rollback module is configured to, if the first verification result is a failure, perform conflict rollback on all second switch prediction values to obtain all third switch prediction values that cause conflicts; The second confidence screening module is configured to determine the fourth switch prediction value with the lowest confidence among all third switch prediction values based on the prediction probability corresponding to each third switch prediction value; The model solution module is configured to solve the target distribution network reconstruction model based on the fourth switch prediction value and all first switch prediction values to obtain a second solution result; The second verification module is configured to perform power flow verification on the second solution result based on the distribution network security constraints to obtain a second verification result; The second strategy determination module is configured to, if the second verification result is successful, adjust the first reconstruction strategy based on the second solution result, all second switch prediction values, and all third switch prediction values to obtain the second reconstruction strategy corresponding to the distribution network.
[0095] It should be noted that each module in the above topology optimization reconstruction system based on machine learning can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form so that the processor can call and execute the operations corresponding to the above modules. For the specific limitations of the topology optimization reconstruction system based on machine learning, refer to the limitations of the topology optimization reconstruction method based on machine learning in the above text. The two have the same functions and effects and will not be elaborated here.
[0096] In summary, in the embodiment of the present invention, a topology optimization and reconstruction method and system based on machine learning combines the XGBoost algorithm in machine learning to predict the probability of the optimal solution value of 0-1 variables, effectively improving the solution efficiency and reliability of the distribution network reconstruction; performs switch prediction and screening processing based on the prediction probability on the real-time reconstruction case data, distinguishes different confidence decisions, directly locks the values of the high-confidence prediction variables, and optimizes the remaining low-confidence prediction variables by solving the target reconstruction model, which not only effectively compresses the solution space dimension of the branch and bound method, but also uses the probability prediction value to establish a feasible solution direction guidance, fundamentally improving the problem of the sudden drop in solution efficiency caused by the explosion of the variable dimension; the finally determined reconstruction strategy reduces the line power loss and optimizes the operation efficiency of the distribution network while ensuring the reliability and safety of the reconstruction strategy.
[0097] Each embodiment in this specification is described in a progressive manner. For the parts that are the same or similar in each embodiment, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered that the scope described in this specification.
[0098] The above is only the preferred embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and replacements can still be made, and these improvements and replacements should also be regarded as the protection scope of the present invention.
Claims
1. A topology optimization reconstruction method based on machine learning, characterized in that Including: Based on minimizing line power loss, a target distribution network reconstruction model corresponding to the distribution network is constructed, wherein the decision variables of the target distribution network reconstruction model include line switch states; The historical reconstruction case data of the distribution network is obtained, and the initial XGBoost model is supervised and learned based on the historical reconstruction case data to obtain a target XGBoost model; The real-time reconstruction case data of the distribution network is obtained, and the line switches are predicted based on the target XGBoost model for the real-time reconstruction case data, so as to obtain the switch prediction values of each line in the distribution network and the prediction probabilities corresponding to each switch prediction value; Each switch prediction value is screened based on the prediction probability to obtain a screening result corresponding to the switch prediction value, wherein the screening result is a high-confidence decision or a low-confidence decision; Based on all the first switch prediction values with the screening results being low-confidence decisions, the target distribution network reconstruction model is solved, and according to the first solution result and all the second switch prediction values with the screening results being high-confidence decisions, a first reconstruction strategy corresponding to the distribution network is determined.
2. The topology optimization reconstruction method based on machine learning according to claim 1, characterized in that, After determining the first reconstruction strategy corresponding to the distribution network, it further includes: Based on the distribution network security constraints, the power flow of the first solution result is verified to obtain a first verification result; If the first verification result is a failure, all the second switch prediction values are conflict-rolled back to obtain all the third switch prediction values that cause conflicts; Based on the prediction probability corresponding to each third switch prediction value, the fourth switch prediction value with the lowest confidence among all the third switch prediction values is determined; Based on the fourth switch prediction value and all the first switch prediction values, the target distribution network reconstruction model is solved to obtain a second solution result; Based on the distribution network security constraints, the power flow of the second solution result is verified to obtain a second verification result; If the second verification result is a success, the first reconstruction strategy is adjusted based on the second solution result, all the second switch prediction values, and all the third switch prediction values to obtain a second reconstruction strategy corresponding to the distribution network.
3. The topology optimization reconstruction method based on machine learning according to claim 1, wherein The constructing a target distribution network reconstruction model corresponding to the distribution network based on minimizing line power loss includes: Taking minimizing line power loss as the target, an initial distribution network reconstruction model corresponding to the distribution network is constructed; The initial distribution network reconstruction model is constrained to obtain the target distribution network reconstruction model corresponding to the distribution network, wherein the constraints include power load balance constraints, voltage stability constraints, line load capacity constraints, topological connectivity constraints, and equipment capacity constraints.
4. The topology optimization reconstruction method based on machine learning according to claim 3, wherein The target distribution network reconstruction model is represented by the following formula: Among them, F represents the line power consumption, and N represents the number of lines. represents the current of the i-th line. represents the resistance of the i-th line.
5. The topology optimization reconstruction method based on machine learning according to claim 1, wherein The obtaining the historical reconstruction case data of the distribution network and supervising and learning the initial XGBoost model based on the historical reconstruction case data to obtain a target XGBoost model includes: The historical reconstruction case data of the distribution network is obtained, and feature extraction is performed on the historical reconstruction case data to obtain an initial distribution network reconstruction data set; Preprocess the initial distribution network reconstruction dataset to obtain a target distribution network reconstruction dataset, where the preprocessing includes missing value filling, outlier removal, and data standardization; Solve the target distribution network reconstruction model based on the target distribution network reconstruction dataset to obtain the label of each sample in the target distribution network reconstruction dataset, where the label is a binary value of the line switch state; Use stratified sampling to divide the target distribution network reconstruction dataset into a training set and a test set; Train the initial XGBoost model based on the training set to obtain an intermediate XGBoost model, where the training process includes initializing the model, iteratively constructing decision trees through gradient boosting, and preventing overfitting; Evaluate the intermediate XGBoost model based on the test set, and optimize the intermediate XGBoost model according to the obtained evaluation results to obtain a target XGBoost model, where the evaluation results include accuracy, precision, recall, F1 score, and AUC, and the optimization process includes adjusting the model hyperparameters.
6. The topology optimization reconstruction method based on machine learning according to claim 1, characterized in that The obtaining the real-time reconstruction case data of the distribution network and predicting the line switches based on the target XGBoost model for the real-time reconstruction case data to obtain the switch prediction value of each line in the distribution network and the prediction probability corresponding to each switch prediction value includes: Use the following formula to represent the prediction probability corresponding to the switch prediction value: Among them, represents the prediction probability corresponding to the switch prediction value of the i-th line, represents the switch prediction value of the i-th line.
7. The topology optimization reconstruction method based on machine learning according to claim 1, characterized in that The screening of each switch prediction value based on the prediction probability to obtain the screening result corresponding to the switch prediction value includes: Screen each switch prediction value based on the comparison result between the prediction probability and a preset confidence threshold to obtain the screening result corresponding to the switch prediction value.
8. The topology optimization reconstruction method based on machine learning according to claim 7, characterized in that, The screening of each switch prediction value based on the comparison result between the prediction probability and a preset confidence threshold to obtain the screening result corresponding to the switch prediction value includes: If the prediction probability is greater than or equal to the preset confidence threshold or the prediction probability is less than or equal to the complement of the preset confidence threshold, determine that the screening result corresponding to the switch prediction value is a high-confidence decision; If the prediction probability is less than the preset confidence threshold and the prediction probability is greater than the complement of the preset confidence threshold, determine that the screening result corresponding to the switch prediction value is a low-confidence decision.
9. A topology optimization reconstruction system based on machine learning, characterized in that, Includes: A first model construction module for constructing a corresponding target distribution network reconstruction model of the distribution network based on minimizing line power loss, where the decision variable of the target distribution network reconstruction model includes the line switch state; A second model construction module for obtaining the historical reconstruction case data of the distribution network and performing supervised learning on the initial XGBoost model based on the historical reconstruction case data to obtain a target XGBoost model; A switch prediction module, configured to obtain real-time reconstruction case data of the distribution network, and perform line switch prediction on the real-time reconstruction case data based on the target XGBoost model, so as to obtain switch prediction values of each line in the distribution network and prediction probabilities corresponding to each of the switch prediction values; A first confidence screening module, configured to screen each of the switch prediction values based on the prediction probability to obtain a screening result corresponding to the switch prediction value, wherein the screening result is a high-confidence decision or a low-confidence decision; A first strategy determination module, configured to solve the target distribution network reconstruction model based on first switch prediction values for which all the screening results are low-confidence decisions, and determine a first reconstruction strategy corresponding to the distribution network according to a first solution result and second switch prediction values for which all the screening results are high-confidence decisions.
10. The topology optimization reconstruction system based on machine learning according to claim 9, characterized in that, It further includes: A first verification module, configured to perform power flow verification on the first solution result based on distribution network security constraints to obtain a first verification result; A conflict rollback module, configured to, if the first verification result is a failure, perform conflict rollback on all the second switch prediction values to obtain third switch prediction values that all cause conflicts; A second confidence screening module, configured to determine a fourth switch prediction value with the lowest confidence among all the third switch prediction values based on the prediction probability corresponding to each of the third switch prediction values; A model solution module, configured to solve the target distribution network reconstruction model based on the fourth switch prediction value and all the first switch prediction values to obtain a second solution result; A second verification module, configured to perform power flow verification on the second solution result based on the distribution network security constraints to obtain a second verification result; A second strategy determination module, configured to, if the second verification result is successful, adjust the first reconstruction strategy based on the second solution result, all the second switch prediction values, and all the third switch prediction values to obtain a second reconstruction strategy corresponding to the distribution network.
Citation Information
Patent Citations
Power distribution network dynamic topology reconstruction method and system with high permeability photovoltaic power generation
CN119209493A
Power distribution network reconstruction method and system considering dynamic line loss treatment
CN119695879A
Distributed big data real-time stream processing method and system
CN120069501A
MIQP problem optimization processing method and system based on improved random branch strategy
CN120073901A
Power grid power flow risk control method based on topology analysis
CN120090199A
Cited By
Power distribution network reconstruction optimization method and system, computer equipment and storage medium
CN120675075A
High-voltage cable classification method and device, terminal equipment and storage medium
CN121302115A