Big data-based intelligent electricity sale quantity prediction method and system

By using the LSTM-TFT hybrid model based on big data in the power industry for intelligent prediction of power sales, the problem that traditional prediction methods are difficult to cope with complex power grid demand is solved, accurate prediction and intelligent decision-making are achieved, and the risk of supply and demand imbalance is reduced.

CN119831268APending Publication Date: 2025-04-15STATE GRID INFO TELECOM GREAT POWER SCI & TECH
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411914926.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Traditional power demand forecasting methods are difficult to meet the complex demand of modern power grids, especially when facing multidimensional and dynamic factors such as seasonal changes, weather conditions, user behavior and electricity price fluctuations, the prediction accuracy is insufficient, resulting in an increase in the risk of supply and demand imbalance.

Method used

Using a smart prediction method for power sales based on big data, we use dynamic modeling of time series and external features to build an LSTM-TFT hybrid model, combining feature importance algorithms and mutual information algorithms, redundant features are eliminated, and accurate prediction is achieved.

Benefits of technology

It realizes accurate prediction of electricity sales, improves the intelligent decision-making ability of the power grid, reduces the risk of supply and demand imbalance, and provides accurate data support and classification basis by extracting characteristics such as equipment operation time and electricity price fluctuation sensitivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831268A_ABST
    Figure CN119831268A_ABST
Patent Text Reader

Abstract

The invention relates to a big data-based intelligent electricity sale quantity prediction method, which comprises the following steps of S1, collecting multi-dimensional data related to electricity sale quantity, and establishing a unified data warehouse S2, constructing multi-dimensional features; s3, using a feature importance algorithm and a mutual information algorithm to quantify the relation between the features and the target variables, and rejecting redundant features; s4, constructing an intelligent electricity sale quantity prediction model based on the LSTM-TFT hybrid model; and S5, processing the real-time streaming data by using Spark Streaming, generating online features, deploying a trained model LSTM-TFT hybrid model, and obtaining a prediction result through TF-Serving. According to the method, the time sequence and the external features are dynamically modeled, so that accurate prediction of the electricity sale quantity is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electricity quantity forecasting, and in particular to a method and system for intelligent forecasting of electricity sales quantity based on big data. Background Art

[0002] With the rapid development of the power industry and the continuous changes in the energy consumption structure, traditional power demand forecasting methods have been unable to meet the complex needs of modern power grids. In recent years, the power grid has been affected by multidimensional and dynamic factors, including seasonal changes, weather conditions, user behavior, and electricity price fluctuations. At the same time, the increase in the proportion of new energy sources (such as wind power, photovoltaics, etc.) and the fluctuation of power load have made power demand forecasting more complex and important. How to accurately predict power sales through advanced technical means, improve the operational efficiency of the power grid, and reduce the risk of supply and demand imbalance has become a key issue that needs to be urgently solved in the current power industry. . Summary of the invention

[0003] In order to solve the above problems, the purpose of the present invention is to provide a method and system for intelligent prediction of electricity sales based on big data, which can achieve accurate prediction of electricity sales by dynamically modeling time series and external characteristics.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] A method for intelligent prediction of power sales based on big data, comprising the following steps:

[0006] S1: Collect multi-dimensional data related to electricity sales and establish a unified data warehouse;

[0007] S2: construct multi-dimensional features, including time features, weather features, user behavior features, and grid supply and demand features;

[0008] S3: Use feature importance algorithm and mutual information algorithm to quantify the connection between features and target variables and eliminate redundant features;

[0009] S4: Build an intelligent prediction model for electricity sales based on the LSTM-TFT hybrid model;

[0010] S5: Use Spark Streaming to process real-time streaming data, generate online features, and deploy the trained LSTM-TFT hybrid model to obtain prediction results through TF-Serving.

[0011] Furthermore, S1 is as follows:

[0012] Collect multi-dimensional data related to electricity sales, including: historical electricity consumption of electricity users, electricity price policies, preferential policies, electricity market data, meteorological data, social and economic development data, and time characteristic data;

[0013] Based on historical electricity consumption data, users are divided into categories according to equipment operation time and sensitivity to electricity price fluctuations;

[0014] Establish a unified data warehouse to support the storage, integration and analysis of multi-dimensional data and meet the query requirements of different types of data.

[0015] Furthermore, based on historical electricity consumption data, users are further refined and classified according to equipment operation time and sensitivity to electricity price fluctuations, as follows:

[0016] Collect historical electricity consumption data, extract features of user electricity consumption behavior, and form a multi-dimensional user portrait;

[0017] Electricity usage behavior includes equipment operation time and electricity price sensitivity. The equipment operation time is obtained by accumulating the time when the power exceeds the equipment working state threshold:

[0018] Where P(t i )≥P th ;

[0019] Where P(t) is the power consumed by the device at a specified time; P th is the working threshold power of the device; Δt is the collection time interval; run is the total operation time of the device; T is the monitoring time;

[0020] By analyzing the user's electricity consumption response to electricity price fluctuations, the user's electricity price sensitivity coefficient S is quantified. price :

[0021]

[0022] Among them, Y(t) is the electricity consumption of a user at time t; P(t) is the electricity price at time t; is the historical average of electricity prices; is the relative electricity price fluctuation; Cov(Y(t), ΔP(t)) is the covariance between user electricity consumption and electricity price fluctuation; Var(ΔP(t)) is the variance of electricity price fluctuation;

[0023] Analyze the seasonal and time-periodic behavior of users' electricity consumption through historical electricity consumption patterns, and construct key features; calculate the equipment operation time and electricity price fluctuation sensitivity indicators, and conduct behavioral attribute modeling;

[0024] Based on the above behavior characteristics, a label is constructed and a feature table is generated for the user according to the following rules, including total power consumption, device operation time T run , electricity price sensitivity coefficient S price, the proportion of peak / valley electricity consumption; seasonal fluctuations in electricity consumption patterns. Based on these characteristics, a user behavior data matrix is ​​formed:

[0025] X={x 1 ,x 2 ,...,x i ,...,x n};

[0026] x i ={T run ,S price ,total power consumption,...};

[0027] According to the extracted user behavior feature X, based on the classification algorithm K-means, the user group is further segmented and divided into residential, commercial, and industrial sub-groups according to behavioral similarities.

[0028] Furthermore, the data warehouse adopts a layered data warehouse architecture, which is divided into a data source layer, a data integration layer, a data storage layer and a data application layer. The data source layer includes all original data sources; the data integration layer: extracts, converts and loads data through ETL tools, and performs data cleaning and standardization, unifies the time format, unit, and field name, and associates different data sources according to the time dimension and user dimension; the data storage layer stores structured data in a relational database; unstructured data is stored in a distributed file system; time series data is stored in a time series database; partitioned by user type; and layered by time dimension; the data application layer provides data query and analysis capabilities, supports OLAP queries, and provides feature data for prediction models; the data interface provides unified data access services through API queries.

[0029] Furthermore, S3 is specifically:

[0030] The feature weight analysis of the tree model is used to preliminarily screen the features that contribute significantly to electricity sales. The split nodes of the tree model are calculated based on the information gain of the features. The contribution of each feature is recorded during the training process of the model to quantify the importance of the feature. f :

[0031]

[0032] Gain(X f ,i) is feature X f Information gain contribution in the i-th split; n is the number of all splits; use the tree model to directly output w for each feature f ; Filter important features and remove features with weights lower than the threshold λ;

[0033] The mutual information algorithm is used to quantify the correlation between features and target variables and eliminate redundant features. Mutual information is used to measure the amount of information shared between two variables. The formula is as follows:

[0034]

[0035] Among them, p(x,y) is the joint probability distribution of feature x and target y; p(x) and p(y) are the marginal probability distributions of feature x and target y respectively;

[0036] Based on mutual information, we further analyze the redundancy between features. i ,x j Redundant mutual information of:

[0037]

[0038] If MI(x i ,x j )>ξ, where ξ is the threshold, and one of them is eliminated.

[0039] Furthermore, S4 is specifically:

[0040] For each user segment, an independent LSTM-TFT hybrid model is built. LSTM extracts time series trends, while TFT integrates external dynamic and static features and dynamically models feature importance.

[0041] For each group, construct {X t ,Y t} Input prediction model, where X t Y is the time series feature after removing redundant features. t is the predicted electricity sales;

[0042] Construct dynamic external features based on external factors that change dynamically over time, including electricity prices, temperature, humidity, and holidays Based on constant features, including user type, geographic location, and grid configuration, static features F are constructed. static ;

[0043] Through LSTM, the input sequence X t Calculate h in sequence t , get the last layer of temporal features H LSTM :

[0044] H LSTM ={h t-T+1 ,h t-T+2 , ..., h t-1};

[0045] The LSTM is specifically as follows:

[0046] Input layer: X t ;

[0047] Forget gate: f t =σ(W f ·|h t-1 ,X t |+b f );

[0048] Input gate: I t =σ(W I ·|h i-1 ,X ti |+b I );

[0049] Candidate values:

[0050] Cell status update:

[0051] Output gate: o t =σ(W o ·|h t-1 ,x t |+b 0 );

[0052] Hide status update:h t =o t tanh(C t );

[0053] Output layer: Y t ;

[0054] Among them, x t is the input feature vector at time step t; h t-1 is the hidden state at time step t; f t For the Forget Gate; t is the input gate; is the candidate value; that is, the candidate memory cell at the current moment; C t is the cell state; it indicates the memory cell state at the current moment; o t is the output gate; h t is the hidden state at the current moment; W f , W I , W C , W o are the weight matrices of the forget gate, input gate, candidate value, and output gate respectively; b f 、b I 、b C 、b 0 They are the bias vectors of the forget gate, input gate, candidate value, and output gate respectively;

[0055] Combined with the hidden state H extracted by LSTM LSTM , dynamic external features and static characteristics F static , as the input of TFT; dynamically integrate external features and background variables through the attention mechanism, and model the dynamic impact of features on the current prediction;

[0056] The mixed feature vector obtained from LSTM and TFT is input into a fully connected neural network to transform it into the final target prediction value.

[0057] Furthermore, TFT is specifically:

[0058] The input is divided into two parts: time series input features and the context static variable F Context =F static ;

[0059] TFT uses a multi-head attention mechanism to model the dynamic impact of external features on the target variable:

[0060]

[0061] Where Q = W Q ·F TFT-Input is the Query matrix; K = W K ·F TFT-Input To represent context features; V = W V ·F TFT-Input is the eigenvalue itself; W Q ,W K ,W V is the corresponding weight; d k is the scaling factor of the feature dimension;

[0062] Global expression of the long mechanism:

[0063] MHA(Q, K, V) = Concat(head 1 , head 2 , ..., head h )·W O ;

[0064] Each head learns the dynamic response weights of features from different angles; W O is the linear transformation weight;

[0065] By fusing the attention output and static features, we construct the dynamic weight α at time step t t :

[0066] α t =φ(W context ·F Context +bontext );

[0067] Where φ is the activation function;

[0068] Dynamically calculate the weighted sum of each time series feature to obtain the mixed vector output:

[0069]

[0070] in, are input features, is the dynamic attention weight.

[0071] Furthermore, S5 is specifically:

[0072] Real-time streaming data enters the system through the Kafka message queue, including power consumption data and dynamic external features (weather, electricity prices, etc.);

[0073] Use Spark Streaming to decompress data streams from Kafka, extract and aggregate real-time features;

[0074] Deploy the trained LSTM-TFT hybrid model and use TensorFlow Serving to process streaming data and generate prediction results;

[0075] The prediction results and their corresponding features are stored in the database for use by downstream systems.

[0076] A power sales volume intelligent prediction system based on big data includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically executes the steps in the power sales volume intelligent prediction method based on big data as described above.

[0077] The present invention has the following beneficial effects:

[0078] 1. The present invention can not only extract complex rules from historical data, but also perceive changes in the external environment in real time. By dynamically modeling time series and external characteristics, it can achieve accurate prediction of electricity sales and effectively improve the intelligent decision-making ability of the power grid;

[0079] 2. The present invention extracts features such as equipment operation time and sensitivity to electricity price fluctuations, and combines the classification model K-means to perform detailed analysis on user electricity consumption behavior, providing accurate data support and classification basis for electricity sales forecast and power supply strategy optimization; and combines the importance analysis of the tree model and the nonlinear correlation between the mutual information quantitative features and the target variable to effectively screen key features and remove redundant features, which will bring higher prediction accuracy and model efficiency in actual electricity sales forecast, while maintaining good interpretability;

[0080] 3. The electricity sales forecasting scheme based on the LSTM-TFT hybrid model of the present invention can simultaneously model historical electricity consumption trends and external time dependencies, achieve high-precision forecasting by integrating multiple features, and make full use of the time series modeling capability of LSTM and the dynamic feature weighting mechanism of TFT to provide data-driven power for optimizing electricity sales strategies. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0082] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0083] refer to Figure 1 In this embodiment, a method for intelligent prediction of power sales based on big data is provided, comprising the following steps:

[0084] S1: Collect multi-dimensional data related to electricity sales and establish a unified data warehouse;

[0085] S2: Construct multidimensional features, including time features: including labels such as hours, days, weeks, months, holidays, working days, and seasonal features. Weather features: variables such as daily average temperature, maximum temperature difference, accumulated precipitation, etc. that are highly correlated with fluctuations in electricity demand. User behavior features: user category, equipment power consumption characteristics, electricity price sensitivity coefficient (such as the proportion of applied electricity in the tiered electricity price segment). Grid supply and demand features: such as current power reserves and dispatch frequency;

[0086] S3: Use feature importance algorithm and mutual information algorithm to quantify the connection between features and target variables and eliminate redundant features;

[0087] S4: Build an intelligent prediction model for electricity sales based on the LSTM-TFT hybrid model;

[0088] S5: Build a low-latency and highly available online prediction system that supports real-time prediction and flexible deployment. The raw data enters the message queue Kafka in real time.

[0089] S6: Use Spark Streaming to process real-time streaming data, generate online features, and deploy the trained LSTM-TFT hybrid model to obtain prediction results through TF-Serving.

[0090] In this embodiment, S1 is specifically as follows:

[0091] Collect multi-dimensional data related to electricity sales, including: historical electricity consumption of electricity users (by time period: daily, monthly, and annual dimensions), electricity price policies, preferential policies, electricity market data, meteorological data (including meteorological characteristics such as temperature, humidity, and wind speed that can affect electricity consumption), social and economic development data (GDP, industrial development index, population changes), and time characteristic data (holidays, working days, seasonal fluctuations);

[0092] Based on historical electricity consumption data, users are divided into categories according to equipment operation time and sensitivity to electricity price fluctuations;

[0093] Establish a unified data warehouse to support the storage, integration and analysis of multi-dimensional data and meet the query requirements of different types of data.

[0094] In this embodiment, based on the historical electricity consumption data, the users are classified by equipment operation time and sensitivity to electricity price fluctuations, as follows:

[0095] Collect historical electricity consumption data, extract features of user electricity consumption behavior, and form a multi-dimensional user portrait;

[0096] Electricity usage behavior includes equipment operation time and electricity price sensitivity. The equipment operation time is obtained by accumulating the time when the power exceeds the equipment working state threshold:

[0097] Where P(t i )≥P th ;

[0098] Where P(t) is the power consumed by the device at a specified time; P th is the working threshold power of the device; Δt is the collection time interval; run is the total operation time of the device; T is the monitoring time;

[0099] By analyzing the user's electricity consumption response to electricity price fluctuations, the user's electricity price sensitivity coefficient S is quantified. price :

[0100]

[0101] Among them, Y(t) is the electricity consumption of a user at time t; P(t) is the electricity price at time t; is the historical average of electricity prices; is the relative electricity price fluctuation; Cov(Y(t), ΔP(t)) is the covariance between user electricity consumption and electricity price fluctuation; Var(ΔP(t)) is the variance of electricity price fluctuation;

[0102] Analyze the seasonal and time-periodic behavior of users' electricity consumption through historical electricity consumption patterns, and construct key features; calculate the equipment operation time and electricity price fluctuation sensitivity indicators, and conduct behavioral attribute modeling;

[0103] Based on the above behavior characteristics, a label is constructed and a feature table is generated for the user according to the following rules, including total power consumption (by day and month), device operation time T run , electricity price sensitivity coefficient S price , peak / valley electricity consumption ratio (time-based electricity consumption statistics); seasonal fluctuations in electricity consumption patterns. Based on these characteristics, a user behavior data matrix is ​​formed:

[0104] X={x 1 ,x 2 ,...,x i ,...,x n};

[0105] x i ={T run ,S price ,total power consumption,...};

[0106] According to the extracted user behavior feature X, based on the classification algorithm K-means, the user group is further segmented and divided into residential, commercial, and industrial sub-groups according to behavioral similarities.

[0107] In this embodiment, the data warehouse adopts a layered data warehouse architecture, which is divided into a data source layer, a data integration layer, a data storage layer and a data application layer. The data source layer includes all original data sources; the data integration layer: extracts, converts and loads data through ETL tools, and performs data cleaning and standardization, unifies the time format, unit, and field name, and associates different data sources according to the time dimension and user dimension; the data storage layer stores structured data, such as historical electricity consumption and electricity price policies, in a relational database (MySQL / PostgreSQL); unstructured data, such as meteorological data and logs, are stored in a distributed file system (Hadoop HDFS or MinIO); time series data, such as load curve data, is stored in a time series database (InfluxDB, TimeScaleDB); partitions are performed by user type (residential, commercial, industrial); and layers are performed by time dimension (day, month, year); the data application layer provides data query and analysis capabilities, supports OLAP (online analytical processing) queries, and provides feature data for prediction models; the data interface provides unified data access services through API queries.

[0108] In this embodiment, S3 is specifically:

[0109] The feature weight analysis of the tree model is used to preliminarily screen the features that contribute significantly to electricity sales. The split nodes of the tree model are calculated based on the information gain of the features. The contribution of each feature is recorded during the training process of the model to quantify the importance of the feature. f :

[0110]

[0111] Gain(X f ,i) is feature X f Information gain contribution in the i-th split; n is the number of all splits; use the tree model to directly output w for each feature f ; Filter important features and remove features with weights lower than the threshold λ;

[0112] The mutual information algorithm is used to quantify the correlation between features and target variables and eliminate redundant features. Mutual information is used to measure the amount of information shared between two variables. The formula is as follows:

[0113]

[0114] Among them, p(x,y) is the joint probability distribution of feature x and target y; p(x) and p(y) are the marginal probability distributions of feature x and target y respectively;

[0115] Based on mutual information, we further analyze the redundancy between features. i ,x j Redundant mutual information of:

[0116]

[0117] If MI(x i ,x j )>ξ, where ξ is the threshold, and one of them is eliminated.

[0118] In this embodiment, S4 is specifically:

[0119] For each user segment, an independent LSTM-TFT hybrid model is built. LSTM extracts time series trends, while TFT integrates external dynamic and static features and dynamically models feature importance.

[0120] For each group, construct {X t ,Y t} Input prediction model, where X t Y is the time series feature after removing redundant features. t is the predicted electricity sales;

[0121] Construct dynamic external features based on external factors that change dynamically over time, including electricity prices, temperature, humidity, and holidays Based on constant features, including user type, geographic location, and grid configuration, static features F are constructed. static ;

[0122] Through LSTM, the input sequence X t Calculate h in sequence t , get the last layer of temporal features H LSTM :

[0123] H LSTM ={h t-T+1 ,h t-T+2 , ..., h t-1};

[0124] The LSTM is specifically as follows:

[0125] Input layer: X t ;

[0126] Forget gate: f t =σ(W f ·|h t-1 ,X t |+b f );

[0127] Input gate: I t =σ(W I ·|h i-1 ,X ti |+b I );

[0128] Candidate values:

[0129] Cell status update:

[0130] Output gate: o t =σ(W o ·|h t-1 ,x t |+b 0 );

[0131] Hide status update:h t =o t tanh(C t );

[0132] Output layer: Y t ;

[0133] Among them, x t is the input feature vector at time step t; h t-1 is the hidden state at time step t; f t For the Forget Gate; t is the input gate; is the candidate value; that is, the candidate memory cell at the current moment; C t is the cell state; it indicates the memory cell state at the current moment; o t is the output gate; h t is the hidden state at the current moment; W f , W I , W C , W o are the weight matrices of the forget gate, input gate, candidate value, and output gate respectively; b f 、b I 、b C 、b 0 They are the bias vectors of the forget gate, input gate, candidate value, and output gate respectively;

[0134] Combined with the hidden state H extracted by LSTM LSTM , dynamic external features and static characteristics F static , as the input of TFT; dynamically integrate external features and background variables through the attention mechanism, and model the dynamic impact of features on the current prediction;

[0135] The mixed feature vector obtained from LSTM and TFT is input into a fully connected neural network to transform it into the final target prediction value.

[0136] In this embodiment, TFT is specifically:

[0137] The input is divided into two parts: time series input features and the context static variable F Context =F static ;

[0138] TFT uses a multi-head attention mechanism to model the dynamic impact of external features on the target variable:

[0139]

[0140] Where Q = W Q ·F TFT-Input is the Query matrix; K = W K ·F TFT-Input To represent context features; V = W V ·F TFT-Input is the eigenvalue itself; W Q ,W K ,W V is the corresponding weight; d k is the scaling factor of the feature dimension;

[0141] Global expression of the long mechanism:

[0142] MHA(Q, K, V) = Concat(head 1 , head 2 , ..., head h )·W O ;

[0143] Each head learns the dynamic response weights of features from different angles; W O is the linear transformation weight;

[0144] By fusing the attention output and static features, we construct the dynamic weight α at time step t t :

[0145] α t =φ(W context ·F Context +b context );

[0146] Where φ is the activation function;

[0147] Dynamically calculate the weighted sum of each time series feature to obtain the mixed vector output:

[0148]

[0149] in, are input features, is the dynamic attention weight.

[0150] In this embodiment, S5 is specifically:

[0151] Real-time streaming data enters the system through the Kafka message queue, including power consumption data and dynamic external features (weather, electricity prices, etc.);

[0152] Use Spark Streaming to decompress data streams from Kafka, extract and aggregate real-time features;

[0153] Deploy the trained LSTM-TFT hybrid model and use TensorFlow Serving to process streaming data and generate prediction results;

[0154] The prediction results and their corresponding features are stored in the database for use by downstream systems.

[0155] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0156] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce 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.

[0157] 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.

[0158] 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.

[0159] 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 method for intelligent prediction of electricity sales based on big data, characterized in that: The following steps are involved: S1: Collect multi-dimensional data related to electricity sales and establish a unified data warehouse; S2: construct multi-dimensional features, including time features, weather features, user behavior features, and grid supply and demand features; S3: Use feature importance algorithm and mutual information algorithm to quantify the connection between features and target variables and eliminate redundant features; S4: Build an intelligent prediction model for electricity sales based on the LSTM-TFT hybrid model; S5: Use Spark Streaming to process real-time streaming data, generate online features, and deploy the trained LSTM-TFT hybrid model to obtain prediction results through TF-Serving.

2. The intelligent prediction method for power sales based on big data according to claim 1 is characterized in that: The S1 is specifically as follows: Collect multi-dimensional data related to electricity sales, including: historical electricity consumption of electricity users, electricity price policies, preferential policies, electricity market data, meteorological data, social and economic development data, and time characteristic data; Based on historical electricity consumption data, users are divided into categories according to equipment operation time and sensitivity to electricity price fluctuations; Establish a unified data warehouse to support the storage, integration and analysis of multi-dimensional data and meet the query requirements of different types of data.

3. The intelligent prediction method for power sales based on big data according to claim 2 is characterized in that: Based on the historical electricity consumption data, the user is refined and classified according to the equipment operation time and sensitivity to electricity price fluctuations, as follows: Collect historical electricity consumption data, extract features of user electricity consumption behavior, and form a multi-dimensional user portrait; Electricity usage behavior includes equipment operation time and electricity price sensitivity. The equipment operation time is obtained by accumulating the time when the power exceeds the equipment working state threshold: Where P(t i )≥P th ; Where P(t) is the power consumed by the device at a specified time; P th is the working threshold power of the device; Δt is the collection time interval; run is the total operation time of the device; T is the monitoring time; By analyzing the user's electricity consumption response to electricity price fluctuations, the user's electricity price sensitivity coefficient S is quantified. price : Among them, Y(t) is the electricity consumption of a user at time t; P(t) is the electricity price at time t; is the historical average of electricity prices; is the relative electricity price fluctuation; Cov(Y(t), ΔP(t)) is the covariance between user electricity consumption and electricity price fluctuation; Var(ΔP(t)) is the variance of electricity price fluctuation; Analyze the seasonal and time-periodic behavior of users' electricity consumption through historical electricity consumption patterns, and construct key features; calculate the equipment operation time and electricity price fluctuation sensitivity indicators, and conduct behavioral attribute modeling; Based on the above behavior characteristics, a label is constructed and a feature table is generated for the user according to the following rules, including total power consumption, device operation time T run , electricity price sensitivity coefficient S price , the proportion of peak / valley electricity consumption; seasonal fluctuations in electricity consumption patterns. Based on these characteristics, a user behavior data matrix is ​​formed: X={x1,x2,…,x i ,…,x n }; x i ={T run ,S price ,total power consumption,...}; According to the extracted user behavior feature X, based on the classification algorithm K-means, the user group is further segmented and divided into residential, commercial, and industrial sub-groups according to behavioral similarities.

4. The intelligent prediction method for power sales based on big data according to claim 2 is characterized in that: The data warehouse adopts a layered data warehouse architecture, which is divided into a data source layer, a data integration layer, a data storage layer and a data application layer. The data source layer includes all original data sources; the data integration layer: extracts, converts and loads data through ETL tools, and performs data cleaning and standardization, unifies the time format, unit, and field name, and associates different data sources according to the time dimension and user dimension; the data storage layer stores structured data in a relational database; stores unstructured data in a distributed file system; and stores time series data in a time series database; partitions by user type; and layers by time dimension; The data application layer provides data query and analysis capabilities, supports OLAP queries, and provides feature data for prediction models; Data interface, providing unified data access services through API query.

5. The intelligent prediction method for power sales based on big data according to claim 1 is characterized in that: The S3 is specifically: The feature weight analysis of the tree model is used to preliminarily screen the features that contribute significantly to electricity sales. The split nodes of the tree model are calculated based on the information gain of the features. The contribution of each feature is recorded during the training process of the model to quantify the importance of the feature. f : Gain(X f ,i) is feature X f Information gain contribution in the i-th split; n is the number of all splits; use the tree model to directly output w for each feature f ; Filter important features and remove features with weights lower than the threshold λ; The mutual information algorithm is used to quantify the correlation between features and target variables and eliminate redundant features. Mutual information is used to measure the amount of information shared between two variables. The formula is as follows: Among them, p(x,y) is the joint probability distribution of feature x and target y; p(x) and p(y) are the marginal probability distributions of feature x and target y respectively; Based on mutual information, we further analyze the redundancy between features. i ,x j Redundant mutual information of: If MI(x i ,x j )>ξ, where ξ is the threshold, and one of them is eliminated.

6. The method for intelligent prediction of power sales based on big data according to claim 3 is characterized in that: The S4 is specifically: For each user segment, an independent LSTM-TFT hybrid model is built. LSTM extracts time series trends, while TFT integrates external dynamic and static features and dynamically models feature importance. For each group, construct {X t ,Y t } Input prediction model, where X t Y is the time series feature after removing redundant features. t is the predicted electricity sales; Construct dynamic external features based on external factors that change dynamically over time, including electricity prices, temperature, humidity, and holidays Based on constant features, including user type, geographic location, and grid configuration, static features F are constructed. static ; Through LSTM, the input sequence X t Calculate h in sequence t , get the last layer of temporal features H LSTM : H LSTM ={h t-T+1 ,h t-T+2 ,...,h t-1 }; The LSTM is specifically as follows: Input layer: X t ; Forget gate: f t =σ(W f ·|h t-1 ,X t |+b f ); Input gate: I t =σ(W I ·|h i-1 ,X ti |+b I ); Candidate values: Cell status update: Output gate: o t =σ(W o ·|h t-1 ,x t |+b0); Hide status update:h t =o t tanh(C t ); Output layer: Y t ; Among them, x t is the input feature vector at time step t; h t-1 is the hidden state at time step t; f t For the Forget Gate; t is the input gate; is the candidate value; that is, the candidate memory cell at the current moment; C t is the cell state; it indicates the memory cell state at the current moment; o t is the output gate; h t is the hidden state at the current moment; W f , W I , W C , W o are the weight matrices of the forget gate, input gate, candidate value, and output gate respectively; b f 、b I 、b C , b0 are the bias vectors of the forget gate, input gate, candidate value and output gate respectively; Combined with the hidden state H extracted by LSTM LSTM , dynamic external features and static characteristics F static , as the input of TFT; dynamically integrate external features and background variables through the attention mechanism, and model the dynamic impact of features on the current prediction; The mixed feature vector obtained from LSTM and TFT is input into a fully connected neural network to transform it into the final target prediction value.

7. The method for intelligent prediction of power sales based on big data according to claim 6 is characterized in that: The TFT is specifically: The input is divided into two parts: time series input features and the context static variable F Context =F static ; TFT uses a multi-head attention mechanism to model the dynamic impact of external features on the target variable: Where Q = W Q ·F TFT-Input is the Query matrix; K = W K ·F TFT-Input To represent context features; V = W V ·F TFT-Input is the eigenvalue itself; W Q ,W K ,W V is the corresponding weight; d k is the scaling factor of the feature dimension; Global expression of the long mechanism: MHA(Q,K,V)=Concat(head1,head2,...,head h )·W O ; Each head learns the dynamic response weights of features from different angles; W O is the linear transformation weight; By fusing the attention output and static features, we construct the dynamic weight α at time step t t : a t =φ(W contex ·F Context +b context ); Where φ is the activation function; Dynamically calculate the weighted sum of each time series feature to obtain the mixed vector output: in, are input features, is the dynamic attention weight.

8. The intelligent prediction method for power sales based on big data according to claim 1 is characterized in that: The S5 is specifically: Real-time streaming data enters the system through the Kafka message queue, including power consumption data, dynamic external features (; Use Spark Streaming to decompress data streams from Kafka, extract and aggregate real-time features; Deploy the trained LSTM-TFT hybrid model and use TensorFlow Serving to process streaming data and generate prediction results; The prediction results and their corresponding features are stored in the database for use by downstream systems.

9. An intelligent prediction system for electricity sales based on big data, characterized in that: It includes a processor, a memory and a computer program stored in the memory. When the processor executes the computer program, it specifically executes the steps in the intelligent prediction method for power sales based on big data as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Multi-level power market user file dynamic collaborative management method and system

    CN120013088A

  • Multi-head attention dynamic optimization method oriented to power grid topology self-adaption

    CN120146321A

  • Non-intrusive load identification method based on high-frequency power data

    CN120873561A

  • A non-intrusive load identification method based on high-frequency power data

    CN120873561B

  • Electricity purchasing and selling integrated intelligent analysis and decision-making system and method based on data platform

    CN121660732A