Power distribution network fault monitoring lightweight implementation method, device and equipment and storage medium
By deploying a lightweight LSTM neural network on an embedded microprocessor, and employing a two-level memory structure and intra-graph distance clustering and intra-class pruning techniques for weight parameters, the problems of high memory access frequency and high energy consumption when deploying a power distribution network fault detection model on a low-configuration platform are solved, thus achieving more efficient fault monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2022-09-01
- Publication Date
- 2026-05-15
AI Technical Summary
Existing power distribution network fault detection models suffer from high memory access frequency, slow running speed, and high energy consumption when deployed on low-configuration platforms.
A lightweight LSTM neural network is deployed on an embedded microprocessor, employing a two-level memory structure. The neural network weight parameters are stored in the first-level memory and the calculation is performed in the second-level memory. The number of weight parameters is reduced by using intra-graph distance clustering based on network weight parameters and intra-class uniform pruning techniques.
It reduces memory access frequency and power consumption, and reduces the size of the network model, making the model easier to deploy on embedded devices.
Smart Images

Figure CN115408945B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of technology, and specifically to a lightweight implementation method, device, equipment, and storage medium for power distribution network fault monitoring. Background Technology
[0002] Distribution network safety has always been a major concern in the power industry. With the development of smart grids, higher demands are being placed on grid fault detection. Current research on distribution network fault monitoring mainly focuses on training machine learning or deep learning models with large-scale data to obtain fault detection models, which are then deployed to a central processing cluster to achieve distribution network fault detection.
[0003] Training requires complex models and significant computational resources to extract information from very large and highly redundant datasets. This increases the structural and computational complexity of existing models for fault detection in power distribution networks, directly leading to higher hardware requirements for deployment platforms and limiting their deployment and application on low-configuration platforms. Therefore, balancing algorithm performance with model size is crucial for power distribution network fault detection.
[0004] In related technologies, Chinese invention patent document CN113987953A discloses a method for lightweighting a fault detection model. The method includes: training a first power equipment fault detection model using a preset training set and a preset test set to obtain a second power equipment fault detection model; replacing the basic network structure of the second power equipment fault detection model using a lightweight network structure to obtain a third power equipment fault detection model; inputting the third power equipment fault detection model into a preset compression and fine-tuning algorithm for compression and fine-tuning to obtain a fourth power equipment fault detection model; and inputting the fourth power equipment fault detection model into a preset optimization engine to optimize the fourth power equipment fault detection model, thereby obtaining a lightweight power equipment fault detection model. This scheme reduces the structural complexity of the neural network model while ensuring the accuracy of the output results.
[0005] However, this solution deploys a lightweight power equipment fault detection model to a central processing cluster. When performing fault detection, it needs to access the weight parameters of the fault detection model to perform calculations to achieve fault monitoring, resulting in high memory access frequency, slow running speed, and high energy consumption. Summary of the Invention
[0006] The technical problem to be solved by this invention is how to reduce the number of memory accesses and reduce power consumption while ensuring model performance.
[0007] The present invention solves the above-mentioned technical problems through the following technical means:
[0008] This invention proposes a lightweight implementation method for fault monitoring in power distribution networks. The fault monitoring neural network is deployed on an embedded microprocessor, which includes a two-level memory structure. The first-level memory stores the weight parameters of the fault monitoring neural network. The method includes:
[0009] Obtain three-phase current and voltage data for distribution network lines;
[0010] The secondary memory reads the weight parameters from the primary memory and processes the three-phase current and voltage data based on the fault monitoring neural network to obtain the distribution network fault type.
[0011] The fault monitoring neural network is a lightweight LSTM neural network obtained by in-graph distance clustering and in-class uniform pruning based on network weight parameters.
[0012] In this invention, a lightweight LSTM neural network is deployed on an embedded microprocessor, which employs a two-level memory structure. The neural network weight parameters are stored in the first-level memory. When using the lightweight LSTM neural network, the weight parameters are read from the first-level memory to the second-level memory, and the corresponding calculations are performed in the second-level memory. This reduces the number of memory accesses for the neural network model weight parameters between the two levels of memory, thereby reducing power consumption. Furthermore, the fault monitoring neural network model is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of the network weight parameters. This reduces the number of weight parameters in the network model, resulting in a smaller model size that is easier to deploy on embedded devices.
[0013] Furthermore, the fault monitoring neural network includes a MaxPooling1D layer, an LSTM layer, a Dropout layer, and a Dense layer connected in sequence;
[0014] The LSTM layer includes an input gate, an output gate, a forget gate, and a cell state.
[0015] Furthermore, the process of obtaining a lightweight LSTM neural network based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters includes:
[0016] Based on the unit structure of the LSTM layer, a directed acyclic graph G = {V, E} is established, where V is the set of nodes, consisting of all elements in the weight parameter matrix within the unit structure; and E is the set of edges, consisting of the multiplication and addition relationships between all elements in the weight parameter matrix within the unit structure.
[0017] Calculate the number of clusters in the directed acyclic graph G;
[0018] Based on the number of clusters, the node set V in the directed acyclic graph G is clustered to obtain k-class weight parameters;
[0019] Based on the weight parameters of class k, the LSTM layer is pruned to obtain the lightweight LSTM neural network.
[0020] Further, the calculation of the number of clusters for the directed acyclic graph G includes:
[0021] Based on the input vector dimension of the three-phase current and voltage data, the control vector dimension within the input gate of the LSTM layer cell structure, and the bias vector dimension within the input gate of the LSTM layer cell structure, calculate the number of product terms A involved in the operation in the LSTM layer cell structure.
[0022] Calculate the maximum number of product terms T(S) that can be generated using the secondary memory, where the maximum storage space of the secondary memory does not exceed the space threshold S;
[0023] Based on the number of product terms T(S) and the spatial threshold S, calculate the maximum number of product terms Q(S) contained in each subclass after clustering the directed acyclic graph G.
[0024] Based on the number of product terms A and the number of product terms Q(S), calculate the minimum number of subclasses P(S) that can be obtained by clustering the directed acyclic graph G on the secondary memory, and use it as the number of clusters for the directed acyclic graph G.
[0025] Further, based on the number of clusters, the node set V in the directed acyclic graph G is clustered to obtain k-class weight parameters, including:
[0026] a) Based on the weight parameter n i In the directed acyclic graph G, with weight parameter n j The shortest path length D between ij Calculate the weight parameter n i The coordinates are A i (D i1 D i2 ,…,D ij ,…,D ix );
[0027] b) Select k points as cluster centers m1, m2, ..., m i ,…,m k , remember the cluster center m i Coordinates M i (M i1 M i2 ,…,M ij ,…,M ix );
[0028] c) Calculate the Euclidean distance from each weight parameter to each cluster center, find the cluster center closest to the weight parameter, and assign the weight parameter to the cluster center closest to the weight parameter;
[0029] d) Calculate the average coordinates of all weight parameters contained in each cluster center, and use the average coordinates as the new cluster center;
[0030] e) Repeat steps c) to d) until the rate of change of the i-th cluster center is α. i Satisfy: α i <α0,i∈{1,2,…,k}, where α0 is the rate of change of the cluster center at the end of the iteration, and k class weight parameters are obtained.
[0031] Furthermore, the rate of change of the i-th cluster center is α i The calculation formula is:
[0032]
[0033] In the formula: For the i-th cluster center when step c) is executed for the k-th time, For the (k+1)th execution of step c), the i-th cluster center is... This refers to the i-th cluster center when step c) is executed for the (k+2)th time.
[0034] Further, the step of pruning the LSTM layer based on the weight parameters of the k classes to obtain the lightweight LSTM neural network includes:
[0035] Sort each type of parameter from largest to smallest, and then sort the parameters in β. k *N k All subsequent parameters are set to 0 to obtain the pruned network, where β k N is the pruning threshold for the k-th class weight parameters. k The number of weight parameters for the k-th class;
[0036] Examine the accuracy γ of the pruned network and determine whether the accuracy γ of the pruned network is greater than or equal to the set expected accuracy γ0.
[0037] If so, then the lightweight LSTM neural network is obtained;
[0038] If not, the LSTM layer is retrained until the lightweight LSTM neural network is obtained.
[0039] Furthermore, this invention proposes a lightweight implementation device for power distribution network fault monitoring. The device includes a three-phase current and voltage acquisition module and a fault analysis module. The fault analysis module includes an embedded microprocessor, and a fault monitoring neural network is deployed on the embedded microprocessor. The fault monitoring neural network is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters. The embedded microprocessor includes a primary memory and a secondary memory. The primary memory stores the weight parameters of the fault monitoring neural network, wherein:
[0040] The three-phase current and voltage acquisition module is used to acquire three-phase current and voltage data of distribution network lines.
[0041] The secondary memory is used to read the weight parameters from the primary memory and process the three-phase current and voltage data based on the fault monitoring neural network to obtain the distribution network fault type.
[0042] Furthermore, the present invention also proposes a lightweight implementation device for power distribution network fault monitoring, the device including a memory and a processor; wherein, the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the lightweight implementation method for power distribution network fault monitoring as described above.
[0043] Furthermore, the present invention also proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the lightweight implementation method for power distribution network fault monitoring as described above.
[0044] The advantages of this invention are:
[0045] (1) In this invention, a lightweight LSTM neural network is deployed on an embedded microprocessor, and the embedded microprocessor adopts a two-level memory structure. The weight parameters of the neural network are stored in the first-level memory. When using the lightweight LSTM neural network, the weight parameters are read from the first-level memory to the second-level memory and the corresponding calculations are completed in the second-level memory. This reduces the number of memory accesses for the weight parameters of the neural network model between the two levels of memory, thereby reducing power consumption. Furthermore, the fault monitoring neural network model is a lightweight LSTM neural network obtained by intra-graph distance clustering and intra-class uniform pruning based on the network weight parameters. This reduces the number of weight parameters in the network model, resulting in a smaller model size and easier deployment on embedded devices.
[0046] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0047] Figure 1This is a flowchart illustrating the lightweight implementation method for power distribution network fault monitoring in the first embodiment of the present invention.
[0048] Figure 2 This is a schematic diagram of the lightweight LSTM neural network design process in the first embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the lightweight implementation device for power distribution network fault monitoring in the second embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] like Figure 1 As shown, the first embodiment of the present invention proposes a lightweight implementation method for power distribution network fault monitoring. The fault monitoring neural network is deployed on an embedded microprocessor, which includes a two-level memory structure. The first-level memory stores the weight parameters of the fault monitoring neural network. The fault monitoring neural network is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of the network weight parameters. The method includes the following steps:
[0052] S101. Obtain the three-phase current and voltage data of the distribution network lines;
[0053] S102. The secondary memory reads the weight parameters from the primary memory and processes the three-phase current and voltage data based on the fault monitoring neural network to obtain the distribution network fault type.
[0054] In this embodiment, a lightweight LSTM neural network is deployed on an embedded microprocessor, which adopts a two-level memory structure. The neural network weight parameters are stored in the first-level memory. When using the lightweight LSTM neural network, the weight parameters are read from the first-level memory to the second-level memory, and the corresponding calculations are performed in the second-level memory. This reduces the number of memory accesses for the neural network model weight parameters between the two levels of memory, thereby reducing power consumption. Furthermore, the fault monitoring neural network model is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of the network weight parameters. This reduces the number of weight parameters in the network model, resulting in a smaller model size that is easier to deploy on embedded devices.
[0055] Specifically, the embedded microprocessor contains two levels of memory: Random Access Memory (RAM) and Flash. The weight parameters in the LSTM layer are stored in Flash. When using the device for fault analysis, the RAM reads the weight parameters from Flash and performs calculations with the input three-phase current and voltage data.
[0056] In this context, RAM is a fast memory with a size of S, while FLASH is a slow memory with unlimited storage space. The terms "limited storage space" and "unlimited storage space" are relative to the amount of data to be stored. "Limited" means the storage space cannot hold all the data at once, while "unlimited" means it can hold all the data at once.
[0057] It should be noted that RAM, also known as Random Access Memory, is a type of memory whose stored contents can be retrieved or stored as needed, and the access speed is independent of the location of the storage cell. This type of memory loses its stored contents when power is off and is primarily used to store programs that are used for short periods.
[0058] Flash memory consists of erase cells (also called blocks), and features high speed and convenience. It can retain information even after the power supply is turned off, allowing the memory cell blocks to be erased and reprogrammed without the need for additional programming voltage.
[0059] In one embodiment, the fault monitoring neural network includes a MaxPooling1D layer, an LSTM layer, a Dropout layer, and a Dense layer connected in sequence.
[0060] The LSTM layer includes an input gate, an output gate, a forget gate, and a cell state.
[0061] It should be noted that the MaxPooling1D layer is a max pooling layer used to limit the size of each pooling step. For example, if the input data dimension is [10,4,10], the pooling layer size pooling_size = 2, and the stride = 1, then after MaxPooling(pooling_size = 2, stride = 1), the output data dimension will be [10,3,10].
[0062] LSTM (Long Short-Term Memory) layers are a type of temporal recurrent neural network, suitable for processing and predicting important events with relatively long intervals and delays in time series. In this embodiment, the LSTM layer includes an input gate, an output gate, a forget gate, and cell states. The forget gate determines how much of the cell state c_t-1 from the previous time step is retained in the current time step c_t; the input gate determines how much of the network's input x_t at the current time step is stored in the cell state c_t; and the output gate controls how much of the cell state c_t is output to the current output value h_t of the LSTM.
[0063] In one embodiment, such as Figure 2 As shown, the process of obtaining a lightweight LSTM neural network based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters includes the following steps:
[0064] S201. Based on the unit structure of the LSTM layer, establish a directed acyclic graph G = {V, E}, where V is the set of nodes, consisting of all elements in the weight parameter matrix within the unit structure; E is the set of edges, consisting of the multiplication and addition relationships between all elements in the weight parameter matrix within the unit structure.
[0065] It should be noted that the following constraints are satisfied during the forward propagation of the LSTM layer cell structure:
[0066] Forgotten Gate:
[0067] f t =σ(W f h t-1 +U f x t +b f )#(1)
[0068] Input Gate:
[0069] i t =σ(W i h t-1 +U i x t +b i )#(2)
[0070]
[0071] Cell state:
[0072]
[0073] Output gate
[0074] o t=σ(W o H t-1 +U o x t +b o )#(5)
[0075] h t =o t ⊙tanh(C t )#(6)
[0076] Among them, there are only ordinary product (left row multiplied by right column) and Hadamard product (corresponding element multiplication of two matrices), which are both matrix multiplications. Therefore, LSTM can be equivalent to matrix multiplication. A directed acyclic graph (DAG) is constructed for it. In the DAG, each node represents a data input or operation (this operation processes the input data and produces an output result), and each edge represents the dependency relationship between data operation nodes.
[0077] It should be noted that, assuming a and b are elements in the weight parameter matrix, and elements a and b have a direct additive or multiplicative relationship, then edge e ab The value is 1.
[0078] S202. Calculate the number of clusters for the directed acyclic graph G;
[0079] S203. Based on the number of clusters, cluster the node set V in the directed acyclic graph G to obtain k-class weight parameters;
[0080] S204. Based on the weight parameters of class k, prune the LSTM layer to obtain the lightweight LSTM neural network.
[0081] In one embodiment, step S202 specifically includes the following steps:
[0082] S2021. Based on the input vector dimension of the three-phase current and voltage data, the control vector dimension within the input gate of the LSTM layer cell structure, and the bias vector dimension within the input gate of the LSTM layer cell structure, calculate the number of product terms A involved in the operation in the LSTM layer cell structure.
[0083] Within an LSTM cell structure, weight parameters exhibit multiplicative and additive relationships. Terms directly connected by multiplicative relationships are denoted as product terms, while product terms are connected by additive relationships. The total number of product terms is denoted as the number of product terms. The number A of product terms participating in the computation within the LSTM cell structure is calculated using the following formula:
[0084] A = 4m 3 T+4mn 2 T+3m 2 T 2 +9mT
[0085] In the formula: m is the dimension of the input vector of the three-phase current and voltage data, n is the dimension of the control vector in the input gate of the LSTM cell structure, and T is the dimension of the bias vector in the input gate of the LSTM cell structure.
[0086] S2022. Calculate the maximum number of product terms T(S) that can be generated using the secondary memory, where the maximum storage space of the secondary memory does not exceed the space threshold S.
[0087] For the cell structure of an LSTM layer, we have:
[0088]
[0089] In the formula: O() is the complexity function. Representation complexity and Related.
[0090] S2023. Based on the number of product terms T(S) and the spatial threshold S, calculate the maximum number of product terms Q(S) contained in each subclass after clustering the directed acyclic graph G.
[0091] It should be noted that, assuming V1, V2, ..., V h For a directed acyclic graph G, after clustering, any subclass contains at most Q(S) product terms:
[0092] Q(S) = 2T(S) + S.
[0093] S2024. Based on the number of product terms A and the number of product terms Q(S), calculate the minimum number of subclasses P(S) that can be obtained by clustering the directed acyclic graph G on the secondary memory, and use it as the number of clusters for the directed acyclic graph G.
[0094] It should be noted that the formula for calculating the minimum value P(S) is:
[0095]
[0096] In one embodiment, step S203 includes the following steps:
[0097] a) Based on the weight parameter n i In the directed acyclic graph G, with weight parameter n j The shortest path length D between ij Calculate the weight parameter n i The coordinates are A i (D i1 D i2 ,…,D ij ,…,D ix );
[0098] b) Select k points as cluster centers m1, m2, ..., m i ,…,m k , remember the cluster center m i Coordinates M i (M i1 M i2 ,…,M ij ,…,M ix ), where k = P(S);
[0099] c) Calculate the Euclidean distance from each weight parameter to each cluster center, find the cluster center closest to the weight parameter, and assign the weight parameter to the cluster center closest to the weight parameter;
[0100] It should be noted that the node is the same as the weight parameter n. i to cluster center m i The Euclidean distance is d(n) i ,m i ), compare weights n i Calculate the Euclidean distance to each cluster center, find the cluster center closest to the node, and assign the node to the cluster corresponding to that cluster center.
[0101] d) Calculate the average coordinates of all weight parameters contained in each cluster center, and use the average coordinates as the new cluster center;
[0102] It should be noted that after all nodes are assigned to their respective clusters, the average coordinates of all nodes in each cluster are calculated. For the original cluster center m... i Let the cluster contain n nodes. i ,n j, …,n k There are p nodes in total, and let M be the average coordinates of these nodes. i ',have:
[0103]
[0104] Note point m i The coordinates of ' are M i ',Let m i 'for m i Updated cluster core.
[0105] e) Repeat steps c) to d) until the rate of change of the i-th cluster center is α. i Satisfy: α i <α0,i∈{1,2,…,k}, where α0 is the rate of change of the cluster center at the end of the iteration, and k class weight parameters are obtained.
[0106] In one embodiment, the rate of change of the i-th cluster center is α iThe calculation formula is:
[0107]
[0108] In the formula: For the i-th cluster center when step c) is executed for the k-th time, For the (k+1)th execution of step c), the i-th cluster center is... This refers to the i-th cluster center when step c) is executed for the (k+2)th time.
[0109] In one embodiment, step S204 includes the following steps:
[0110] S2041. Sort each type of parameter from largest to smallest, and sort them in order of β. k *N k All subsequent parameters are set to 0 to obtain the pruned network, where β k N is the pruning threshold for the k-th class weight parameters. k is the number of weight parameters for the k-th class, and * denotes product;
[0111] S2042. Check the accuracy γ of the pruned network and determine whether it satisfies: γ ≥ γ0, where γ0 is the expected accuracy. If yes, proceed to step S2043; otherwise, repeat steps S2041 to S2042 until the lightweight LSTM neural network is obtained.
[0112] S2043, The lightweight LSTM neural network is obtained.
[0113] In addition, such as Figure 3 As shown, the second embodiment of the present invention proposes a lightweight implementation device for power distribution network fault monitoring. The device includes a three-phase current and voltage acquisition module 10 and a fault analysis module 20. The fault analysis module 20 includes an embedded microprocessor 30. A fault monitoring neural network is deployed on the embedded microprocessor 30. The fault monitoring neural network is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters. The embedded microprocessor 30 includes a primary memory 31 and a secondary memory 32. The primary memory 31 stores the weight parameters of the fault monitoring neural network, wherein:
[0114] The three-phase current and voltage acquisition module 10 is used to acquire three-phase current and voltage data of the distribution network line;
[0115] The secondary memory 32 is used to read the weight parameters from the primary memory and process the three-phase current and voltage data based on the fault monitoring neural network to obtain the distribution network fault type.
[0116] In this embodiment, the three-phase current and voltage data are acquired by the three-phase current and voltage acquisition module 10 of the distribution network fault intelligent monitoring device and used as input. The lightweight LSTM neural network deployed in the fault analysis module 20 of the distribution network fault monitoring device performs fault analysis and obtains the three-phase current and voltage fault type as the output result.
[0117] By deploying a lightweight LSTM neural network on an embedded microprocessor with a two-level memory architecture, where the neural network weight parameters are stored in the first-level memory, the weight parameters are read from the first-level memory to the second-level memory and the corresponding calculations are performed in the second-level memory when using the lightweight LSTM neural network. This reduces the number of memory accesses for the neural network model weight parameters between the two levels of memory, thereby reducing power consumption. Furthermore, the fault detection neural network model is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of the network weight parameters, which reduces the number of weight parameters in the network model, resulting in a smaller model size that is easier to deploy on embedded devices.
[0118] In one embodiment, the device further includes a lightweight processing module, specifically comprising:
[0119] The directed acyclic graph (DAG) building unit is used to build a directed acyclic graph G = {V, E} based on the unit structure of the LSTM layer, where V is the set of nodes, consisting of all elements in the weight parameter matrix within the unit structure; and E is the set of edges, consisting of the multiplication and addition relationships between all elements in the weight parameter matrix within the unit structure.
[0120] The clustering class number calculation unit is used to calculate the number of clusters in the directed acyclic graph G;
[0121] A clustering unit is used to cluster the set of nodes V in the directed acyclic graph G based on the number of clusters to obtain k-class weight parameters.
[0122] The pruning unit is used to prune the LSTM layer based on the weight parameters of class k to obtain the lightweight LSTM neural network.
[0123] In one embodiment, the cluster count calculation unit is configured to perform the following steps:
[0124] Based on the input vector dimension of the three-phase current and voltage data, the control vector dimension within the input gate of the LSTM layer cell structure, and the bias vector dimension within the input gate of the LSTM layer cell structure, calculate the number of product terms A involved in the operation in the LSTM layer cell structure.
[0125] Calculate the maximum number of product terms T(S) that can be generated using the secondary memory, where the maximum storage space of the secondary memory does not exceed the space threshold S;
[0126] Based on the number of product terms T(S) and the spatial threshold S, calculate the maximum number of product terms Q(S) contained in each subclass after clustering the directed acyclic graph G.
[0127] Based on the number of product terms A and the number of product terms Q(S), calculate the minimum number of subclasses P(S) that can be obtained by clustering the directed acyclic graph G on the secondary memory, and use it as the number of clusters for the directed acyclic graph G.
[0128] In one embodiment, the clustering unit is configured to perform the following steps:
[0129] a) Based on the weight parameter n i In the directed acyclic graph G, with weight parameter n j The shortest path length D between ij Calculate the weight parameter n i The coordinates are A i (D i1 D i2 ,…,D ij ,…,D ix );
[0130] b) Select k points as cluster centers m1, m2, ..., m i ,…,m k , remember the cluster center m i Coordinates M i (M i1 M i2 ,…,M ij ,…,M ix );
[0131] c) Calculate the Euclidean distance from each weight parameter to each cluster center, find the cluster center closest to the weight parameter, and assign the weight parameter to the cluster center closest to the weight parameter;
[0132] d) Calculate the average coordinates of all weight parameters contained in each cluster center, and use the average coordinates as the new cluster center;
[0133] e) Repeat steps c) to d) until the rate of change of the i-th cluster center is α. i Satisfy: α i <α0,i∈{1,2,…,k}, where α0 is the rate of change of the cluster center at the end of the iteration, and k class weight parameters are obtained.
[0134] Wherein, the rate of change of the i-th cluster center is α i The calculation formula is:
[0135]
[0136] In the formula: For the i-th cluster center when step c) is executed for the k-th time, For the (k+1)th execution of step c), the i-th cluster center is... This refers to the i-th cluster center when step c) is executed for the (k+2)th time.
[0137] In one embodiment, the pruning unit is configured to perform the following steps:
[0138] Sort each type of parameter from largest to smallest, and then sort the parameters in β. k *N k All subsequent parameters are set to 0 to obtain the pruned network, where β k N is the pruning threshold for the k-th class weight parameters. k The number of weight parameters for the k-th class;
[0139] Examine the accuracy γ of the pruned network and determine whether the accuracy γ of the pruned network is greater than or equal to the set expected accuracy γ0.
[0140] If so, then the lightweight LSTM neural network is obtained;
[0141] If not, the LSTM layer is retrained until the lightweight LSTM neural network is obtained.
[0142] It should be noted that other embodiments or implementation methods of the lightweight distribution network fault monitoring device of the present invention can refer to the above-described method embodiments, and will not be repeated here.
[0143] Furthermore, the third embodiment of the present invention also proposes a lightweight implementation device for power distribution network fault monitoring, the device including a memory and a processor; wherein, the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the lightweight implementation method for power distribution network fault monitoring as described in the first embodiment above.
[0144] Furthermore, the fourth embodiment of the present invention also proposes a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the lightweight implementation method for power distribution network fault monitoring as described in the first embodiment above.
[0145] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0146] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0147] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0148] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0149] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A lightweight implementation method for fault monitoring in power distribution networks, characterized in that, A fault monitoring neural network is deployed on an embedded microprocessor, which includes a two-level memory structure. The first-level memory stores the weight parameters of the fault monitoring neural network. The method includes: Obtain three-phase current and voltage data for distribution network lines; The secondary memory reads the weight parameters from the primary memory and processes the three-phase current and voltage data based on the fault monitoring neural network to obtain the distribution network fault type. The fault monitoring neural network is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters, including: establishing a directed acyclic graph based on the unit structure of the LSTM layer in the LSTM neural network. ,in, It is a set of nodes, consisting of all elements in the weight parameter matrix within the unit structure; It is a set of edges, consisting of the multiplication and addition relationships between all elements in the weight parameter matrix within the unit structure; Calculate the directed acyclic graph G The number of clusters to be clustered; Based on the number of clusters in the clustering, the directed acyclic graph is... G Middle node set V Clustering is performed to obtain k Class weight parameters; based on k The LSTM layer is pruned using the weight parameters described above to obtain the lightweight LSTM neural network.
2. The lightweight implementation method for power distribution network fault monitoring as described in claim 1, characterized in that, The fault monitoring neural network includes a MaxPooling1D layer, an LSTM layer, a Dropout layer, and a Dense layer connected in sequence. The LSTM layer includes an input gate, an output gate, a forget gate, and a cell state.
3. The lightweight implementation method for power distribution network fault monitoring as described in claim 1, characterized in that, The calculation is performed on the directed acyclic graph. G The number of clusters to be clustered includes: Based on the input vector dimension of the three-phase current and voltage data, the control vector dimension within the input gates of the LSTM layer's cell structure, and the bias vector dimension within the input gates of the LSTM layer's cell structure, calculate the number of product terms involved in the computation within the LSTM layer's cell structure. A ; Calculate the maximum number of product terms that can be generated using the secondary memory. The maximum storage space of the secondary memory does not exceed the space threshold. S ; Based on the number of product terms and the spatial threshold S Calculate the directed acyclic graph. G The maximum number of product terms that each subclass can contain after clustering Q ( S ); Based on the number of product terms A and the number of product terms Q ( S ), calculate the directed acyclic graph on the secondary memory. G The minimum number of subclasses that can be obtained by clustering. As a reference to the directed acyclic graph G The number of clusters used in the clustering process.
4. The lightweight implementation method for power distribution network fault monitoring as described in claim 1, characterized in that, The number of clusters based on the clustering, for the directed acyclic graph. G Middle node set V Clustering is performed to obtain k Class weight parameters include: a) Based on weight parameters In the directed acyclic graph G In and weight parameters Shortest path length between Calculate weight parameters The coordinates are ; b) Select Each point serves as the cluster center. , remember the cluster heart Coordinates are ; c) Calculate the Euclidean distance from each weight parameter to each cluster center, find the cluster center closest to the weight parameter, and assign the weight parameter to the cluster center closest to the weight parameter; d) Calculate the average coordinates of all weight parameters contained in each cluster center, and use the average coordinates as the new cluster center; e) Repeat steps c) to d) until the 1st step. i The rate of change of the cluster centers is satisfy: , To terminate the iteration, the rate of change of cluster centers is obtained. k Class weight parameters.
5. The lightweight implementation method for power distribution network fault monitoring as described in claim 4, characterized in that, No. i The rate of change of the cluster centers is The calculation formula is: In the formula: For the first When executing step c) for the second time, the first Each cluster of hearts, For the first When executing step c) for the second time, the first Each cluster of hearts, For the first When executing step c) for the second time, the first Each cluster of hearts.
6. The lightweight implementation method for power distribution network fault monitoring as described in claim 1, characterized in that, The basis k The lightweight LSTM neural network is obtained by pruning the LSTM layers according to the weight parameters described above, including: Sort each type of parameter from largest to smallest, and then sort them into groups. All subsequent parameters are set to 0 to obtain the pruned network, where, For the first k The pruning threshold for class weight parameters, For the first k The number of class weight parameters; Verify the accuracy of the pruned network. And determine the accuracy of the pruned network. Is it greater than or equal to the set expected precision? ; If so, then the lightweight LSTM neural network is obtained; If not, the LSTM layer is retrained until the lightweight LSTM neural network is obtained.
7. A lightweight implementation device for power distribution network fault monitoring, characterized in that, The device includes: a three-phase current and voltage acquisition module and a fault analysis module. The fault analysis module includes an embedded microprocessor, and a fault monitoring neural network is deployed on the embedded microprocessor. The fault monitoring neural network is a lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters. The embedded microprocessor includes a primary memory and a secondary memory. The primary memory stores the weight parameters of the fault monitoring neural network, wherein: The three-phase current and voltage acquisition module is used to acquire three-phase current and voltage data of distribution network lines. A secondary memory is used to read the weight parameters from the primary memory and process the three-phase current and voltage data based on the fault monitoring neural network to obtain the distribution network fault type. The lightweight LSTM neural network obtained based on intra-graph distance clustering and intra-class uniform pruning of network weight parameters includes: establishing a directed acyclic graph based on the unit structure of the LSTM layer in the LSTM neural network. ,in, It is a set of nodes, consisting of all elements in the weight parameter matrix within the unit structure; It is a set of edges, consisting of the multiplication and addition relationships between all elements in the weight parameter matrix within the unit structure; Calculate the directed acyclic graph G The number of clusters to be clustered; Based on the number of clusters in the clustering, the directed acyclic graph is... G Middle node set V Clustering is performed to obtain k Class weight parameters; based on k The LSTM layer is pruned using the weight parameters described above to obtain the lightweight LSTM neural network.
8. A lightweight device for monitoring faults in power distribution networks, characterized in that, The device includes a memory and a processor; wherein the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, so as to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.