User self-control load abnormal data real-time monitoring method and system
Collect data in real time through smart meters and sensors, and use Hopfield neural network and LSTM model to detect self-controlled load anomalies, which solves the problem of failure to monitor self-controlled loads in the existing technology, realizes real-time monitoring and early warning of users' electricity consumption, and improves efficiency. Energy efficiency and grid stability.
Patent Information
- Application Number
- CN202410723037.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
AI Technical Summary
Existing power system load abnormality detection does not involve self-controlled load monitoring, resulting in power system instability and equipment damage, and lacks real-time monitoring and early warning mechanisms for user-controlled loads.
Use smart meters and sensors to collect data in real time, use MQTT over SSL/TLS and IPSec VPN for double-layer encrypted transmission, use Hopfield neural network and LSTM model to build a user-controlled load anomaly detection model, monitor and identify abnormal data in real time, provide timely warnings and provide Treatment recommendations.
It realizes real-time monitoring and early warning of self-controlled loads, improves energy efficiency and grid stability, enhances communication security, and helps operation and maintenance personnel quickly discover and handle abnormal situations.
Smart Images

Figure CN118739558A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis, and in particular to a real-time monitoring method and system for abnormal data of user self-controlled load. Background Art
[0002] In the power system, load monitoring is one of the key links to ensure power supply. However, the occurrence of abnormal power load conditions may lead to instability of the power system and damage to equipment. Therefore, it is very important to accurately monitor and promptly identify power load abnormalities.
[0003] With the continuous development of power equipment and automation equipment, existing enterprises, especially large-scale manufacturing industries, generally have automatic control sources and loads within the enterprise to cope with power grid fluctuations. However, the existing power system load anomaly detection does not involve solutions related to the monitoring of automatic control loads. Summary of the invention
[0004] In order to solve the above problems, the purpose of the present invention is to provide a real-time monitoring method for abnormal data of user self-controlled load, so as to realize real-time monitoring of self-controlled load status, and timely warning, and notify users to monitor and manage their own electricity consumption, so as to promote the improvement of energy efficiency and the stable operation of the power grid.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for real-time monitoring of abnormal data of user self-controlled load, comprising the following steps:
[0007] Step S1: Collect load data from the user side and the grid side in real time according to the deployment of smart meters and sensors, and collect environmental data and user data at the same time, and pre-process them;
[0008] Step S2: Using MQTT over SSL / TLS and IPSec VPN for double-layer encryption transmission to provide end-to-end protection for data from the user end to the power grid cloud platform;
[0009] Step S3: The power grid cloud platform builds a user self-controlled load anomaly detection model based on the Hopfield neural network, and performs user self-controlled load anomaly detection based on real-time collection of load data and environmental data at the user end and the power grid end, as well as user information data stored in the power grid cloud platform. If abnormal data is detected, step S4 is performed, and an abnormal warning is fed back to the user end;
[0010] Step S4: input the abnormal data into the abnormal type recognition model to obtain the specific abnormal type;
[0011] Step S5: based on the abnormal type output by the abnormal type recognition model, obtain corresponding processing suggestions from the power grid cloud platform, and transmit the abnormal type and the corresponding processing suggestions to the user end;
[0012] The step S1 is specifically as follows:
[0013] Step S11: Integrate the power consumption data, environmental data and user data into one data set, and clean the data to remove missing values, outliers and duplicate values to ensure the quality and accuracy of the data;
[0014] Step S12: extracting features from the cleaned data, including power consumption, temperature, humidity, enterprise type, and enterprise scale;
[0015] Step S13: converting the features, performing smoothing, standardization and normalization;
[0016] Use the pandas library in Python to integrate and clean the data as follows;
[0017] Use the read_csv method of the pandas library to read the electricity data, environment data, and user data by passing the path of the CSV file as a parameter, and store them in three DataFrames: electricity_data, environment_data, and user_data. Then use the pd.merge method to merge the three DataFrames according to timestamp and user ID. Merge electricity_data and environment_data according to the timestamp and user_id columns to get a new DataFrame. Then, merge the obtained DataFrame with user_data according to the user_id column to finally get a dataset merged_data containing multiple features.
[0018] Then, the dropna method is used to remove missing values in merged_data to ensure data integrity. The power usage range is determined and data screening is used to remove abnormal power usage data. The drop_duplicates method is used to remove duplicate values in merged_data to ensure the uniqueness of each piece of data.
[0019] Before data transmission, Python's gzip library is used in combination with pandas' to_csv method to store the merged_data in the DataFrame as a Gzip-compressed CSV file. First, a Gzip-compressed file object is created using the gzip.open method, and then it is passed to the to_csv method, with the compression parameter specified as gzip. Finally, the merged_data is saved as a Gzip-compressed CSV file merged_data.csv.gz.
[0020] Furthermore, the step S2 is specifically as follows:
[0021] Deploy VPN devices or services at the border of the power grid cloud platform and at remote clients, configure IPSec policies, and define the traffic that needs to be encrypted through the VPN tunnel; use the IKE protocol for key management and automatically negotiate security associations and encryption keys.
[0022] And configure SSL / TLS support on the MQTT broker, and configure the MQTT client on the client to connect to the broker using SSL / TLS
[0023] The client device first establishes a secure connection with the data center through an IPSec VPN tunnel. Through the VPN tunnel, all network layer data of the client device will be encrypted.
[0024] The client further establishes an MQTT over SSL / TLS connection through the established IPSec VPN tunnel, and the MQTT communication at the application layer is also encrypted by SSL / TLS.
[0025] The client device sends messages to the MQTT broker through a double-encrypted channel, and the power grid cloud platform receives and processes the encrypted data transmitted in the IPSec VPN tunnel via MQTT over SSL / TLS.
[0026] Furthermore, the IPSec VPN, encryption and decryption are as follows:
[0027] Encryption: C = E (K, P)
[0028] Decryption: P = D (K, C)
[0029] Among them: C is the encrypted ciphertext, E is the encryption algorithm; K is the symmetric key; P is the plaintext data; D is the decryption algorithm;
[0030] SSL / TLS uses asymmetric encryption to securely exchange symmetric keys, and then uses symmetric encryption to protect data transmission;
[0031] Key exchange: Ks = Epub (K1)
[0032] Data encryption: C1=E1(Ks,P1)
[0033] Data decryption: P1 = D1 (Ks, C1)
[0034] Among them: Ks is the symmetric session key, Epub is the encryption function using the public key, K1 is the randomly generated session key, C1 is the encrypted ciphertext, P1 is the plaintext data, E1 and D1 are the symmetric encryption and decryption algorithms respectively.
[0035] Furthermore, the step S3 is specifically as follows:
[0036] Firstly, the Hopfield neural network is trained according to the normal load data so that the network can learn and store the patterns of these normal load data as attractors;
[0037] When new load data is input into the trained Hopfield neural network, the state of the network converges to the closest attractor and tries to recover the input data;
[0038] If the network successfully restores the input data to an attractor, the input data is considered normal, but if the network cannot restore the input data to any attractor, that is, the state of the network is unstable, the data can be marked as abnormal.
[0039] Furthermore, the state update rule of the Hopfield neural network is as follows:
[0040] For the state update of the i-th neuron:
[0041]
[0042] Where S_i is the state of the i-th neuron, w_{ij} is the connection weight between the i-th neuron and the j-th neuron, S_j is the state of the j-th neuron, theta_i is the threshold of the i-th neuron; energy function, N is the number of neurons:
[0043] The energy function is:
[0044]
[0045] Furthermore, the abnormal type recognition model performs abnormal pattern recognition on the user self-controlled load data based on the LSTM model, and updates the model parameters in combination with the Adam optimization algorithm, as follows:
[0046] The specific LSTM model is:
[0047] Input Gate:
[0048] Forget Gate:
[0049] Cell status update:
[0050]
[0051] Output Gate:
[0052] Hide status update:h t =o t ⊙tanh(C t )
[0053] Among them, x t is the input at time step t, h t is the hidden state at time step t, C t is the cell state at time step t, i t 、f t , o t are the activation values of the input gate, forget gate, cell state update and output gate respectively; σ is the sigmoid activation function, ⊙ is the dot multiplication operation; W and b are model parameters, and their subscripts are the corresponding models;
[0054] The Adam optimization algorithm updates the model parameters, and the update rules are:
[0055] m t =β1m t-1 +(1-β1)g t ;
[0056]
[0057]
[0058]
[0059]
[0060] Among them, m t and v t They are first-order moment estimation and second-order moment estimation respectively; and is the estimated value after bias correction; β1 and β2 are the decay rates; α is the learning rate; ε is the smoothing term; θ is the model parameter;
[0061] Furthermore, in order to prevent overfitting, when the Adam optimization algorithm updates the model parameters, the update rule is adjusted to a parameter update rule that includes L2 regularization:
[0062]
[0064] Among them, λ is the L2 regularization coefficient.
[0065] A real-time monitoring system for abnormal data of user self-controlled loads, comprising a data acquisition unit, a data transmission unit, a power grid cloud platform, a database, a data analysis unit, an abnormality identification unit and a user terminal;
[0066] The data acquisition unit collects load data from the user end and the grid end in real time according to the deployed smart meters and sensors, and also collects environmental data and user data, and pre-processes them;
[0067] The data transmission unit uses MQTT over SSL / TLS and IPSec VPN for double-layer encryption transmission, providing end-to-end protection for data from the user end to the power grid cloud platform;
[0068] The power grid cloud platform is based on a data analysis unit with a user self-controlled load anomaly detection model and an anomaly type recognition model embedded in it;
[0069] The user self-controlled load anomaly detection model performs user self-controlled load anomaly detection based on real-time collection of load data, environmental data at the user end and the power grid end, and user information data stored in the power grid cloud platform. If abnormal data is detected, the abnormal data is input into the abnormal type recognition model, and the abnormal warning is fed back to the user end;
[0070] The abnormal type recognition model obtains a specific abnormal type based on the abnormal data; based on the abnormal type output by the abnormal type recognition model, corresponding processing suggestions are obtained from the database of the power grid cloud platform, and the abnormal type and the corresponding processing suggestions are transmitted to the user end.
[0071] The present invention has the following beneficial effects:
[0072] 1. The present invention monitors the self-controlled load in real time, issues warnings in time, and notifies users to monitor and manage their own electricity consumption, thereby promoting energy efficiency and stable operation of the power grid;
[0073] 2. The present invention is based on real-time anomaly detection of Hopfield neural network. It utilizes the adaptability and pattern recovery ability of Hopfield neural network, identifies abnormal data by judging the stability of network status, and realizes rapid detection and response to user electricity consumption behavior by combining real-time data stream processing and neural network model. It also greatly enhances the communication security of smart grid system by combining MQTT over SSL / TLS and IPSec VPN.
[0074] 3. When abnormal data is detected, the system of the present invention can automatically trigger an alarm and record the abnormal data, and conduct further analysis to determine the cause and impact of the abnormality, helping operation and maintenance personnel to promptly discover and handle abnormal situations, thereby improving the safety and stability of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0076] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0077] In the present invention, reference Figure 1 , a real-time monitoring method for abnormal data of user self-controlled load, comprising the following steps:
[0078] Step S1: Collect load data from the user side and the grid side in real time according to the deployment of smart meters and sensors, and collect environmental data and user data at the same time, and pre-process them;
[0079] Step S2: Using MQTT over SSL / TLS and IPSec VPN for double-layer encryption transmission to provide end-to-end protection for data from the user end to the power grid cloud platform;
[0080] Step S3: The power grid cloud platform builds a user self-controlled load anomaly detection model based on the Hopfield neural network, and performs user self-controlled load anomaly detection based on real-time collection of load data and environmental data at the user end and the power grid end, as well as user information data stored in the power grid cloud platform. If abnormal data is detected, step S4 is performed, and an abnormal warning is fed back to the user end;
[0081] Step S4: input the abnormal data into the abnormal type recognition model to obtain the specific abnormal type;
[0082] Step S5: Based on the abnormal type output by the abnormal type identification model, corresponding processing suggestions are obtained from the power grid cloud platform, and the abnormal type and corresponding processing suggestions are transmitted to the user end.
[0083] In this embodiment, the step S1 is specifically as follows:
[0084] Step S11: Integrate the power consumption data, environmental data and user data into one data set, and clean the data to remove missing values, outliers and duplicate values to ensure the quality and accuracy of the data;
[0085] Step S12: extracting features from the cleaned data, including power consumption, temperature, humidity, enterprise type, and enterprise scale;
[0086] The required features are extracted from cleaned_data using the indexing functionality of pandas’ DataFrame by passing a list containing the required column names, where ‘electricity’, ‘temperature’, ‘humidity’, ‘enterprise_type’, and ‘enterprise_size’ are the names of the extracted feature columns;
[0087] Step S13: transform the features, perform smoothing, standardization and normalization.
[0088] Use the rolling method of pandas to select a window size, which represents the time range over which we want to calculate the moving average. This example selects 7 days as the window size, which means that we will calculate the moving average every 7 days. Then, call the rolling method on the time series data and call the mean method on it to calculate the moving average. This will apply a window containing 7 days of data to the data at each time point, and then calculate the average of these 7 days of data as the new value. In the end, a smoothed time series data is obtained, in which the value of each time point is based on the moving average of the 7 days of data around it.
[0089] A StandardScaler object is created, and then the fit_transform method is used to standardize the features. This will make the mean of each feature 0 and the variance 1, so that the features can be compared on the same scale; a MinMaxScaler object is created, and then the fit_transform method is used to normalize the features; this will scale the value range of each feature to between 0 and 1, thereby eliminating the numerical differences between features.
[0090] In this embodiment, the pandas library in Python is used for data integration and cleaning, as follows:
[0091] Use the read_csv method of the pandas library to read the electricity data, environment data, and user data by passing the path of the CSV file as a parameter, and store them in three DataFrames: electricity_data, environment_data, and user_data. Then use the pd.merge method to merge the three DataFrames according to timestamp and user ID. Merge electricity_data and environment_data according to the timestamp and user_id columns to get a new DataFrame. Then, merge the obtained DataFrame with user_data according to the user_id column to finally get a dataset merged_data containing multiple features.
[0092] Then, the dropna method is used to remove missing values in merged_data to ensure the integrity of the data. The power usage range is judged and data screening is used to remove abnormal power usage data. The drop_duplicates method is used to remove duplicate values in merged_data to ensure the uniqueness of each data.
[0093] In this embodiment, before data transmission, Python's gzip library is used, combined with pandas' to_csv method, to store the merged_data in the DataFrame as a Gzip-compressed CSV file. First, a Gzip-compressed file object is created using the gzip.open method, and then it is passed to the to_csv method, while specifying the compression parameter as gzip, and finally the merged_data is saved as a Gzip-compressed CSV file merged_data.csv.gz.
[0094] In this embodiment, the step S2 is specifically as follows:
[0095] Deploy VPN devices or services at the border of the power grid cloud platform and at remote clients, configure IPSec policies, and define the traffic that needs to be encrypted through the VPN tunnel; use the IKE protocol for key management and automatically negotiate security associations and encryption keys.
[0096] And configure SSL / TLS support on the MQTT broker, and configure the MQTT client on the client to connect to the broker using SSL / TLS
[0097] The client device first establishes a secure connection with the data center through an IPSec VPN tunnel. Through the VPN tunnel, all network layer data of the client device will be encrypted.
[0098] The client further establishes an MQTT over SSL / TLS connection through the established IPSec VPN tunnel, and the MQTT communication at the application layer is also encrypted by SSL / TLS.
[0099] The client device sends messages to the MQTT broker through a double-encrypted channel, and the power grid cloud platform receives and processes the encrypted data transmitted in the IPSec VPN tunnel via MQTT over SSL / TLS.
[0100] In this embodiment, the IPSec VPN, encryption and decryption are as follows:
[0101] Encryption: C = E (K, P)
[0102] Decryption: P = D (K, C)
[0103] Among them: C is the encrypted ciphertext, E is the encryption algorithm; K is the symmetric key; P is the plaintext data; D is the decryption algorithm;
[0104] SSL / TLS uses asymmetric encryption to securely exchange symmetric keys, and then uses symmetric encryption to protect data transmission;
[0105] Key exchange (asymmetric encryption): Ks = Epub (K1)
[0106] Data encryption (symmetric encryption): C1=E1(Ks,P1)
[0107] Data decryption (symmetric encryption): P1 = D1 (Ks, C1)
[0108] Among them: Ks is the symmetric session key, Epub is the encryption function using the public key, K1 is the randomly generated session key, C1 is the encrypted ciphertext, P1 is the plaintext data, E1 and D1 are the symmetric encryption and decryption algorithms respectively.
[0109] In this embodiment, step S3 is specifically as follows:
[0110] Firstly, the Hopfield neural network is trained according to the normal load data so that the network can learn and store the patterns of these normal load data as attractors;
[0111] When new load data is input into the trained Hopfield neural network, the state of the network converges to the closest attractor and tries to recover the input data;
[0112] If the network successfully restores the input data to an attractor, the input data is considered normal, but if the network cannot restore the input data to any attractor, that is, the state of the network is unstable, the data can be marked as abnormal.
[0113] In this embodiment, the state update rule of the Hopfield neural network is as follows:
[0114] For the state update of the i-th neuron:
[0115]
[0116] Where S_i is the state of the i-th neuron, w_{ij} is the connection weight between the i-th neuron and the j-th neuron, S_j is the state of the j-th neuron, theta_i is the threshold of the i-th neuron; energy function, N is the number of neurons:
[0117] The energy function is:
[0118]
[0119] In this embodiment, the abnormal type recognition model performs abnormal pattern recognition on the user self-controlled load data based on the LSTM model, and updates the model parameters in combination with the Adam optimization algorithm, as follows:
[0120] The specific LSTM model is:
[0121] Input Gate:
[0122] Forget Gate:
[0123] Cell status update:
[0124]
[0125] Output Gate:
[0126] Hide status update:h t =o t ⊙tanh(C t )
[0127] Among them, x t is the input at time step t, h t is the hidden state at time step t, C t is the cell state at time step t, i t 、f t , o tare the activation values of the input gate, forget gate, cell state update and output gate respectively; σ is the sigmoid activation function, ⊙ is the dot multiplication operation; W and b are model parameters, and their subscripts are the corresponding models;
[0128] The Adam optimization algorithm updates the model parameters, and the update rules are:
[0129] m t =β1m t-1 +(1-β1)g t ;
[0130]
[0131]
[0132]
[0133]
[0134] Among them, m t and v t They are first-order moment estimation and second-order moment estimation respectively; and is the estimated value after bias correction; β1 and β2 are the decay rates; α is the learning rate; ε is the smoothing term; θ is the model parameter;
[0135] Furthermore, in order to prevent overfitting, when the Adam optimization algorithm updates the model parameters, the update rule is adjusted to a parameter update rule that includes L2 regularization:
[0136]
[0138] Among them, λ is the L2 regularization coefficient.
[0139] In this embodiment, the present invention also provides a real-time monitoring system for abnormal data of user self-controlled loads, including a data acquisition unit, a data transmission unit, a power grid cloud platform, a database, a data analysis unit, an abnormality identification unit and a user terminal;
[0140] The data acquisition unit collects load data from the user end and the grid end in real time according to the deployed smart meters and sensors, and also collects environmental data and user data, and pre-processes them;
[0141] The data transmission unit uses MQTT over SSL / TLS and IPSec VPN for double-layer encryption transmission, providing end-to-end protection for data from the user end to the power grid cloud platform;
[0142] The power grid cloud platform is based on a data analysis unit with a user self-controlled load anomaly detection model and an anomaly type recognition model embedded in it;
[0143] The user self-controlled load anomaly detection model performs user self-controlled load anomaly detection based on real-time collection of load data, environmental data and user information data stored in the power grid cloud platform at the user end and the power grid end. If abnormal data is detected, step S4 is performed and an abnormal warning is fed back to the user end.
[0144] The abnormal type recognition model obtains a specific abnormal type based on the abnormal data; based on the abnormal type output by the abnormal type recognition model, corresponding processing suggestions are obtained from the database of the power grid cloud platform, and the abnormal type and the corresponding processing suggestions are transmitted to the user end.
[0145] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0146] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0147] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0148] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0149] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A real-time monitoring method for abnormal data of user self-controlled load, characterized in that: The following steps are involved: Step S1: Collect load data from the user side and the grid side in real time according to the deployment of smart meters and sensors, and collect environmental data and user data at the same time, and pre-process them; Step S2: Using MQTT over SSL / TLS and IPSec VPN for double-layer encryption transmission to provide end-to-end protection for data from the user end to the power grid cloud platform; Step S3: The power grid cloud platform builds a user self-controlled load anomaly detection model based on the Hopfield neural network, and performs user self-controlled load anomaly detection based on real-time collection of load data and environmental data at the user end and the power grid end, as well as user information data stored in the power grid cloud platform. If abnormal data is detected, step S4 is performed, and an abnormal warning is fed back to the user end; Step S4: input the abnormal data into the abnormal type recognition model to obtain the specific abnormal type; Step S5: based on the abnormal type output by the abnormal type recognition model, obtain corresponding processing suggestions from the power grid cloud platform, and transmit the abnormal type and the corresponding processing suggestions to the user end; The step S1 is specifically as follows: Step S11: Integrate the power consumption data, environmental data and user data into one data set, and clean the data to remove missing values, outliers and duplicate values to ensure the quality and accuracy of the data; Step S12: extracting features from the cleaned data, including power consumption, temperature, humidity, enterprise type, and enterprise scale; Step S13: converting the features, performing smoothing, standardization and normalization; Use the pandas library in Python to integrate and clean the data as follows; Use the read_csv method of the pandas library to read the electricity data, environment data, and user data by passing the path of the CSV file as a parameter, and store them in three DataFrames: electricity_data, environment_data, and user_data. Then use the pd.merge method to merge the three DataFrames according to timestamp and user ID. Merge electricity_data and environment_data according to the timestamp and user_id columns to get a new DataFrame. Then, merge the obtained DataFrame with user_data according to the user_id column to finally get a dataset merged_data containing multiple features. Then, the dropna method is used to remove missing values in merged_data to ensure data integrity. The power usage range is determined and data screening is used to remove abnormal power usage data. The drop_duplicates method is used to remove duplicate values in merged_data to ensure the uniqueness of each piece of data. Before data transmission, Python's gzip library is used in combination with pandas' to_csv method to store the merged_data in the DataFrame as a Gzip-compressed CSV file. First, a Gzip-compressed file object is created using the gzip.open method, and then it is passed to the to_csv method, with the compression parameter specified as gzip. Finally, the merged_data is saved as a Gzip-compressed CSV file merged_data.csv.gz.
2. A method for real-time monitoring of abnormal data of user self-controlled load according to claim 1, characterized in that: The step S2 specifically comprises: Deploy VPN devices or services at the edge of the power grid cloud platform and at remote clients, and configure IPSec policies to define the traffic that needs to be encrypted through the VPN tunnel; Use the IKE protocol for key management and automatic negotiation of security associations and encryption keys. And configure SSL / TLS support on the MQTT broker, and configure the MQTT client on the client to connect to the broker using SSL / TLS The client device first establishes a secure connection with the data center through an IPSec VPN tunnel. Through the VPN tunnel, all network layer data of the client device will be encrypted. The client further establishes an MQTT over SSL / TLS connection through the established IPSec VPN tunnel, and the MQTT communication at the application layer is also encrypted by SSL / TLS. The client device sends messages to the MQTT broker through a double-encrypted channel, and the power grid cloud platform receives and processes the encrypted data transmitted in the IPSec VPN tunnel via MQTT over SSL / TLS.
3. A method for real-time monitoring of abnormal data of user self-controlled load according to claim 5, characterized in that: The IPSec VPN, encryption and decryption are as follows: Encryption: C = E (K, P) Decryption: P = D (K, C) Among them: C is the encrypted ciphertext, E is the encryption algorithm; K is the symmetric key; P is the plaintext data; D is the decryption algorithm; SSL / TLS uses asymmetric encryption to securely exchange symmetric keys, and then uses symmetric encryption to protect data transmission; Key exchange: Ks = Epub (K1) Data encryption: C1=E1(Ks,P1) Data decryption: P1 = D1 (Ks, C1) Among them: Ks is the symmetric session key, Epub is the encryption function using the public key, K1 is the randomly generated session key, C1 is the encrypted ciphertext, P1 is the plaintext data, E1 and D1 are the symmetric encryption and decryption algorithms respectively.
4. A method for real-time monitoring of abnormal data of user self-controlled load according to claim 1, characterized in that: The step S3 is specifically as follows: Firstly, the Hopfield neural network is trained according to the normal load data so that the network can learn and store the patterns of these normal load data as attractors; When new load data is input into the trained Hopfield neural network, the state of the network converges to the closest attractor and tries to recover the input data; If the network successfully restores the input data to an attractor, the input data is considered normal, but if the network cannot restore the input data to any attractor, that is, the state of the network is unstable, the data can be marked as abnormal.
5. A method for real-time monitoring of abnormal data of user self-controlled load according to claim 4, characterized in that: The state update rules of the Hopfield neural network are as follows: For the state update of the i-th neuron: Among them, S_i is the state of the i-th neuron, w_{ij} is the connection weight between the i-th neuron and the j-th neuron, S_j is the state of the j-th neuron theta_i is the threshold of the i-th neuron; Energy function, N is the number of neurons: The energy function is:
6. A real-time monitoring method for abnormal data of user self-controlled load according to claim 1, characterized in that: The abnormal type recognition model performs abnormal pattern recognition on the user self-controlled load data based on the LSTM model, and updates the model parameters in combination with the Adam optimization algorithm, as follows: The specific LSTM model is: Input Gate: Forget Gate: Cell status update: Output Gate: Hide status update:h t =o t ⊙tanh(C t ) Among them, x t is the input at time step t, h t is the hidden state at time step t, C t is the cell state at time step t, i t 、f t , o t are the activation values of the input gate, forget gate, cell state update and output gate respectively; σ is the sigmoid activation function, ⊙ is the dot multiplication operation; W and b are model parameters, and their subscripts are the corresponding models; The Adam optimization algorithm updates the model parameters, and the update rules are: m t =β1m t-1 +(1-β1)g t ; Among them, m t and v t They are first-order moment estimation and second-order moment estimation respectively; and is the estimated value after bias correction; β1 and β2 are the decay rates; α is the learning rate; ε is the smoothing term; θ is the model parameter; Furthermore, in order to prevent overfitting, when the Adam optimization algorithm updates the model parameters, the update rule is adjusted to a parameter update rule that includes L2 regularization: in, λ is the L2 regularization coefficient.
7. A real-time monitoring system for abnormal data of user self-controlled load according to claim 1, characterized in that: It includes a data acquisition unit, a data transmission unit, a power grid cloud platform, a database, a data analysis unit, an abnormality identification unit and a user terminal; The data acquisition unit collects load data from the user end and the grid end in real time according to the deployed smart meters and sensors, and also collects environmental data and user data, and pre-processes them; The data transmission unit uses MQTT over SSL / TLS and IPSec VPN for double-layer encryption transmission, providing end-to-end protection for data from the user end to the power grid cloud platform; The power grid cloud platform is based on a data analysis unit with a user self-controlled load anomaly detection model and an anomaly type recognition model embedded in it; The user self-controlled load anomaly detection model performs user self-controlled load anomaly detection based on real-time collection of load data, environmental data at the user end and the power grid end, and user information data stored in the power grid cloud platform. If abnormal data is detected, the abnormal data is input into the abnormal type recognition model, and the abnormal warning is fed back to the user end; The abnormal type recognition model obtains a specific abnormal type based on the abnormal data; based on the abnormal type output by the abnormal type recognition model, corresponding processing suggestions are obtained from the database of the power grid cloud platform, and the abnormal type and the corresponding processing suggestions are transmitted to the user end.
