Power consumption data anomaly detection method and device, equipment and storage medium

By using a pre-trained autoencoder model in the smart grid, combined with a GRU and FCN cascade architecture and post-training quantization, the accuracy and deployment issues of electricity consumption data anomaly detection are solved, achieving efficient and accurate electricity consumption data anomaly detection.

CN121388907APending Publication Date: 2026-01-23CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511182991.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing technologies for detecting anomalies in electricity consumption data in smart grids have low sensitivity to covert tampering and anti-disturbance attacks, low detection accuracy, and high computational complexity of autoencoder models, making them unsuitable for direct deployment on edge devices such as smart meters.

Method used

A pre-trained autoencoder model is used, which is trained through a GRU and FCN cascade architecture and then subjected to post-training quantization. The time-series features of electricity consumption data are extracted, compressed, and dimensionality reduced to form a latent representation, thereby reducing model complexity and enabling lightweight deployment to smart meters.

Benefits of technology

It achieves high-precision detection of abnormal power consumption data, with a detection accuracy of over 95.5% and a false alarm rate of less than 2%, and can be quickly deployed to edge devices, reducing engineering costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121388907A_ABST
    Figure CN121388907A_ABST
Patent Text Reader

Abstract

The invention provides a power consumption data anomaly detection method and device, electronic equipment and a readable storage medium. The method comprises the steps of obtaining to-be-detected power consumption data; inputting the power consumption data into a pre-trained auto-encoder model, and outputting a reconstruction value of the power consumption data; wherein the auto-encoder model is a model which is trained based on a GRU and FCN cascade architecture and is obtained after post-training quantization processing; judging whether the error between the reconstruction value and the power consumption data exceeds a set error threshold value or not; and determining that the power consumption data is abnormal in response to the fact that the error between the reconstruction value and the power consumption data exceeds a set error threshold. The power consumption data anomaly detection method provided by the invention is relatively high in detection precision, and can be deployed to edge equipment such as an intelligent electric meter.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of smart grid, and more particularly relates to a power consumption data anomaly detection method, device, equipment and storage medium. BACKGROUND

[0002] With the development of smart grid and power internet of things, the amount of data collected by AMI (Advanced Metering Infrastructure) increases sharply, and real-time detection and processing of massive power consumption data become an important link to ensure the safety of power grid.

[0003] The existing anomaly detection method based on rules or shallow models has low sensitivity to hidden tampering and adversarial perturbation attacks, resulting in low detection accuracy. Although the use of autoencoders can improve detection accuracy, the calculation complexity is high, and the autoencoders cannot be directly deployed to edge devices such as smart meters.

[0004] Therefore, how to provide a data anomaly detection method with high detection accuracy and capable of being deployed to edge devices such as smart meters is a technical problem urgently to be solved by those skilled in the art. SUMMARY

[0005] One of the purposes of the application is to provide a power consumption data anomaly detection method, device, equipment and storage medium, which has high detection accuracy and can be deployed to edge devices such as smart meters.

[0006] The first aspect of the embodiment of the application provides a power consumption data anomaly detection method, which comprises:

[0007] acquiring power consumption data to be detected;

[0008] inputting the power consumption data into a pre-trained autoencoder model to output a reconstructed value of the power consumption data; wherein the autoencoder model is trained based on a cascaded architecture of a gated recurrent unit (GRU) and a fully connected network (FCN), and is obtained after post-training quantization processing;

[0009] determining whether an error between the reconstructed value and the power consumption data exceeds a set error threshold;

[0010] in response to the error between the reconstructed value and the power consumption data exceeding the set error threshold, determining that the power consumption data is abnormal.

[0011] The second aspect of the embodiment of the application provides a power consumption data anomaly detection device, which comprises:

[0012] an acquisition unit configured to acquire power consumption data to be detected;

[0013] a reconstruction unit configured to input the power consumption data into a pre-trained autoencoder model, and output a reconstruction value of the power consumption data, wherein the autoencoder model is trained based on a cascaded architecture of a gated recurrent unit (GRU) and a fully connected network (FCN), and is obtained after post-training quantization processing;

[0014] a judgment unit configured to judge whether an error between the reconstruction value and the power consumption data exceeds a set error threshold;

[0015] an anomaly detection unit configured to determine that the power consumption data is abnormal in response to the error between the reconstruction value and the power consumption data exceeding the set error threshold.

[0016] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the power consumption data anomaly detection method when executing the computer program.

[0017] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the power consumption data anomaly detection method when executed by a processor.

[0018] In a fifth aspect, a computer program product is provided, which includes a computer program or computer executable instructions, and the computer program or computer executable instructions implement the steps of the power consumption data anomaly detection method when executed by a processor.

[0019] The power consumption data anomaly detection method, device, equipment and storage medium provided by the embodiments of the present application at least bring the following effects:

[0020] The embodiments of the present application use a pre-trained autoencoder model to obtain a reconstruction value of the power consumption data, and judge whether the power consumption data is abnormal by judging the error between the input power consumption data and the corresponding reconstruction value. The pre-trained autoencoder model is trained by a cascaded architecture of a GRU and a FCN, and is obtained after post-training quantization processing. The model can extract the time sequence features of the power consumption data, compress and reduce the dimension of the features, form latent expression, reduce the complexity of the model, and the autoencoder model is further processed by post-training quantization to ensure the model accuracy and make the model lightweight. Thus, the model can be directly deployed to edge devices such as smart meters. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0022] Figure 1 The flowchart of the power consumption data anomaly detection method provided by an embodiment of the present application;

[0023] Figure 2 The structural block diagram of the power consumption data anomaly detection device provided by an embodiment of the present application;

[0024] Figure 3 The schematic block diagram of the electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0025] In the following description, specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced without these specific details. In other instances, well-known systems, devices, circuits, and methods have not been described in detail in order to avoid obscuring the present application.

[0026] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will be described by specific embodiments in conjunction with the drawings.

[0027] Reference should be made to Figure 1 , Figure 1 The flowchart of the power consumption data anomaly detection method provided by an embodiment of the present application can be executed by a power consumption data anomaly detection device, which can be arranged in an electronic device. The method can include:

[0028] S1: obtaining power consumption data to be detected;

[0029] The power consumption data can be time series data collected by AMI.

[0030] S2: inputting the power consumption data into a pre-trained autoencoder model to output a reconstruction value of the power consumption data; wherein the autoencoder model is a model obtained after training based on a GRU and FCN cascaded architecture and after post-training quantization processing;

[0031] In the embodiment, the autoencoder model includes an encoder and a decoder, wherein the encoder can be composed of a GRU and a FCN. The GRU is used to extract the time sequence features of the power consumption data, and the FCN can compress the output of the encoder to 32 dimensions.

[0032] In an embodiment, the GRU and FCN cascaded architecture can be a GRU and FCN series structure, in which the GRU is located at the front end and the FCN is located at the rear end. The encoder can realize compressed expression of the power consumption data and reduce the complexity of the model.

[0033] The decoder can reconstruct the data output by the encoder and output the reconstructed value of the power consumption data.

[0034] It should be noted that the autoencoder model in this embodiment is a model obtained after post-training quantization processing. The post-training quantization processing can reduce the volume and computational complexity of the model, and the post-training quantization processing does not require retraining of the model, so that the autoencoder model can be quickly deployed.

[0035] S3: determining whether the error between the reconstructed value and the power consumption data exceeds a set error threshold;

[0036] S4: in response to the error between the reconstructed value and the power consumption data exceeding the set error threshold, determining that the power consumption data is abnormal.

[0037] The set error threshold can be set according to the needs of the user, and the power consumption data is determined to be abnormal when the error between the reconstructed value and the power consumption data exceeds the set error threshold.

[0038] The application adopts a pre-trained autoencoder model to obtain the reconstructed value of the power consumption data, and determines whether the power consumption data is abnormal by judging the error between the input power consumption data and the corresponding reconstructed value. The pre-trained autoencoder model is a model trained by a GRU and FCN cascaded architecture and obtained after post-training quantization processing. The model can extract the time sequence features of the power consumption data, compress and reduce the dimension of the features, form latent expression, reduce the complexity of the model, and the autoencoder model is also subjected to post-training quantization processing to ensure the accuracy of the model and make the model lightweight. Thus, the model can be directly deployed to edge devices such as smart meters.

[0039] Further, the application supports fast online of the model, reducing the engineering cost. In addition, the average accuracy of the autoencoder model for detecting various power consumption data abnormal conditions is greater than or equal to 95.5%, and the false positive rate is less than 2%. Compared with the traditional autoencoder, the accuracy of the application is improved by 4.2% under data tampering attacks.

[0040] In some embodiments, the method further comprises:

[0041] training an initial autoencoder model based on the GRU and FCN cascaded architecture;

[0042] In some embodiments, the step comprises:

[0043] obtaining a training sample, the training sample comprising historical power consumption data;

[0044] The historical power consumption data can be preprocessed to obtain training samples. The preprocessing process includes missing value filling, normalization, noise elimination, etc.

[0045] Based on the training samples, a model based on a GRU and FCN cascading architecture is trained to obtain an initial autoencoder model; wherein the model based on the GRU and FCN cascading architecture includes an encoder and a decoder, the encoder is composed of a GRU and an FCN connected in series, the GRU is used to extract time sequence features of the training samples and input the extracted time sequence features into the FCN, the FCN is used to perform feature compression and dimension reduction processing on the time sequence features to obtain a latent representation of the training samples, and the decoder is used to perform time sequence feature reconstruction on the latent representation of the training samples to output a reconstructed sample of the training sample.

[0046] In an embodiment, the extracted time sequence features include but are not limited to voltage, current, active power, reactive power, power factor, total harmonic distortion rate, RSSI (Received Signal Strength Indicator) signal strength, etc.

[0047] In this embodiment, the encoder adopts a hybrid structure of GRU and FCN connected in series, wherein the GRU can be located at the front end and the FCN can be located at the rear end. Specifically, the formula used by the encoder for time sequence feature extraction is:

[0048] h t =GRU(x t ,h t-1 )

[0049] Wherein, x t is the input vector at time t, x t ∈R 7 (7-dimensional feature), and the hidden layer dimension of the GRU is 64.

[0050] The encoder output is compressed to 32 dimensions by the FCN, and the specific formula can be: z=f(W e h T +b e )

[0051] Wherein, h T is the hidden state of the last time step, and f is a LeakyReLU activation function.

[0052] The decoder can use a deconvolutional network (Deconvolutional Network) to gradually restore the time sequence, and the specific formula is:

[0053] Where g is the Sigmoid activation function, which reconstructs the output data and ensures that the output value is in the range [0,1].

[0054] The loss calculation of the reconstructed samples determines whether the preset convergence condition has been met. If the preset convergence condition is met, the training of the initial autoencoder model is completed.

[0055] Loss calculation is used to calculate the input x and the reconstruction The error and loss can be calculated using the following formula:

[0056] In this embodiment, the encoder consists of a cascaded GRU and FCN. The GRU is used to extract temporal features from the training samples, while the FCN is used to compress and reduce the dimensionality of the temporal features. This achieves a lightweight autoencoder model and enables effective data compression and anomaly detection. This embodiment extracts and reconstructs multiple temporal features, enabling the autoencoder model to detect multiple types of anomalies.

[0057] After training the initial autoencoder model based on the GRU and FCN cascade architecture, the method also includes:

[0058] With the initial autoencoder model parameters frozen, post-training quantization is performed on the initial autoencoder model to obtain the autoencoder model.

[0059] After the initial autoencoder model completes the learning of model weights, the parameters are frozen. Then, the initial autoencoder model is subjected to post-training quantization without changing the parameters. Therefore, the model does not need to be retrained after quantization, which supports the rapid deployment of the model and reduces engineering costs.

[0060] In some embodiments, performing a post-training quantization operation on the initial autoencoder model to obtain a quantized initial autoencoder model includes:

[0061] Perform weight quantization on the initial autoencoder model; and / or perform activation quantization on the activation output of the initial autoencoder model.

[0062] Furthermore, the post-training quantization operation on the initial autoencoder model also includes the following tuning operations:

[0063] The initial autoencoder model after quantization is tuned.

[0064] In one embodiment, weight quantization can employ a symmetric quantization method, specifically using the following formula:

[0065]

[0066] Wherein, scaling factor Symmetric quantization methods can convert floating point weights into integers, for example, compressing 32-bit floating point weights into 8-bit integers.

[0067] In an embodiment, the tuning operation is performed on the initial autoencoder model after the quantization operation, including:

[0068] The threshold value in the weight quantization process is adjusted using the calibration dataset to minimize the reconstruction error. Adjusting the threshold value in the quantization process can dynamically adjust the reconstruction error of the initial autoencoder model after quantization on the calibration dataset to minimize the reconstruction error, ensuring that the autoencoder model has sufficient precision. The tuning operation can be performed on a calibration dataset selected from 10% of the samples in the validation set.

[0069] In an embodiment, the activation quantization can use an asymmetric mode to dynamically range quantize the activation outputs of the encoder and the decoder, and the asymmetric mode can use the following formula:

[0070]

[0071] wherein the zero point z = round(-min(a) / s), the scaling factor

[0072] In an embodiment, the tuning operation can also use the mean square error loss function to iteratively perform the preset number of times on the initial autoencoder model after the quantization operation to complete the tuning operation. For example, the tuning operation can use the lightweight fine-tuning (Lightweight Fine-Tuning) for quantization-aware tuning, and use the mean square error loss function to iteratively perform 5 times on the initial autoencoder model after the quantization operation with a learning rate of 1 / 10 of the original value to restore the performance of the autoencoder model.

[0073] In this embodiment, the initial autoencoder model is subjected to the post-training quantization operation, and the autoencoder model obtained after quantization has a reduced volume, so it can efficiently operate in edge devices such as smart meters with limited computing resources, and the power consumption of the autoencoder model is reduced, significantly improving the real-time detection capability. The post-quantization training operation does not need to modify the parameters of the initial autoencoder model, reducing the cost investment of secondary development and shortening the deployment time. The post-quantization training operation also restores the detection accuracy of the autoencoder model through the tuning operation.

[0074] The present application also provides a scenario embodiment.

[0075] In this scenario embodiment, the data comes from the data collected by the AMI of the residents in a certain area, the sampling interval is 15 minutes, and the feature dimension is 7.

[0076] The parameters of the autoencoder model include: the GRU hidden layer dimension is 64, the latent dimension is 32, the optimizer is Adam, the training round is 50 rounds, and the learning rate is 0.001.

[0077] The quantization strategy of the post-quantization training is: the weight quantization adopts a symmetric quantization method, and the weight is compressed to 8-bit integers; and the activation quantization adopts a dynamic range quantization, and the calibration dataset can be selected from 10% of the samples in the validation set.

[0078] The deployment environment is Cortex-M7, and the memory is 2MB.

[0079] In this scenario, the size of the autoencoder model is 3MB, the detection accuracy is 95.5%, and the inference delay is 130ms.

[0080] The power consumption data anomaly detection method corresponding to the above embodiment, Figure 2 A structural block diagram of a power consumption data anomaly detection device provided by an embodiment of the present application is shown. For ease of illustration, only parts related to the embodiments of the present application are shown. For reference Figure 2 The power consumption data anomaly detection device 20 includes:

[0081] The acquisition unit 21 is configured to acquire power consumption data to be detected.

[0082] The reconstruction unit 22 is configured to input the power consumption data into a pre-trained autoencoder model to output a reconstructed value of the power consumption data; wherein the autoencoder model is trained based on a cascaded architecture of a gated recurrent unit (GRU) and a fully connected network (FCN), and is obtained after post-training quantization processing.

[0083] The determination unit 23 is configured to determine whether an error between the reconstructed value and the power consumption data exceeds a set error threshold.

[0084] The anomaly detection unit 24 is configured to determine that the power consumption data is abnormal in response to the error between the reconstructed value and the power consumption data exceeding the set error threshold.

[0085] In an embodiment of the present application, the device further includes:

[0086] The model training unit is configured to train an initial autoencoder model based on a cascaded architecture of a GRU and a FCN.

[0087] The quantization unit is configured to perform a post-training quantization operation on the initial autoencoder model in a parameter frozen state of the initial autoencoder model to obtain an autoencoder model.

[0088] The model training unit further includes:

[0089] The sample unit is configured to acquire training samples, and the training samples include historical power consumption data.

[0090] The first training unit is configured to train a model based on a GRU and FCN cascaded architecture based on training samples to obtain an initial autoencoder model; wherein the model based on the GRU and FCN cascaded architecture comprises an encoder and a decoder, the encoder is composed of a GRU and an FCN connected in series, the GRU is configured to extract time sequence features of the training samples and input the extracted time sequence features to the FCN, the FCN is configured to perform feature compression and dimension reduction processing on the time sequence features to obtain a latent representation of the training samples, and the decoder is configured to perform time sequence feature reconstruction on the latent representation of the training samples to output a reconstructed sample of the training sample.

[0091] The second training unit is configured to determine whether a preset convergence condition is reached by performing loss calculation on the reconstructed sample, and complete the training of the initial autoencoder model when the preset convergence condition is reached.

[0092] In an embodiment of the present application, the quantization unit comprises at least one of a first quantization unit and a second quantization unit.

[0093] The first quantization unit is configured to perform weight quantization on the initial autoencoder model.

[0094] The second quantization unit is configured to perform activation quantization on the activation output of the initial autoencoder model.

[0095] In an embodiment of the present application, the first quantization unit is configured to convert floating-point weights into integers using a symmetric quantization method.

[0096] In an embodiment of the present application, the second quantization unit is configured to perform dynamic range quantization on the activation output of the encoder and the decoder using an asymmetric mode.

[0097] In an embodiment of the present application, the tuning unit comprises at least one of a first tuning unit and a second tuning unit.

[0098] The first tuning unit is configured to adjust a clipping value using a calibration data set to minimize a reconstruction error.

[0099] The second tuning unit is configured to use a mean square error loss function to iterate the initial autoencoder model after quantization a preset number of times to complete the tuning operation.

[0100] Referring to Figure 3 , Figure 3 The schematic block diagram of the electronic device provided in an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the electronic device comprises a processor 100, a memory 200 and a communication interface 300. Figure 3The electronic device 300 in the embodiment shown can include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processor 301, the input device 302, the output device 303, and the memory 304 can communicate with each other through a communication bus 305. The memory 304 is configured to store a computer program including program instructions. The processor 301 is configured to execute the program instructions stored in the memory 304. For example, the processor 301 is configured to invoke the program instructions to implement the functions of the modules / units in the above-described device embodiments. Figure 2 The functions of the acquisition unit 21, the reconstruction unit 22, the determination unit 23, and the anomaly detection unit 24 are described above.

[0101] It should be understood that, in the embodiments of the present application, the processor 301 can be a central processing unit (CPU), and can also be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The general-purpose processor can be a microprocessor or any conventional processor.

[0102] The input device 302 can include a touchpad, a fingerprint collection sensor (for collecting fingerprint information and direction information of a fingerprint of a user), a microphone, and the like, and the output device 303 can include a display (LCD, etc.), a speaker, and the like.

[0103] The memory 304 can include a read-only memory and a random access memory, and provide the processor 301 with instructions and data. A portion of the memory 304 can also include a non-volatile random access memory. For example, the memory 304 can also store device type information.

[0104] In specific implementations, the processor 301, the input device 302, and the output device 303 described in the embodiments of the present application can implement the implementation manners of the power consumption data anomaly detection method provided by the embodiments of the present application, and can also implement the implementation manners of the electronic device described in the embodiments of the present application, which will not be described here.

[0105] In another embodiment of the present application, a computer readable storage medium is provided, which stores a computer program. The computer program includes program instructions, which, when executed by a processor, implement all or part of the processes of the above-mentioned embodiment methods. The computer program can also instruct related hardware to complete the processes by the computer program. The computer program can be stored in a computer readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0106] The computer readable storage medium can be an internal storage unit of the electronic device of any of the above-mentioned embodiments, such as a hard disk or a memory of the electronic device. The computer readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of the electronic device. The computer readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer readable storage medium can also be used to temporarily store data that has been output or will be output.

[0107] The embodiment of the present application provides a computer program product, which includes computer executable instructions or computer programs stored in a computer readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium. The processor executes the computer executable instructions, so that the electronic device executes the power consumption data anomaly detection method of the above-mentioned embodiment of the present application.

[0108] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0110] In several embodiments provided in the present application, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the modules / units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules, units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed each other can be indirect coupling or communication connection through some interfaces or modules / units, and can also be electrical, mechanical or other form of connection.

[0111] The modules / units described as separate components can or can not be physically separated, and the components shown as modules / units can or can not be physical modules / units, that is, can be located in one place, or can be distributed to a plurality of network modules / units. Part or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0112] In addition, each functional module / unit in each embodiment of the present application can be integrated in one processing module / unit, or each module / unit can exist physically, or two or more modules / units can be integrated in one module / unit. The integrated module / unit can be realized in the form of hardware or in the form of software functional module / unit.

[0113] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A power consumption data anomaly detection method, characterized by, The method comprises: acquiring power consumption data to be detected; inputting the power consumption data into a pre-trained autoencoder model to output a reconstructed value of the power consumption data; wherein the autoencoder model is trained based on a gated recurrent unit (GRU) and a fully connected network (FCN) cascaded architecture, and is obtained after post-training quantization processing; determining whether an error between the reconstructed value and the power consumption data exceeds a set error threshold; in response to the error between the reconstructed value and the power consumption data exceeding the set error threshold, determining that the power consumption data is abnormal.

2. The method of claim 1, wherein, The GRU and FCN cascaded architecture is a series connection structure of the GRU and the FCN, the GRU is located at the front end, and the FCN is located at the rear end.

3. The method of claim 1 or 2, wherein, The method further comprises: training an initial autoencoder model based on a GRU and FCN cascaded architecture; performing a post-training quantization operation on the initial autoencoder model in a parameter frozen state to obtain the autoencoder model.

4. The method of claim 3, wherein, The training of the initial autoencoder model based on the GRU and FCN cascaded architecture comprises: acquiring training samples, the training samples comprising historical power consumption data; training a model based on the GRU and FCN cascaded architecture based on the training samples to obtain an initial autoencoder model; wherein the model based on the GRU and FCN cascaded architecture comprises an encoder and a decoder, the encoder being composed of the GRU and the FCN connected in series, the GRU being configured to extract time sequence features of the training samples and input the extracted time sequence features into the FCN, and the FCN being configured to perform feature compression and dimension reduction processing on the time sequence features to obtain a latent representation of the training samples, and the decoder being configured to perform time sequence feature reconstruction on the latent representation of the training samples to output a reconstructed sample of the training samples; determining whether a preset convergence condition is reached by performing loss calculation on the reconstructed sample, and completing the training of the initial autoencoder model in the case where the preset convergence condition is reached.

5. The method of claim 4, wherein, The method further comprises performing a post-training quantization operation on the initial autoencoder model by using at least one of the following methods to obtain a quantized initial autoencoder model: performing weight quantization on the initial autoencoder model; performing activation quantization on the activation output of the initial autoencoder model.

6. The method of claim 5, wherein, The weight quantization on the initial autoencoder model comprises: converting floating-point weights into integers using a symmetric quantization method.

7. The method of claim 5, wherein, The activation quantization on the activation output of the initial autoencoder model comprises: performing dynamic range quantization on the activation output of the encoder and the decoder using an asymmetric mode.

8. The method of claim 6, wherein, The method further comprises performing a tuning operation on the initial autoencoder model after the quantization operation by using at least one of the following methods: using a calibration data set to adjust a clipping value to minimize reconstruction error; using a mean square error loss function to iterate the initial autoencoder model after the quantization operation for a preset number of times to complete the tuning operation.

9. An electric power data anomaly detection device characterized by comprising: comprises: an acquisition unit configured to acquire power consumption data to be detected; A reconstruction unit is configured to input the power consumption data into a pre-trained auto-encoder model to output a reconstructed value of the power consumption data; wherein the auto-encoder model is trained based on a cascaded architecture of a gated recurrent unit (GRU) and a fully connected network (FCN) and is obtained after post-training quantization processing; A judgment unit is configured to judge whether an error between the reconstructed value and the power consumption data exceeds a set error threshold. An anomaly detection unit is configured to determine that the power consumption data is abnormal in response to the error between the reconstructed value and the power consumption data exceeding the set error threshold.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.