Adversarial attack and defense joint method and system for power distribution network reconfiguration

By generating adversarial examples using a dynamic weight adjustment mechanism based on KL divergence and CW loss in distribution network reconfiguration, and combining this with a progressive training strategy to optimize the DRL agent, the security challenges of deep reinforcement learning in distribution network reconfiguration are addressed, and stable decision-making and defense capabilities are improved.

CN120768603BActive Publication Date: 2026-03-27XIANGTAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Deep reinforcement learning faces security challenges in power grid reconfiguration, including agent decision bias, increased voltage fluctuations, and frequent topology switching. Traditional defense strategies are inefficient and difficult to adapt to dynamic attack scenarios and the needs of power grids of different sizes.

Method used

Adversarial examples are generated using a dynamic weight adjustment mechanism based on KL divergence and CW loss. The DRL agent is optimized by combining a progressive training strategy. Through dual loss function evaluation and dynamic weight adjustment mechanism, more deceptive adversarial examples are generated, and the defense capability is gradually enhanced.

Benefits of technology

It significantly improves the stability and defense capabilities of distribution network reconfiguration decisions, can generate more deceptive adversarial samples, adapts to distribution network systems of different sizes, and achieves stable operation in adversarial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120768603B_ABST
    Figure CN120768603B_ABST
Patent Text Reader

Abstract

The present application relates to the field of power distribution network reconstruction, and particularly relates to a kind of power distribution network reconstruction-oriented combined method of confrontation attack and defense, power distribution network topology reconstruction adaptive confrontation attack and defense system, computer equipment and computer readable storage medium.The present application realizes the significant improvement of attack effect, and can generate more deceptive confrontation samples by double loss function evaluation and dynamic weight adjustment mechanism in the combined method of power distribution network reconstruction-oriented confrontation attack and defense;In the defense stage, progressive training strategy is adopted, so that the model gradually adapts to different intensity of confrontation interference, and the defense ability is significantly enhanced;At the same time, the method does not depend on specific network structure, and has good universality, which can adapt to power distribution network systems of different scales.Through the cooperative optimization of attack and defense, the stability of power distribution network reconstruction decision under confrontation environment is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of power distribution network reconfiguration, and in particular to an adversarial attack and defense joint method for power distribution network reconfiguration, an adaptive adversarial attack and defense system for power distribution network topology reconfiguration, a computer device, and a computer readable storage medium. BACKGROUND

[0002] Current deep reinforcement learning (DRL) in the application of distribution network reconfiguration (DNR) faces significant security challenges. Due to the gradient sensitivity of the multi-layer perception model, a slight data disturbance can cause the agent decision deviation, leading to increased power distribution network loss, intensified voltage fluctuation, and frequent topology switching. Traditional defense strategies use static adversarial training methods, which can improve model robustness, but have three limitations: first, the attack method does not fully consider the characteristics of the discrete action space (such as switch on-off) and physical constraints (such as radial structure) of the power distribution network, resulting in low attack efficiency; second, the defense uses static adversarial training, which is difficult to cope with dynamic attack scenarios; third, existing solutions lack universality and are difficult to adapt to the diverse needs of different scale power grids (such as Institute of Electrical and Electronics Engineers, IEEE 33 / 118 node system). These problems seriously restrict the practical application effect of DRL in distribution network reconfiguration. SUMMARY

[0003] To address the deficiencies in the prior art, one of the purposes of the present application is to provide an adversarial attack and defense joint method for power distribution network reconfiguration, which helps to improve the anti-attack ability of deep reinforcement learning agents in discrete domain power distribution network reconfiguration scenarios and enhance the operation reliability of power grids in complex adversarial environments.

[0004] The second purpose of the present application is to provide a system based on the above-mentioned adversarial attack and defense joint method for power distribution network reconfiguration.

[0005] The third purpose of the present application is to provide a computer device based on the above-mentioned adversarial attack and defense joint method for power distribution network reconfiguration.

[0006] The fourth purpose of the present application is to provide a readable storage medium based on the above-mentioned adversarial attack and defense joint method for power distribution network reconfiguration.

[0007] To solve the above problems, in a first aspect, the present application provides an adversarial attack and defense joint method for power distribution network reconfiguration, comprising:

[0008] Attack phase: generating adversarial samples based on power distribution network state data, comprising:

[0009] (a) calculating KL divergence and CW loss;

[0010] (b) dynamically adjusting weight coefficients according to the gradient amplitude of KL divergence loss and CW loss;

[0011] (c) generating adversarial samples satisfying the discrete switch constraints of the power distribution network through iterative optimization, and inputting the adversarial samples into the DRL agent;

[0012] Defense phase: training the DRL agent to resist adversarial samples, comprising:

[0013] (d) gradually increasing the adversarial attack intensity parameter according to the training round;

[0014] (e) dynamically increasing the mixing ratio of adversarial samples in the training data;

[0015] (f) optimizing the DRL agent parameters to maintain the stability of the topology reconstruction decision.

[0016] As a further improvement of the above-mentioned combined method of adversarial attack and defense for power distribution network reconstruction, the dynamic adjustment of weight coefficients in step (b) comprises:

[0017] calculating the gradient vector amplitude of KL divergence loss;

[0018] calculating the gradient vector amplitude of CW loss;

[0019] determining the weight coefficient according to the inverse relationship between the KL divergence loss gradient vector amplitude and the CW loss gradient vector amplitude.

[0020] As a further improvement of the above-mentioned combined method of adversarial attack and defense for power distribution network reconstruction, the attack phase comprises any one of the following modes:

[0021] Non-target attack mode: generating a set of perturbation samples, and selecting the adversarial sample that minimizes the DRL agent output Q value;

[0022] Target attack mode: generating adversarial samples that induce the DRL agent to output specified actions for a pre-set non-optimal switch action set.

[0023] As a further improvement of the above-mentioned combined method of adversarial attack and defense for power distribution network reconstruction, the adversarial attack intensity parameter in step (d) comprises:

[0024] Attack disturbance amplitude: linearly increasing from an initial value to a maximum value;

[0025] Number of iterations for generating adversarial samples: increasing with the training round;

[0026] Adversarial sample insertion probability: gradually increased based on the product of the initial probability and the training round.

[0027] As a further improvement of the above-mentioned combined method of adversarial attack and defense for power distribution network reconstruction, the optimization of the DRL agent parameters in step (f) includes:

[0028] Minimizing the difference in reward function between the original state and the adversarial state;

[0029] According to the attack intensity parameter corresponding to the current training round, the loss function is calculated.

[0030] As a further improvement of the above-mentioned combined method of adversarial attack and defense for power distribution network reconstruction, at least one of Python3.9.0, Pytorch2.4.0 and pandapower2.14.11 libraries is used to realize model training, simulation and interaction with power distribution network simulation platform, transmission network state data and switch action instruction.

[0031] The combined method of adversarial attack and defense for power distribution network reconstruction of the present application realizes significant improvement of attack effect through double loss function evaluation and dynamic weight adjustment mechanism, and can generate more deceptive adversarial samples; the defense stage adopts a progressive training strategy, which enables the model to gradually adapt to different intensity of adversarial interference, significantly enhancing the defense capability; at the same time, this method does not depend on specific network structure, has good universality, and can adapt to power distribution network systems of different scales. Through the cooperative optimization of attack and defense, the stability of power distribution network reconstruction decision in the adversarial environment is realized.

[0032] In a second aspect, the present application provides a combined system of adversarial attack and defense for power distribution network reconstruction, comprising:

[0033] The attack module comprises:

[0034] The multi-objective induction unit is used to calculate the KL divergence and the CW loss;

[0035] The adaptive weight unit is used to dynamically adjust the weight coefficient according to the gradient amplitude of the KL divergence loss and the CW loss;

[0036] The attack execution unit is used to generate an adversarial sample that satisfies the discrete switch constraint of the power distribution network, and input the adversarial sample into the DRL agent;

[0037] The defense module comprises:

[0038] The course scheduling unit is used to output an attack intensity parameter that increases with the training round;

[0039] The adversarial training unit is used to mix the original data and the adversarial sample in a dynamic proportion.

[0040] a parameter optimization unit configured to optimize the DRL agent parameters to maintain stability of the topology reconfiguration decision.

[0041] As a further improvement of the above-mentioned power distribution network reconfiguration-oriented combined attack and defense system, the attack module and the defense module work cooperatively through data interaction, and dynamically transfer weight coefficients and attack strength parameters.

[0042] Since the above-mentioned system and the above-mentioned power distribution network reconfiguration-oriented combined attack and defense method have the same inventive concept, the above-mentioned system has all the technical effects of the above-mentioned power distribution network reconfiguration-oriented combined attack and defense method.

[0043] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the power distribution network reconfiguration-oriented combined attack and defense method according to any one of the above-mentioned solutions when executing the computer program.

[0044] Since the above-mentioned computer device and the above-mentioned power distribution network reconfiguration-oriented combined attack and defense method have the same inventive concept, the above-mentioned computer device has all the technical effects of the above-mentioned power distribution network reconfiguration-oriented combined attack and defense method.

[0045] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the power distribution network reconfiguration-oriented combined attack and defense method according to any one of the above-mentioned solutions.

[0046] Since the above-mentioned computer readable storage medium and the above-mentioned power distribution network reconfiguration-oriented combined attack and defense method have the same inventive concept, the above-mentioned computer readable storage medium has all the technical effects of the above-mentioned power distribution network reconfiguration-oriented combined attack and defense method. BRIEF DESCRIPTION OF DRAWINGS

[0047] The present application will be further described below in conjunction with the drawings and examples.

[0048] Figure 1 A flowchart of the attack phase of the power distribution network reconfiguration-oriented combined attack and defense method according to an embodiment of the present application.

[0049] Figure 2 A flowchart of the defense phase of the power distribution network reconfiguration-oriented combined attack and defense method according to an embodiment of the present application.

[0050] Figure 3A power distribution network topology diagram according to an embodiment of the present application.

[0051] Figure 4 A PAD-CL defense strategy flow chart according to an embodiment of the present application.

[0052] Figure 5 A comparison chart of effects of different attack methods according to an embodiment of the present application.

[0053] Figure 6 A framework diagram of a joint system of confrontation attack and defense for power distribution network reconstruction according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular sequences of steps, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0055] It should be understood that the term "comprises" when used in this specification and the appended claims, specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0056] It should be understood that the terms used in this specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0057] It should be understood that the term "and / or" as used in this specification of the present application means any one or more of the associated listed items, as well as all possible combinations of the items, and includes these combinations.

[0058] It should be understood that the order of the steps in the embodiments of the present application does not mean the order of execution, and the execution order of the processes should be determined according to their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0059] In order to illustrate the technical solutions described in the present application, the following will be described by specific embodiments.

[0060] Among them, in order to accurately describe and understand the technical solutions described in this application, the related key technical terms are explained or defined first:

[0061] Distribution Network Reconfiguration (DNR): A technique that optimizes the topology of a distribution network by adjusting the state of switches to reduce losses and improve power supply reliability.

[0062] Deep Reinforcement Learning (DRL): An artificial intelligence technology that combines deep learning and reinforcement learning for decision-making in complex dynamic systems.

[0063] Adversarial Attacks: A technique that adds small perturbations to input data to cause machine learning models to produce incorrect outputs.

[0064] Curriculum Learning: A strategy that gradually introduces training tasks from simple to complex to improve model learning efficiency.

[0065] Kullback-Leibler Divergence (KL) is an index that measures the difference between two probability distributions, used to quantify the dissimilarity between two probability distributions. In this application, it is used to quantify the difference between the decision probability distribution of the DRL agent and the true optimal distribution, so as to accurately induce decision bias and achieve adversarial attack on distribution network reconfiguration. Therefore, the core of KL divergence is to quantify the change of DRL agent decision distribution, induce decision bias, and realize effective attack on distribution network reconfiguration model by combining CW loss and dynamic weight mechanism. KL divergence can be expressed as follows:

[0066]

[0067] In the above formula, P and Q represent two probability distributions, i represents a sample, and log is the natural logarithm. KL(P||Q) represents the KL divergence of P relative to Q, which measures the difference between P and Q.

[0068] Carlini & Wagner Loss (CW Loss) is an optimization objective function proposed for adversarial attacks, used to generate adversarial samples. Its core idea is to minimize the logit difference between the target class and other classes to generate perturbations, making the model classification error. CW loss can be expressed as follows:

[0069]

[0070] In the formula, f(x) represents logits of the model output layer, c is a target misclassification label, kappa controls the confidence of misclassification, the greater the value, the higher the confidence of the adversarial sample in the target category, and k is a confidence parameter.

[0071] Referring to Figures 1 to 6 An embodiment of the present application provides an adversarial attack and defense combined method for power distribution network reconstruction, comprising:

[0072] Attack phase: generating adversarial samples based on power distribution network state data, comprising:

[0073] (a) calculating KL divergence and CW loss;

[0074] (b) dynamically adjusting the weight coefficient according to the gradient amplitude of the KL divergence loss and the CW loss;

[0075] (c) generating adversarial samples that meet the discrete switch constraints of the power distribution network through iterative optimization, and inputting the adversarial samples into the DRL agent;

[0076] Defense phase: training the DRL agent to resist adversarial samples, comprising:

[0077] (d) gradually increasing the adversarial attack intensity parameter according to the training round;

[0078] (e) dynamically increasing the mixing ratio of adversarial samples in the training data;

[0079] (f) optimizing the DRL agent parameters to maintain the stability of the topology reconstruction decision.

[0080] The adversarial attack and defense combined method for power distribution network reconstruction of the present application realizes significant improvement of attack effect through double loss function evaluation and dynamic weight adjustment mechanism, and can generate more deceptive adversarial samples; the defense phase adopts a progressive training strategy, so that the model gradually adapts to adversarial interference of different intensities, significantly enhancing the defense capability; at the same time, the method does not depend on a specific network structure, has good universality, and can adapt to power distribution network systems of different scales. Through the cooperative optimization of attack and defense, the stability of the power distribution network reconstruction decision in the adversarial environment is realized.

[0081] In some embodiments of the application, the dynamic adjustment of the weight coefficient in step (b) comprises: calculating the gradient vector amplitude of the KL divergence loss; calculating the gradient vector amplitude of the CW loss; determining the weight coefficient according to the inverse ratio relationship between the KL divergence loss gradient vector amplitude and the CW loss gradient vector amplitude. The dynamic weight adjustment mechanism solves the problem of unstable attack effect caused by the traditional fixed weight method by monitoring the gradient amplitude changes of the KL divergence and the CW loss in real time, establishing an inverse ratio adjustment relationship. This mechanism can automatically adjust the loss weight according to the gradient changes in the training process, ensure the optimal balance of the strategy deviation degree and the action misleading degree in the attack process, and make the generated adversarial samples more targeted.

[0082] In some embodiments of the application, the attack stage comprises any one of the following modes: a non-target attack mode: generating a set of perturbed samples, and selecting an adversarial sample that minimizes the Q value output by the DRL agent; a target attack mode: generating an adversarial sample that induces the DRL agent to output a specified action for a preset set of non-optimal switching actions. The dual-mode attack design covers the complete requirements of power distribution network security testing through the complementary effects of non-target attack and target attack. The non-target attack evaluates the overall vulnerability of the system by minimizing the Q value, and the target attack verifies the defense capability against specific non-optimal actions. The two modes share the same weight adjustment mechanism, optimizing the allocation of attack resources and providing comprehensive test scenarios for defense training. The Q value represents the long-term revenue prediction value of the DRL agent for executing a certain action in a specific state. The higher the Q value, the better the action (such as reducing power grid loss). The lower the Q value, the worse the action (such as increasing loss or causing voltage fluctuation). Therefore, the minimum Q value means that the attacker forges data to make the DRL agent misjudge a high-risk action as the optimal choice. The essence is to induce the power grid to perform destructive operations by manipulating the decision evaluation index.

[0083] In some embodiments of the application, the attack stage comprises any one of the following modes:

[0084] Non-target attack mode (Adversarial Generation and Perturbation Algorithm-Perturbation, AGPA-P):

[0085] 1. Generate M P = 50 random perturbations that satisfy |δ i |≤ε=0.3, forming a perturbation set, where M P represents the maximum perturbation number parameter, ε is the attack amplitude, and δ i represents the adversarial perturbation vector generated for the i-th sample, and i is the sample index.

[0086] 2. Calculate the gradient norm w l, dynamic weight optimizing total loss iterating 20 times to generate an adversarial sample

[0087] 3. inputting the sample into a DQN (Deep Q-Network) imitation model (3 layers of full connection layers: 128-64-32), and selecting a sample that minimizes the Q value.

[0088] an adversarial generation and perturbation algorithm (AGPA-F):

[0089] 1. sampling M F = 30 non-optimal actions A_Target,t (Target Action at time t, target action at time t);

[0090] 2. minimizing generating an adversarial sample through an AGPA (Adversarial Generation and Perturbation Algorithm) algorithm for each action

[0091] 3. retaining a sample that makes the model output equal to the target action, and inducing a switch.

[0092] It should be noted that the above key parameters (including the maximum perturbation number parameter M P = 50, the non-optimal action sampling number M F = 30, and the iteration number of 20 times) are all baseline experimental configurations, and in actual application, they need to be dynamically adjusted in combination with the power distribution network system scale (node number and topological complexity), the power equipment safety threshold, and the attack target (AGPA-P non-target interference or AGPA-F target induction) and other elements, wherein the parameter setting should take into account the attack efficiency and concealment.

[0093] In some embodiments of the application, the adversarial attack strength parameter in step (d) includes: attack perturbation amplitude: linearly increasing from an initial value to a maximum value; iteration number of adversarial sample generation: increasing with training rounds; and adversarial sample insertion probability: gradually increasing based on the product of an initial probability and a training round. The gradual parameter adjustment strategy realizes smooth training through three-stage cooperative optimization: the linear growth of the perturbation amplitude ensures the smoothness of the model adaptation process, the increasing iteration number improves the sample quality, and the dynamic adjustment of the insertion probability optimizes the data distribution. This phased reinforcement training strategy avoids the overfitting phenomenon of the model in the early stage of defense training, and enables the final model to have better generalization ability.

[0094] The progressive parameter adjustment strategy, also known as progressive adversarial defense with curriculum learning (PAD-CL), in some embodiments of the present application, as shown in Figure 4 the core of the "curriculum scheduler" module in the figure is to evaluate the task complexity through the formula and update the adversarial sample generation parameter φ(j) based on this; the additional formula (2) is the mathematical expression of "curriculum scheduler updates φ(j)", which provides a specific calculation method for parameter dynamic adjustment; the first formula of the additional formula (2) defines the update rule of the model parameter : while preserving normal sample learning, it strengthens the adaptation to adversarial samples, which directly corresponds to the step of "inserting adversarial samples and minimizing loss " in the figure.

[0095] Additional formula (1):

[0096] In the above formula, ∈(j): represents the attack amplitude at the jth training iteration. ∈0 is the attack amplitude, and ∈ max is the maximum attack amplitude.

[0097] iters(j) represents the number of adversarial sample generation iterations at the jth training iteration, iters0 is the initial iteration number, and iters max is the maximum iteration number.

[0098] κ(j) is the attack strength parameter at the jth training iteration, κ0 is the initial strength, and κ max is the maximum strength jry_jime(j) is the initial difficulty parameter.

[0099] i(j) is the adversarial sample insertion probability at the jth iteration, i0 is the initial probability, and δ is the attack rate increment, which controls the growth rate of i(j).

[0100] Additional formula (2):

[0101]

[0102] In the above formula, the loss function based on the strategy π, where S is the state of the power distribution network, α is the action (switch operation) of the DRL agent, and θ is the model parameter.

[0103] E: expectation operator, calculates the expected value of the loss based on the data set D. D: training data set, contains the state, action and reward samples of the power distribution network.

[0104] State s is disturbed by δs R is the reward function, the curriculum complexity parameter of the jth iteration. δ s the perturbation increment parameter.

[0105] In some embodiments of the present application, the defense stage: training the DRL agent against adversarial samples, comprising:

[0106] 1. Initialize parameters: α = 0.01, ε0= 0.05, ε max = 0.4, J = 1000; wherein, α represents the initial learning rate, α represents the learning rate decay coefficient, ε0represents the initial perturbation amplitude, ε max represents the maximum perturbation amplitude, and J represents the total training rounds.

[0107] 2. Dynamically adjust the adversarial parameters: insert adversarial samples with a probability , wherein,

[0108] 3. Use the SDG (Stochastic Gradient Descent) optimizer to optimize the loss function and update the model parameters.

[0109] In some embodiments of the present application, the optimization of the DRL agent parameters in step (f) comprises: minimizing the difference between the reward functions in the original state and the adversarial state; and calculating the loss function according to the attack intensity parameter corresponding to the current training round. The double-state reward optimization mechanism compares the reward difference between the original and adversarial states, so that the model can maintain normal decision-making ability while enhancing anti-interference ability. The current attack intensity is innovatively used as a loss weight factor to dynamically match the defense strength and attack difficulty, ensuring that the model can maintain stable decision-making performance under different attack intensities.

[0110] In some embodiments of the present application, at least one of Python 3.9.0, Pytorch 2.4.0, and pandapower2.14.11 libraries is used to realize model training, simulation, and interaction with the distribution network simulation platform, and to transmit power grid state data and switch action instructions. In this embodiment, Python 3.9.0, Pytorch 2.4.0, and pandapower 2.14.11 are used to build a model training and simulation environment, realize data interaction with the distribution network simulation platform, and transmit power grid state data and switch action instructions. This combination of technology stacks not only meets the real-time requirements, but also provides complete power system analysis tool chain support, ensuring efficient collaboration between the system and the simulation platform.

[0111] The present application proposes a complete attack and defense integrated solution for the security challenges in the power distribution network reconstruction scenario. The solution realizes the all-round security protection of the DRL agent of the power system through the three dimensions of innovative attack strategy design, intelligent defense mechanism construction and system integration optimization.

[0112] Adaptive attack strategy design: In view of the discrete domain characteristics of power distribution network reconstruction, an adaptive gradient perturbation attack (AGPA) strategy based on dynamic weight adjustment is developed. This strategy innovatively combines the KL divergence and CW loss double-target evaluation mechanism, dynamically adjusts the attack parameters by monitoring the decision distribution changes of the DRL agent in real time, and ensures that the generated adversarial samples can effectively induce decision bias and meet the physical constraint conditions of the power distribution network. The KL divergence is used to accurately quantify the difference between the decision distribution of the agent and the optimal distribution, and the CW loss function is used to realize targeted interference to the reconstruction model. As shown in Figure 5 The left vertical axis of the figure is the voltage fluctuation of the security model, the right vertical axis is the power loss of the economic model, and the horizontal axis is the attack frequency (number of attacks per day). Compared with the AGPA-P, FGSM (Fast Gradient Sign Method) and PGD (Projected Gradient Descent) attack strategies: AGPA-P (the uppermost line / the rightmost column) when the attack frequency is the highest (24 times / day), the voltage fluctuation increases to 78.89%, and the power loss increases to 13.16%, which is significantly higher than FGSM and PGD. The figure verifies the dynamic weight mechanism of the attack efficiency of AGPA-P with the increase of frequency, and provides a basis for the design of the defense module (PAD-CL) - PAD-CL gradually increases the attack frequency to make the model adapt to high-frequency attacks, and finally reduces the voltage fluctuation caused by AGPA-P by 35.1%.

[0113] Progressive defense mechanism construction: A progressive adversarial defense with curriculum learning (PAD-CL) method is proposed, which introduces different intensity of adversarial samples in stages to realize the step-by-step improvement of defense ability. This method innovatively designs an adaptive adjustment algorithm for the attack intensity parameter, so that the defense model can gradually expand its invariant region, while maintaining the original decision accuracy and significantly improving the robustness to various adversarial attacks. During the defense training process, the security and functionality requirements of the model are dynamically balanced to ensure the practical performance in the real power grid environment.

[0114] The attack-defense integrated system is implemented by integrating the AGPA attack strategy and the PAD-CL defense mechanism, and a complete attack-defense collaborative optimization system is constructed. The system adopts modular design and supports two-way feedback of attack detection and defense training. In particular, for the adaptation needs of power grids of different scales, a general interface specification and data standard are designed to ensure the scalability and applicability of the technical solution in various distribution grid scenarios, and to provide reliable protection for the safe operation of power system agents. As shown in Figure 3 The partial distribution automation upgraded distribution network (such as IEEE 33 node system) in the figure, in which the switches of nodes 5-6 complete the "three remote" function transformation (remote telemetry, remote signaling, remote control), can participate in distribution network reconfiguration (DNR). By opening the switch of line 5-6 and closing the switch of line 12-8, it is shown how DNR adjusts the topology structure to optimize power loss and voltage fluctuation while maintaining the radial structure (no loop) of the distribution network. The figure directly verifies the radial constraint condition, that is, the network must maintain a tree structure before and after DNR. The design of the attack module (AGPA) and the defense module (PAD-CL) is based on this topology constraint - for example, AGPA-F destroys the radial structure by forcing high-frequency switching, while PAD-CL maintains stability by training the model to identify legal topology.

[0115] In summary, the attack-defense joint method for distribution network reconfiguration of the present application realizes significant improvement of attack effect through double loss function evaluation and dynamic weight adjustment mechanism, and can generate more deceptive adversarial samples; the defense stage adopts a gradual training strategy, which makes the model gradually adapt to different intensity of adversarial interference, significantly enhancing the defense ability; at the same time, the method does not depend on a specific network structure, and has good universality, which can adapt to distribution grid systems of different scales. Through the collaborative optimization of attack and defense, the stability of distribution network reconfiguration decision in the adversarial environment is realized.

[0116] On the other hand, as Figure 6As shown, this invention provides a joint adversarial attack and defense system for distribution network reconfiguration, comprising: an attack module including: a multi-target induction unit for calculating KL divergence and CW loss; an adaptive weighting unit for dynamically adjusting weight coefficients based on the gradient magnitudes of the KL divergence loss and CW loss; an attack execution unit for generating adversarial samples that satisfy the discrete switching constraints of the distribution network and inputting the adversarial samples into a DRL agent; and a defense module including: a curriculum scheduling unit for outputting attack strength parameters that increase with each training round; an adversarial training unit for dynamically mixing the original data and adversarial samples; and a parameter optimization unit for optimizing the parameters of the DRL agent to maintain the stability of topology reconfiguration decisions. The modular design of the system forms a closed-loop optimization mechanism through the collaborative work of the attack and defense modules. The multi-target induction unit generates high-quality adversarial samples, the curriculum scheduling unit implements progressive training, and the parameter optimization unit ensures continuous model improvement. This architecture enables the system to adapt to constantly changing adversarial environments and maintain long-term stable operating performance.

[0117] In some embodiments of the present invention, the adversarial attack and defense joint system for distribution network reconfiguration provided by the present invention includes an attack module and a defense module connected to each other. Adversarial samples generated by the attack module serve as training data input to the defense module. The defense module adjusts the generation strategy of the adversarial samples through parameter optimization feedback to achieve closed-loop optimization of attack and defense. The attack module includes a multi-target induction unit, an adaptive weighting unit, and an attack execution unit. The multi-target induction unit is used to generate KL divergence and CW loss; the adaptive weighting unit is used to calculate the dynamic weight λ based on the KL divergence and CW loss. l The gradient conflicts in multi-objective losses are balanced and transmitted to the attack execution unit. The attack execution unit generates adversarial examples and inputs them into the input layer of the DRL agent. The defense module includes a curriculum scheduling unit, an adversarial training unit, and a parameter optimization unit. The curriculum scheduling unit generates complexity parameters and transmits them to the adversarial training unit. The adversarial training unit inserts adversarial examples and outputs them to the parameter optimization unit via a data bus. The parameter optimization unit optimizes the DRL agent parameters to maintain the stability of topology reconstruction decisions. The attack and defense modules work collaboratively through data interaction, ensuring dynamic matching between attack examples and defense training, supporting security assessment and defense training for distribution networks of different scales.

[0118] In some embodiments of the present invention, the attack module and the defense module work together through data interaction to dynamically transmit weight coefficients and adversarial attack strength parameters, ensuring the matching between attack sample generation and defense training.

[0119] The combined system for counter-attack and defense against power distribution network reconfiguration provided in this invention has the following characteristics:

[0120] Attack module technical implementation: The attack module (AGPA) generates efficient adversarial samples through a multi-objective optimization framework, which is composed of three key components. First, based on real-time operation data of the power distribution network (including load prediction, voltage measurement, topology structure, and distributed energy output, etc.), an input feature space is constructed. Second, the KL divergence is used to quantify the decision distribution deviation of the DRL agent, and the CW loss is used to enhance the adversarial strength, forming a dual-objective attack inducer. Finally, through a dynamic adaptive weight mechanism, the weight ratio of KL divergence and CW loss is adjusted in real time according to the inverse relationship of gradient norm. Through iterative optimization under constraints, the module can generate adversarial samples that cause significant decision deviation of the DRL model, specifically manifested as abnormal increase in power loss and irrational increase in topology switching frequency, etc.

[0121] Defense module working mechanism: The defense module (PAD-CL) adopts a curriculum learning paradigm to build a progressive defense system. Its innovation lies in: based on the adversarial samples output by the attack module, dynamically adjusting the training parameter complexity, including the key parameters such as the attack amplitude ε and the disturbance frequency ρ that increase linearly with the training rounds; designing an intelligent sample mixing strategy to combine adversarial samples and clean samples in the optimal proportion; finally optimizing the model parameters through the stochastic gradient descent algorithm. Experimental verification shows that this defense mechanism can effectively suppress voltage fluctuations and abnormal topology switching caused by adversarial attacks, significantly improving system robustness.

[0122] Module collaborative optimization mechanism: The system realizes the collaborative evolution of attack and defense capabilities through bidirectional data interaction: the defense module uses adversarial samples as training data and adopts a progressive reinforcement strategy to gradually improve the model's anti-interference capability; at the same time, the effectiveness of the attack module is verified by the performance retention of the model after defense, forming a closed-loop evaluation system. This interactive mechanism ensures that the attack strength and defense capability remain in dynamic balance, for example, in typical test scenarios, the system can effectively control the power loss caused by adversarial attacks within the safe threshold range.

[0123] System overall value embodiment: Through the iterative optimization of attack and defense modules, this scheme builds a complete power distribution network security protection closed loop. Its core value lies in: ensuring that the DRL agent can still make stable decisions in an adversarial environment, specifically manifested as controlling key operating indicators (such as power loss and voltage fluctuation) within the safe threshold range; at the same time, through the continuous evolution of attack and defense, the system's defense capability against new attacks is continuously improved, providing a solid guarantee for the safe and reliable operation of the intelligent power distribution network.

[0124] Data input and processing mechanism: The system input data contains two key dimensions: real-time operation state data of the power distribution network (including power distribution, voltage amplitude, switch state, and other physical quantity measurement data) and attack strategy configuration parameters (such as KL / CW loss weight ratio, disturbance amplitude limit, etc.). Among them, the operation state data is the basic input of the model, and the attack parameters guide the generation process of the adversarial samples through the optimization algorithm. These two types of data, through specific encoding conversion mechanism, together constitute the data basis of AGPA attack and PAD-CL defense system.

[0125] Dynamic weight adjustment mechanism: AGPA attack strategy innovatively adopts a dynamic adjustment algorithm of "weight inversely proportional to gradient norm". This mechanism automatically adjusts the weight ratio of KL divergence (quantifying decision bias) and CW loss (controlling adversarial intensity) by monitoring the gradient changes of the two in real time. This dynamic balance design effectively solves the conflict problem in multi-objective optimization, prevents the over-dominance of a single target, and significantly improves the attack efficiency in discrete action space. It is the core technical feature to ensure the quality of adversarial sample generation.

[0126] Attack and defense collaborative optimization system: On the defense side, the PAD-CL strategy realizes progressive reinforcement through the curriculum learning framework: the attack intensity parameter ε and the sample insertion probability p are dynamically adjusted with the training round, gradually increasing from the initial low intensity (ε = 0.05) to the target intensity (ε = 0.4). During the training process, the progressive adversarial training unit mixes the original samples and adversarial samples according to the scheduling strategy, forcing the DRL model to learn more generalizable feature representations. This "easy to difficult" training paradigm allows the model to gradually expand its decision invariant region, ultimately significantly improving the ability to resist adversarial interference while maintaining the original performance.

[0127] In another aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the power distribution network reconstruction-oriented adversarial attack and defense joint method according to any one of the above embodiments when executing the computer program.

[0128] Since the above computer device and the above power distribution network reconstruction-oriented adversarial attack and defense joint method have the same inventive concept, the above computer device has all the technical effects of the above power distribution network reconstruction-oriented adversarial attack and defense joint method.

[0129] It can be understood that the computer device can be a server. The computer device comprises a processor, a memory, an input / output interface (I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the data cluster data of the power monitoring system. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement an attack and defense joint method based on power distribution network reconstruction.

[0130] In another aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the attack and defense joint method based on power distribution network reconstruction.

[0131] Since the above computer readable storage medium and the attack and defense joint method based on power distribution network reconstruction have the same inventive concept, the above computer readable storage medium has all the technical effects of the attack and defense joint method based on power distribution network reconstruction.

[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0133] The above-mentioned embodiments only express several embodiments of the present application, which are described in a more specific and detailed manner, but should not be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A method for power distribution network reconfiguration oriented combined attack and defense, characterized in that, Comprising: Attack phase: generating adversarial samples based on power distribution network state data, comprising: (a) calculating KL divergence and CW loss; (b) dynamically adjusting weight coefficients according to the gradient amplitude of the KL divergence loss and the CW loss; (c) generating adversarial samples that satisfy the discrete switch constraints of the power distribution network through iterative optimization, and inputting the adversarial samples into the DRL agent; Defense phase: training the DRL agent to resist adversarial samples, comprising: (d) gradually increasing the attack strength parameter according to the training round; (e) dynamically increasing the mixing ratio of adversarial samples in the training data; (f) optimizing DRL agent parameters to maintain the stability of topology reconstruction decisions; The dynamic adjustment of the weight coefficients in step (b) comprises: calculating the gradient vector amplitude of the KL divergence loss; calculating the gradient vector amplitude of the CW loss; determining the weight coefficients according to the inverse relationship between the KL divergence loss gradient vector amplitude and the CW loss gradient vector amplitude; The attack strength parameter in step (d) comprises: attack disturbance amplitude: linearly increasing from an initial value to a maximum value; adversarial sample generation iteration number: increasing with the training round; adversarial sample insertion probability: gradually increasing based on the product of the initial probability and the training round; The optimization of DRL agent parameters in step (f) comprises: minimizing the difference between the reward functions under the original state and the adversarial state; calculating the loss function according to the attack strength parameter corresponding to the current training round.

2. The method of claim 1, wherein the method is configured to: The attack phase comprises any one of the following modes: non-target attack mode: generating a set of perturbed samples, and selecting the adversarial sample that minimizes the DRL agent output Q value; target attack mode: generating adversarial samples that induce the DRL agent to output specified actions for a preset set of non-optimal switch actions.

3. The method of claim 1 or 2, wherein the method is configured to: At least one of Python3.9.0, Pytorch2.4.0 and pandapower2.14.11 libraries is used to realize model training, simulation and interaction with the power distribution network simulation platform, and to transmit power grid state data and switch action instructions.

4. A power distribution network reconfiguration-oriented combined system of attack and defense, characterized in that, Comprising: Attack module, comprising: multi-target induction unit for calculating KL divergence and CW loss; adaptive weight unit for dynamically adjusting weight coefficients according to the gradient amplitude of the KL divergence loss and the CW loss; attack execution unit for generating adversarial samples that satisfy the discrete switch constraints of the power distribution network, and inputting the adversarial samples into the DRL agent; defense module, comprising: course scheduling unit for outputting attack strength parameters that increase with the training round; adversarial training unit for mixing original data and adversarial samples according to a dynamic ratio; parameter optimization unit for optimizing DRL agent parameters to maintain the stability of topology reconstruction decisions; The attack module and the defense module work cooperatively through data interaction, dynamically passing weight coefficients and adversarial attack strength parameters; Dynamic adjustment of the weight coefficients comprises: calculating the gradient vector amplitude of the KL divergence loss; calculating the gradient vector amplitude of the CW loss; determining the weight coefficients according to the inverse relationship between the KL divergence loss gradient vector amplitude and the CW loss gradient vector amplitude; The adversarial attack strength parameter comprises: attack disturbance amplitude: linearly increasing from an initial value to a maximum value; Iteration number of adversarial sample generation: increases with training round; Adversarial sample insertion probability: gradually increases based on the product of the initial probability and the training round; The optimization of the DRL agent parameters includes: minimizing the difference of the reward function in the original state and the adversarial state; and calculating a loss function according to the attack strength parameter corresponding to the current training round.

5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The processor implements the power distribution network reconstruction-oriented combined method for adversarial attack and defense when the computer program is executed.

6. A computer readable storage medium storing a computer program, characterized in that: The processor implements the power distribution network reconstruction-oriented combined method for adversarial attack and defense when the computer program is executed.

Citation Information

Patent Citations

  • Anti-attack collaborative defense method and device based on correlation analysis

    CN112232434A

  • Iterative algorithm-based method for detecting adversarial network attack in smart power grid

    CN119324839A