Fault detection method and device for intelligent microgrid protection, equipment and medium
By reconstructing and encoding historical data of microgrids, the problem of low accuracy of neural network models in microgrid fault detection is solved, and efficient and accurate fault detection is achieved.
Patent Information
- Application Number
- CN202310158845.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2043-02-23
AI Technical Summary
Existing neural network models have low accuracy in microgrid fault detection, mainly because microgrid data changes rapidly, and labeling is complex and costly, resulting in insufficient training sets.
By acquiring historical data for reconstruction, training fault and noise reconstruction models, and using a detection encoder to encode the reconstructed data, the detection encoder is trained to maximize the differences between fault and noise features, thereby achieving fault detection.
It improves the accuracy of microgrid fault detection, reduces manual labeling costs, and increases data processing efficiency.
Smart Images

Figure CN116108369B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microgrid protection technology, and in particular to a fault detection method, device, equipment and medium for smart microgrid protection. Background Technology
[0002] Currently, a microgrid refers to a small-scale power generation and distribution system composed of distributed power sources, energy storage devices, energy conversion devices, loads, monitoring and protection devices, etc. With the rapid development of artificial intelligence technology, the intelligence of microgrids is gradually becoming more widespread, and the use of neural network models for fault detection in microgrids has been proposed. Generally, training a neural network model requires a training set composed of labeled data. However, due to the rapid dynamic changes in microgrid data, labeling this data is complex, inefficient, and costly, making it difficult to obtain sufficient training sets to train the neural network model. This results in the neural network model being unable to accurately detect faults, i.e., the fault detection accuracy is low. Therefore, how to improve the accuracy of using neural network models to detect microgrid faults has become an urgent problem to be solved. Summary of the Invention
[0003] In view of this, embodiments of this application provide a fault detection method, apparatus, device, and medium for smart microgrid protection, in order to solve the problem of how to improve the accuracy of microgrid fault detection using neural network models.
[0004] In a first aspect, embodiments of this application provide a fault detection method for smart microgrid protection, the fault detection method comprising:
[0005] Acquire historical normal data, historical fault data, and historical noise data of the microgrid within a historical time period, and input the historical normal data into a preset data reconstruction model to obtain reconstructed data;
[0006] The data reconstruction model is trained based on minimizing the difference between the reconstructed data and the historical fault data to obtain a fault reconstruction model; the data reconstruction model is trained based on minimizing the difference between the reconstructed data and the historical noise data to obtain a noise reconstruction model.
[0007] The fault reconstruction model is used to reconstruct the historical normal data to obtain reconstructed fault data, and the noise reconstruction model is used to reprocess the historical normal data to obtain reconstructed noise data.
[0008] The detection encoder used in fault detection encodes the reconstructed fault data and the reconstructed noise data respectively to obtain the fault features of the reconstructed fault data and the noise features of the reconstructed noise data. The detection encoder is trained based on the maximum difference between the fault features and the noise features to obtain a trained detection encoder.
[0009] The abnormal data of the microgrid at the current time is acquired, and the abnormal data is encoded using the trained detection encoder to obtain the current feature. The current feature is compared with the features of the fault type or the noise type to obtain the comparison result. Based on the comparison result, the fault detection result of the abnormal data is determined.
[0010] Secondly, embodiments of this application provide a fault detection device for smart microgrid protection, the fault detection device comprising:
[0011] The normal data reconstruction module is used to acquire historical normal data, historical fault data and historical noise data of the microgrid within a historical time period, and input the historical normal data into a preset data reconstruction model to obtain reconstructed data.
[0012] The reconstruction model training module is used to train the data reconstruction model based on minimizing the difference between the reconstructed data and the historical fault data to obtain a fault reconstruction model, and to train the data reconstruction model based on minimizing the difference between the reconstructed data and the historical noise data to obtain a noise reconstruction model.
[0013] An abnormal data reconstruction module is used to reconstruct the historical normal data using the fault reconstruction model to obtain reconstructed fault data, and to reprocess the historical normal data using the noise reconstruction model to obtain reconstructed noise data.
[0014] The encoder training module is used to encode the reconstructed fault data and the reconstructed noise data using the detection encoder used in fault detection, respectively, to obtain the fault features of the reconstructed fault data and the noise features of the reconstructed noise data. The detection encoder is trained based on the maximum difference between the fault features and the noise features to obtain a trained detection encoder.
[0015] The fault detection module is used to acquire abnormal data of the microgrid at the current time, encode the abnormal data using the trained detection encoder to obtain current features, compare the current features with fault-type features or noise-type features to obtain comparison results, and determine the fault detection result of the abnormal data based on the comparison results.
[0016] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the fault detection method as described in the first aspect.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the fault detection method as described in the first aspect.
[0018] The beneficial effects of this application's embodiments compared to existing technologies are as follows: This application acquires historical normal data, historical fault data, and historical noise data of a microgrid within a historical time period. It reconstructs the historical normal data to obtain reconstructed data. Based on minimizing the difference between the reconstructed data and historical fault data, it retrains a data reconstruction model to obtain a fault reconstruction model. Based on minimizing the difference between the reconstructed data and historical noise data, it retrains another data reconstruction model to obtain a noise reconstruction model. The fault reconstruction model is used to reconstruct the historical normal data to obtain reconstructed fault data. The noise reconstruction model is used to reprocess the historical normal data to obtain reconstructed noise data. This data is then used in fault detection... The detection encoder encodes the reconstructed fault data and reconstructed noise data respectively to obtain corresponding fault features and noise features. The detection encoder is trained based on the maximum difference between the fault features and noise features to obtain a trained detection encoder. The trained detection encoder can effectively encode fault data and noise data to obtain accurate encoded features. This enables the encoding of abnormal data of the microgrid to obtain current features. The current features can be compared with the features of the fault category or the noise category to determine whether the abnormal data belongs to the noise category or the fault category. In other words, it can accurately identify microgrid data that is faulty, which helps to improve the monitoring and management of microgrid data. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic flowchart of a fault detection method for smart microgrid protection provided in Embodiment 1 of this application;
[0021] Figure 2 This is a schematic flowchart of a fault detection method for smart microgrid protection provided in Embodiment 2 of this application;
[0022] Figure 3 This is a schematic diagram of the structure of a fault detection device for smart microgrid protection provided in Embodiment 3 of this application;
[0023] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of this application. Implementation
[0024] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0025] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0026] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0027] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0028] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0029] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0030] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0031] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0032] To illustrate the technical solution of this application, specific embodiments are described below.
[0033] The smart microgrid of this application is a small-scale power generation and distribution system composed of distributed power sources, energy storage devices, energy conversion devices, loads, monitoring and protection devices, etc. This small-scale power generation and distribution system is supported by computer devices including, but not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, server computer equipment, personal digital assistants (PDAs), or microcontrollers and other devices capable of storage and computing. Embodiment 1 of this application provides a fault detection method for smart microgrid protection, which can be applied to devices supporting storage and computing, and is capable of collecting data on microgrid operation.
[0034] See Figure 1 This is a flowchart illustrating a fault detection method for smart microgrid protection provided in Embodiment 1 of this application. The computer device collects data on the operation of the microgrid. This data has already been judged by the microgrid's own fault detection and classified into normal data and abnormal data. Abnormal data includes fault data and noise data. For example... Figure 2As shown, the fault detection method for smart microgrid protection may include the following steps:
[0035] Step S101: Obtain historical normal data, historical fault data and historical noise data of the microgrid within the historical time period, input the historical normal data into the preset data reconstruction model to obtain the reconstructed data.
[0036] In this application, the historical time period is a preset time period prior to the current time. During the operation of the microgrid within this historical time period, it generates grid data. This data includes normal data corresponding to normal operation, fault data corresponding to fault operation, and noise data indicating noisy operation. Within the historical time period, these correspond to historical normal data, historical fault data, and historical noise data, respectively. The microgrid's operating status is obtained through self-monitoring. That is, grid data obtained when the microgrid considers itself to be operating normally is considered normal data; grid data obtained when the microgrid experiences a fault is considered abnormal data. Abnormal data contains both noise and fault data, meaning that the fault may be caused by noise or a real fault.
[0037] Regarding abnormal data, at the beginning of the implementation of the method in this application, some thresholds can be manually defined based on experience to distinguish faulty data and noise data. Subsequently, the detection encoder obtained in this application can be used for detection and distinction.
[0038] Power grid data can include basic power grid data such as voltage signals and current signals. In practice, only one type of signal from the basic power grid data needs to be used.
[0039] The data reconstruction model includes an encoder and a decoder. The encoder encodes the input data, and the decoder decodes the encoded result to output data, which is the reconstruction of the input data. At this point, some noise can be added to the data reconstruction model, making the reconstructed data contain some noise. Of course, even if a data reconstruction model without added noise is used to reconstruct the input data, the output data may still contain some noise.
[0040] Step S101 involves reconstructing historical normal data to obtain reconstructed data. The reconstructed data may be completely identical to the historical normal data or it may contain some noise. This decouples the historical normal data from the historical fault data and the historical noisy data, which helps to make subsequent training of fault reconstruction models and noise reconstruction models meaningful.
[0041] Optionally, the preset data reconstruction model includes a reconstruction decoder and a noisy reconstruction encoder, and the generation process of the reconstruction encoder and reconstruction decoder includes:
[0042] Historical normal data is input into the initial encoder for encoding to obtain the encoding result. The encoding result is then input into the initial decoder for decoding to obtain the decoding result.
[0043] Based on the normal difference loss between historical normal data and decoding results, the parameters of the initial encoder and the initial decoder are adjusted. The process of inputting historical normal data into the initial encoder with adjusted parameters for encoding is performed to obtain the encoding result. The encoding result is then input into the initial decoder with adjusted parameters for decoding to obtain the decoding result is repeated until the normal difference loss is minimized.
[0044] The initial encoder corresponding to the minimum normal difference loss is determined as the reconstruction encoder, and the initial decoder corresponding to the minimum normal difference loss is determined as the reconstruction decoder.
[0045] The data reconstruction model can be pre-trained or trained using the data obtained in step S101. The reconstruction encoder and decoder of this model are trained based on historical normal data input. Since the historical normal data is input into the reconstruction encoder, and the reconstruction decoder decodes it to obtain a decoding result, which is a reconstruction of the historical normal data, the smaller the difference between the two, the better the reconstruction effect.
[0046] Optionally, the generation process of the noisy reconstruction encoder includes:
[0047] Obtain a preset noise factor and add it to the output of each convolutional layer of the reconstruction encoder to obtain a noisy reconstruction encoder.
[0048] Specifically, regarding noise, in order to obtain stable noise, after training the reconstruction encoder, the noise is added to the convolutional layer corresponding to the trained reconstruction encoder, so that the data reconstruction model can stably output reconstructed data with noise.
[0049] The noise factors can be the variance parameters of Gaussian noise. That is, the features extracted from each convolutional layer in the reconstruction encoder are denoised using Gaussian noise before being input into the next convolutional layer. Assuming the reconstruction encoder has M convolutional layers, M-1 noise factors are used, distributed across the output of each convolutional layer. Of course, all of the above noise factors are learnable parameters.
[0050] Step S102: Based on minimizing the difference between the reconstructed data and the historical fault data, train the data reconstruction model to obtain the fault reconstruction model; based on minimizing the difference between the reconstructed data and the historical noise data, train the data reconstruction model to obtain the noise reconstruction model.
[0051] In this application, multiple data reconstruction models are replicated, and each model is trained using different training data to obtain a model that meets the corresponding requirements.
[0052] A fault reconstruction model is trained using reconstructed data (based on historical normal data) and historical fault data. This fault reconstruction model can reconstruct fault data effectively. During training, historical normal data is input into the model to minimize the difference between the reconstructed data and the historical fault data, ensuring the trained model can reconstruct fault data well.
[0053] A noise reconstruction model is obtained by training a data reconstruction model using reconstructed data (based on historical normal data) and historical noisy data. This noise reconstruction model can reconstruct noisy data relatively well. During training, historical normal data is input into the data reconstruction model to minimize the difference between the reconstructed data and the historical noisy data, thus enabling the trained model to reconstruct noisy data effectively, resulting in the noise reconstruction model.
[0054] Optionally, based on minimizing the difference between the reconstructed data and historical fault data, a data reconstruction model is trained, resulting in a fault reconstruction model including:
[0055] Use the first filtering criterion to filter out K fault data from the historical fault data;
[0056] Calculate the similarity between the reconstructed data and K fault data, and determine the fault data with the highest similarity as the target fault data;
[0057] Based on the fault difference loss between the reconstructed data and the target fault data, the parameters of the data reconstruction model are adjusted, and the steps of inputting historical normal data into the data reconstruction model after parameter adjustment are executed to obtain the reconstructed data, until the fault difference loss is minimized.
[0058] The data reconstruction model that minimizes the loss due to fault differences is identified as the fault reconstruction model.
[0059] The process involves selecting a certain number of fault data points from historical fault data and calculating their similarity with the reconstructed data. The fault data with the highest similarity is selected as the target, and the difference between the two is calculated to adjust the parameters of the data reconstruction model. The reconstructed data is then reconstructed using the data reconstruction model with adjusted parameters. This process is repeated until the conditions are met, at which point the training is complete, and the fault reconstruction model is obtained.
[0060] Specifically, if the data reconstruction model includes a reconstruction decoder and a reconstruction encoder with added noise, and the reconstruction encoder includes M convolutional layers, corresponding to the use of M-1 noise factors distributed on the output of each convolutional layer, then the parameters of the data reconstruction model are adjusted to be the M-1 noise factors, and the other parameters are not adjusted.
[0061] Optionally, based on minimizing the difference between the reconstructed data and historical noisy data, a data reconstruction model is trained, resulting in a noise reconstruction model including:
[0062] Use the second filtering condition to filter out N noisy data points from the historical noisy data;
[0063] Calculate the similarity between the reconstructed data and N noise data, and determine the noise data with the highest similarity as the target noise data;
[0064] Based on the noise difference loss between the reconstructed data and the target noisy data, the parameters of the data reconstruction model are adjusted, and the process of inputting historical normal data into the data reconstruction model after parameter adjustment is performed to obtain the reconstructed data continues until the noise difference loss is minimized.
[0065] The data reconstruction model that minimizes noise difference loss is identified as the noise reconstruction model.
[0066] In this process, a certain number of noisy data are selected from historical fault data and their similarity to the reconstructed data is calculated. The noisy data with the highest similarity is selected as the target, and the difference between the two is calculated to adjust the parameters of the data reconstruction model. The data reconstruction model with adjusted parameters is used to reconstruct the output reconstructed data. The difference is calculated through the above steps until the conditions are met, that is, the training is completed and the noisy reconstruction model is obtained.
[0067] Specifically, if the data reconstruction model includes a reconstruction decoder and a reconstruction encoder with added noise, and the reconstruction encoder includes M convolutional layers, corresponding to the use of M-1 noise factors distributed on the output of each convolutional layer, then the parameters of the data reconstruction model are adjusted to be the M-1 noise factors, and the other parameters are not adjusted.
[0068] Step S103: Use the fault reconstruction model to reconstruct the historical normal data to obtain reconstructed fault data, and use the noise reconstruction model to reprocess the historical normal data to obtain reconstructed noise data.
[0069] In this application, historical normal data is reconstructed using fault reconstruction model and noise reconstruction model respectively, so as to obtain the corresponding reconstructed fault data and reconstructed noise data. When the reconstructed data is used in subsequent training, it avoids the use of power grid data with accurate labels, thus avoiding manual labeling, which helps to improve efficiency and reduce costs.
[0070] Step S104: The detection encoder used in fault detection is used to encode the reconstructed fault data and the reconstructed noise data respectively to obtain the fault features of the corresponding reconstructed fault data and the noise features of the corresponding reconstructed noise data. The detection encoder is trained based on the maximum difference between the fault features and the noise features to obtain the trained detection encoder.
[0071] In this application, the detection encoder is an encoding structure for feature encoding of power grid data when performing fault detection. If the feature encoding that maximizes the difference between fault data and noise data can be accurately performed, the fault data and noise data can be effectively classified.
[0072] Therefore, after obtaining the fault features and noise features, the detection encoder is trained based on the maximum difference between the two.
[0073] Optionally, the detection encoder can be trained based on the maximum difference between fault features and noise features, resulting in a trained detection encoder including:
[0074] Calculate the feature similarity between fault features and noise features;
[0075] Based on feature similarity, the parameters of the detection encoder are adjusted, and the reconstructed fault data and reconstructed noise data are encoded using the detection encoder with adjusted parameters to obtain the fault features of the corresponding reconstructed fault data and the noise features of the corresponding reconstructed noise data, until the feature similarity reaches the maximum.
[0076] The detection encoder that corresponds to the maximum feature similarity is the trained detection encoder.
[0077] The cosine similarity between fault features and noise features is calculated as a loss function to train the parameters of the detection encoder. Since the range of cosine similarity is 0 to 1, the cosine similarity can be multiplied by a preset value to achieve a scaling effect. The purpose of training is to make the features of reconstructed fault data and reconstructed noise data as dissimilar as possible, thereby improving the encoder's ability to distinguish between noise data and fault data.
[0078] Step S105: Obtain abnormal data of the microgrid at the current time, encode the abnormal data using the trained detection encoder to obtain the current features, compare the current features with the features of fault type or noise type to obtain the comparison results, and determine the fault detection results of the abnormal data based on the comparison results.
[0079] In this application, when abnormal data of a microgrid under abnormal operation is obtained, a trained detection encoder is used to encode the abnormal data, and then the encoding result is classified to obtain the classification result.
[0080] The features for fault categories are derived from real fault data, and the features for noise categories are derived from real noise data. The real fault data and real noise data can be a small amount of microgrid data that has been labeled with fault or noise tags by professionals.
[0081] Optionally, the features of the fault class include at least one first feature, which is obtained by encoding a real fault data using a trained detection encoder, and the features of the noise class include at least one second feature, which is obtained by encoding a real noise data using a trained detection encoder.
[0082] The current feature is compared with the features of fault types or noise types to obtain the comparison result. Based on the comparison result, the fault detection results of abnormal data are determined as follows:
[0083] Calculate the similarity between the current feature and each of the first features, and determine the mean of all similarities as the mean of the first similarity; or calculate the similarity between the current feature and each of the second features, and determine the mean of all similarities as the mean of the second similarity.
[0084] If the first similarity mean is greater than the first threshold, the comparison result is determined to be a feature belonging to the fault category, and the abnormal data is determined to be faulty data. Alternatively, if the first similarity mean is greater than the second threshold, the comparison result is determined to be a feature belonging to the noise category, and the abnormal data is determined to be noise data.
[0085] The above process involves classifying the current features. Ultimately, the current features are classified into either a fault cluster or a noise cluster. If they belong to the fault cluster, it means that the corresponding data is faulty data; if they belong to the noise cluster, it means that the corresponding data is noisy data.
[0086] Since the data from microgrid operation exhibits different characteristics at different times, it is necessary to retrain and test the model using steps S101 to S105 after a period of time. This helps improve the accuracy of the test, and the amount of training data is not massive, so the impact on cost and efficiency is relatively small.
[0087] This application embodiment acquires historical normal data, historical fault data, and historical noise data of a microgrid within a historical time period. The historical normal data is reconstructed to obtain reconstructed data. A fault reconstruction model is retrained based on minimizing the difference between the reconstructed data and the historical fault data. Similarly, a noise reconstruction model is retrained based on minimizing the difference between the reconstructed data and the historical noise data. The fault reconstruction model is used to reconstruct the historical normal data to obtain reconstructed fault data. The noise reconstruction model is used to reprocess the historical normal data to obtain reconstructed noise data. The detection encoder used in fault detection encodes the reconstructed fault data and the reconstructed noise data to obtain corresponding fault features and noise features. The detection encoder is trained based on maximizing the difference between the fault features and the noise features to obtain a trained detection encoder. This trained detection encoder can effectively encode the fault data and noise data to obtain accurate encoded features. This allows for the encoding of abnormal data from the acquired microgrid to obtain current features. These current features can be compared with fault-type features or noise-type features to determine whether the abnormal data belongs to the noise or fault category. In other words, it can accurately identify faulty microgrid data, which helps improve the monitoring and management of microgrid data.
[0088] See Figure 2 This is a flowchart illustrating a fault detection method for smart microgrid protection provided in Embodiment 2 of this application. Figure 2 As shown, the fault detection method for smart microgrid protection may include the following steps:
[0089] Step S201: Obtain historical normal data, historical fault data, and historical noise data of the microgrid within a historical time period. Based on the historical normal data and historical noise data (which are noise data) and the historical fault data (which are fault data), train a pre-set classification model including a detection encoder and a classifier to obtain an initially trained classification model.
[0090] In this application, the classification model includes a detection encoder and a classifier. The classification model is trained with noise data and fault data to obtain a trained detection encoder and a trained classifier. The classifier is used to perform binary classification of fault classes and noise classes.
[0091] Step S202: Input historical normal data into a preset data reconstruction model to obtain reconstructed data. Based on minimizing the difference between the reconstructed data and historical fault data, train the data reconstruction model to obtain a fault reconstruction model. Based on minimizing the difference between the reconstructed data and historical noise data, train the data reconstruction model to obtain a noise reconstruction model.
[0092] Step S203: Use the fault reconstruction model to reconstruct the historical normal data to obtain reconstructed fault data, and use the noise reconstruction model to reprocess the historical normal data to obtain reconstructed noise data.
[0093] Step S204: Use the detection encoder in the trained classification model to encode the reconstructed fault data and the reconstructed noise data respectively to obtain the fault features of the corresponding reconstructed fault data and the noise features of the corresponding reconstructed noise data. Based on the maximum difference between the fault features and the noise features, train the detection encoder to obtain the trained detection encoder.
[0094] The contents of steps S202 to S204 are the same as those of steps S102 to S104. For details, please refer to steps S102 to S104 above, and they will not be repeated here.
[0095] Step S205: Obtain abnormal data of the microgrid at the current time, encode the abnormal data using the trained detection encoder to obtain the current features, input the current features into the classifier in the trained classification model for classification, obtain the classification result, and determine the fault detection result of the abnormal data based on the classification result.
[0096] In this application, the above-mentioned classification process can be executed in the classifier, which is a classification structure corresponding to the detection encoder. Since the classifier has the function of classifying features, and in order to avoid the classifier affecting the encoder's ability to distinguish features during the training of the joint encoder and classifier, the classifier is no longer trained.
[0097] The embodiments of this application can train a detection encoder and a classifier. The detection encoder encodes the abnormal data of the microgrid to obtain the current features, and the classifier classifies the current features to determine whether the abnormal data belongs to noise or fault. That is, it can accurately identify the microgrid data that is faulty, which helps to improve the monitoring and management of microgrid data.
[0098] Corresponding to the fault detection method for smart microgrid protection in the above embodiments, Figure 3 A structural block diagram of a fault detection device for smart microgrid protection provided in Embodiment 3 of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0099] See Figure 3 The fault detection device includes:
[0100] The normal data reconstruction module 31 is used to acquire historical normal data, historical fault data and historical noise data of the microgrid within a historical time period, and input the historical normal data into a preset data reconstruction model to obtain reconstructed data.
[0101] The reconstruction model training module 32 is used to train the data reconstruction model based on minimizing the difference between the reconstructed data and the historical fault data to obtain the fault reconstruction model, and to train the data reconstruction model based on minimizing the difference between the reconstructed data and the historical noise data to obtain the noise reconstruction model.
[0102] The abnormal data reconstruction module 33 is used to reconstruct historical normal data using a fault reconstruction model to obtain reconstructed fault data, and to reprocess historical normal data using a noise reconstruction model to obtain reconstructed noise data.
[0103] The encoder training module 34 is used to encode the reconstructed fault data and the reconstructed noise data using the detection encoder used in fault detection, respectively, to obtain the fault features of the corresponding reconstructed fault data and the noise features of the corresponding reconstructed noise data. Based on the maximum difference between the fault features and the noise features, the detection encoder is trained to obtain the trained detection encoder.
[0104] The fault detection module 35 is used to acquire abnormal data of the microgrid at the current time, encode the abnormal data using a trained detection encoder to obtain the current features, compare the current features with the features of fault type or noise type to obtain the comparison results, and determine the fault detection result of the abnormal data based on the comparison results.
[0105] Optionally, the reconstructed model training module 32 includes:
[0106] The first filtering unit is used to filter out K fault data from historical fault data using the first filtering conditions;
[0107] The first target determination unit is used to calculate the similarity between the reconstructed data and K fault data respectively, and determine the fault data with the highest similarity as the target fault data;
[0108] The fault training unit is used to adjust the parameters of the data reconstruction model based on the fault difference loss between the reconstructed data and the target fault data, and to execute the steps of inputting historical normal data into the data reconstruction model after parameter adjustment to obtain reconstructed data until the fault difference loss is minimized.
[0109] The fault model determination unit is used to determine the data reconstruction model that minimizes the fault difference loss as the fault reconstruction model.
[0110] Optionally, the reconstructed model training module 32 includes:
[0111] The second filtering unit is used to filter out N noise data from historical noise data using the second filtering conditions;
[0112] The second target determination unit is used to calculate the similarity between the reconstructed data and N noise data respectively, and determine the noise data with the highest similarity as the target noise data;
[0113] The noise training unit is used to adjust the parameters of the data reconstruction model based on the noise difference loss between the reconstructed data and the target noise data, and to execute the steps of inputting historical normal data into the data reconstruction model after parameter adjustment to obtain reconstructed data until the noise difference loss is minimized.
[0114] The noise model determination unit is used to determine the data reconstruction model that minimizes noise difference loss as the noise reconstruction model.
[0115] Optionally, the encoder training module 34 includes:
[0116] The feature similarity calculation unit is used to calculate the feature similarity between fault features and noise features;
[0117] The encoder training unit is used to adjust the parameters of the detection encoder based on feature similarity, and to perform the steps of encoding the reconstructed fault data and the reconstructed noise data respectively using the detection encoder with adjusted parameters to obtain the fault features of the corresponding reconstructed fault data and the noise features of the corresponding reconstructed noise data, until the feature similarity reaches the maximum.
[0118] The encoder determination unit is used to determine the detection encoder that corresponds to the maximum feature similarity as the trained detection encoder.
[0119] Optionally, the features of the fault class include at least one first feature, which is obtained by encoding a real fault data using a trained detection encoder, and the features of the noise class include at least one second feature, which is obtained by encoding a real noise data using a trained detection encoder.
[0120] Fault detection module 35 includes:
[0121] The similarity mean calculation unit is used to calculate the similarity between the current feature and each first feature, and determine the mean of all similarities as the first similarity mean; or to calculate the similarity between the current feature and each second feature, and determine the mean of all similarities as the second similarity mean.
[0122] The fault detection unit is used to determine that if the average first similarity value is greater than a first threshold, the comparison result is a feature belonging to the fault category and abnormal data is faulty data; or if the average first similarity value is greater than a second threshold, the comparison result is a feature belonging to the noise category and abnormal data is noise data.
[0123] Optionally, the preset data reconstruction model includes a reconstruction decoder and a noisy reconstruction encoder, and the generation process of the reconstruction encoder and reconstruction decoder includes:
[0124] The encoding / decoding module is used to input historical normal data into the initial encoder for encoding, obtain the encoded result, and input the encoded result into the initial decoder for decoding, obtain the decoded result.
[0125] The encoding / decoding training module is used to adjust the parameters of the initial encoder and the initial decoder based on the normal difference loss between historical normal data and the decoding result. It executes the steps of inputting historical normal data into the initial encoder after parameter adjustment for encoding, obtaining the encoding result, inputting the encoding result into the initial decoder after parameter adjustment for decoding, and obtaining the decoding result, until the normal difference loss is minimized.
[0126] The reconstruction model determination module is used to determine the initial encoder corresponding to the minimum normal difference loss as the reconstruction encoder, and to determine the initial decoder corresponding to the minimum normal difference loss as the reconstruction decoder.
[0127] Optionally, the generation process of the noisy reconstruction encoder includes:
[0128] The encoder noise addition module is used to obtain a preset noise factor and add the noise factor to the output of each convolutional layer of the reconstruction encoder to obtain a noise-added reconstruction encoder.
[0129] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0130] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 4 of this application. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, wherein the processor executes the computer program to implement the steps in any of the above embodiments of the fault detection method for smart microgrid protection.
[0131] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0132] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0133] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0135] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0136] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0137] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0138] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A fault detection method for intelligent microgrid protection, characterized in that, The fault detection method comprises: obtaining historical normal data, historical fault data and historical noise data of the microgrid in a historical time period, inputting the historical normal data into a preset data reconstruction model to obtain reconstructed data; training the data reconstruction model based on the minimum difference between the reconstructed data and the historical fault data to obtain a fault reconstruction model, and training the data reconstruction model based on the minimum difference between the reconstructed data and the historical noise data to obtain a noise reconstruction model; reconstructing the historical normal data using the fault reconstruction model to obtain reconstructed fault data, and reprocessing the historical normal data using the noise reconstruction model to obtain reconstructed noise data; encoding the reconstructed fault data and the reconstructed noise data using a detection encoder used for fault detection to obtain fault features corresponding to the reconstructed fault data and noise features corresponding to the reconstructed noise data, training the detection encoder based on the maximum difference between the fault features and the noise features to obtain a trained detection encoder; obtaining abnormal data of the microgrid at a current time, encoding the abnormal data using the trained detection encoder to obtain current features, comparing the current features with fault features or noise features to obtain a comparison result, and determining a fault detection result of the abnormal data based on the comparison result.
2. The fault detection method according to claim 1, characterized in that, training the data reconstruction model based on the minimum difference between the reconstructed data and the historical fault data to obtain a fault reconstruction model comprises: screening K fault data from the historical fault data using a first screening condition; calculating the similarity of the reconstructed data and the K fault data respectively, and determining the fault data with the highest similarity as target fault data; adjusting the parameters of the data reconstruction model based on the fault difference loss between the reconstructed data and the target fault data, inputting the historical normal data into the data reconstruction model with adjusted parameters to obtain reconstructed data, until the fault difference loss reaches a minimum; determining the data reconstruction model corresponding to the minimum fault difference loss as the fault reconstruction model.
3. The fault detection method of claim 2, wherein, training the data reconstruction model based on the minimum difference between the reconstructed data and the historical noise data to obtain a noise reconstruction model comprises: screening N noise data from the historical noise data using a second screening condition; calculating the similarity of the reconstructed data and the N noise data respectively, and determining the noise data with the highest similarity as target noise data; adjusting the parameters of the data reconstruction model based on the noise difference loss between the reconstructed data and the target noise data, inputting the historical normal data into the data reconstruction model with adjusted parameters to obtain reconstructed data, until the noise difference loss reaches a minimum; determining the data reconstruction model corresponding to the minimum noise difference loss as the noise reconstruction model.
4. The fault detection method of claim 1, wherein, training the detection encoder based on the maximum difference between the fault features and the noise features to obtain a trained detection encoder comprises: calculating a feature similarity between the fault feature and the noise feature; adjusting parameters of the detection encoder based on the feature similarity, performing encoding of the reconstructed fault data and the reconstructed noise data using the detection encoder with the adjusted parameters, respectively, to obtain a fault feature corresponding to the reconstructed fault data and a noise feature corresponding to the reconstructed noise data, until the feature similarity reaches a maximum; determining that the detection encoder corresponding to the time when the feature similarity reaches the maximum is the trained detection encoder.
5. The fault detection method of claim 1, wherein, the fault class feature includes at least one first feature obtained by encoding a real fault data using the trained detection encoder, and the noise class feature includes at least one second feature obtained by encoding a real noise data using the trained detection encoder; comparing the current feature with the fault class feature or the noise class feature to obtain a comparison result, and determining the fault detection result of the abnormal data according to the comparison result includes: calculating a similarity between the current feature and each first feature to determine a first similarity mean of all similarities, or calculating a similarity between the current feature and each second feature to determine a second similarity mean of all similarities; if the first similarity mean is greater than a first threshold, it is determined that the comparison result is that the current feature belongs to the fault class feature, and the abnormal data is determined to be fault data, or if the first similarity mean is greater than a second threshold, it is determined that the comparison result is that the current feature belongs to the noise class feature, and the abnormal data is determined to be noise data.
6. The fault detection method according to any one of claims 1 to 5, characterized in that, the preset data reconstruction model includes a reconstruction decoder and a noise-added reconstruction encoder, and the generation process of the reconstruction encoder and the reconstruction decoder includes: inputting the historical normal data into an initial encoder to obtain an encoding result, and inputting the encoding result into an initial decoder to obtain a decoding result; adjusting parameters of the initial encoder and the initial decoder based on a normal difference loss between the historical normal data and the decoding result, performing the steps of inputting the historical normal data into the initial encoder with the adjusted parameters to obtain an encoding result, and inputting the encoding result into the initial decoder with the adjusted parameters to obtain a decoding result, until the normal difference loss reaches a minimum; determining that the initial encoder corresponding to the time when the normal difference loss reaches the minimum is the reconstruction encoder, and determining that the initial decoder corresponding to the time when the normal difference loss reaches the minimum is the reconstruction decoder.
7. The fault detection method of claim 6, wherein, the generation process of the noise-added reconstruction encoder includes: obtaining a preset noise factor, and adding the noise factor to the output of each convolutional layer of the reconstruction encoder to obtain the noise-added reconstruction encoder.
8. A fault detection device for intelligent microgrid protection, characterized in that, the fault detection device includes: The normal data reconstruction module is configured to obtain historical normal data, historical fault data and historical noise data of the micro-grid in a historical time period, input the historical normal data into a preset data reconstruction model, and obtain reconstructed data; The reconstruction model training module is configured to train the data reconstruction model based on a minimum difference between the reconstructed data and the historical fault data, to obtain a fault reconstruction model, and train the data reconstruction model based on a minimum difference between the reconstructed data and the historical noise data, to obtain a noise reconstruction model; The abnormal data reconstruction module is configured to perform reconstruction processing on the historical normal data using the fault reconstruction model, to obtain reconstructed fault data, and perform reprocessing on the historical normal data using the noise reconstruction model, to obtain reconstructed noise data; The encoder training module is configured to encode the reconstructed fault data and the reconstructed noise data using a detection encoder used for fault detection, to obtain fault features corresponding to the reconstructed fault data and noise features corresponding to the reconstructed noise data, and train the detection encoder based on a maximum difference between the fault features and the noise features, to obtain a trained detection encoder; The fault detection module is configured to obtain abnormal data of the micro-grid at a current time, encode the abnormal data using the trained detection encoder, to obtain current features, compare the current features with fault features or noise features, to obtain a comparison result, and determine a fault detection result of the abnormal data based on the comparison result.
9. A computer device, comprising: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the fault detection method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the fault detection method of any one of claims 1 to 7.
Citation Information
Patent Citations
Power grid fault diagnosis method based on categorical data mining
CN109739209A
Calculation ghost imaging method and system based on auto-encoding network
CN112435189A