A. Methods of electricity demand prediction
The three most commonly used electricity prediction methods are the classic prediction method, the traditional prediction model, and the intelligent prediction model. (1) Classic prediction methods include trend extrapolation method, classified electricity demand prediction method, and load density method. These prediction methods are widely used, but most of them analyze the relationship between some simple variables and lack in-depth data analysis; therefore, the prediction accuracy is often low [12]. (2) Traditional prediction methods include the regression analysis method, which establishes the relationship between the dependent variables and known load data and predicts the electricity system’s load using mathematical analysis. Applications of the time-series method include the exponential smoothing method and the Census-H Decomposition method; the random time series methods include the state space method, the Box-Jenkins method, and the Markov method [13]. According to the given data, the relationship between the variable and the dependent variable is determined, and the regression equation and various parameters are found. Based on the obtained equation, the dependent variable is obtained from the existing independent variables, and finally, the electricity prediction data are obtained. (3) When there are large random factors in historical electricity demand, the prediction effect is flawed and is greatly affected by bad data in the time series. In recent years, the electricity market has become increasingly complicated. Classic prediction methods and traditional prediction methods cannot adapt to the nonlinear, multi-variable, time-varying, and random characteristics of the electricity market. Hence, some new prediction methods are used in electricity demand prediction. The laws are extracted to establish a knowledge base for reasoning and judgment based on real experience [14]. The detailed comparison results of the advantages and disadvantages are shown in Table 1.
TABLE I: Comparison of different electricity demand prediction methods
Recognition methods
|
Advantage
|
Disadvantage
|
Classical prediction method
|
The broadest range of applications and the most extended use time
|
Lack of scientific theory, low prediction accuracy
|
Traditional predictive model
|
More substantial data analysis capabilities and higher model accuracy
|
The algorithm runs for a long time and requires high system configuration
|
Intelligent prediction model
|
Higher prediction accuracy
|
Time-consuming database construction
|
B. K-means clustering algorithm
(1) Algorithm utilization: At present, smart grid construction needs to comply with market laws and rely on its competitiveness to achieve the survival and development of enterprises. The core is to fully understand all users, improve user experience, and enhance user loyalty. For customer segmentation, the traditional segmentation method uses a single indicator and cannot effectively divide users. With the development of smart cities and the advancement of big data technology, a large amount of data can be obtained, while data mining technology can be used to extract the required indicators to segment power customers [15]. Currently, among data mining algorithms, the K-Mean clustering algorithm has attracted the attention of many scholars due to its simple implementation and high efficiency.
The K-means clustering algorithm uses the distance of the target data as an evaluation indicator to measure the similarity. When the distance between two objects is small, the similarity between these data is relatively high. This type of algorithm usually consists of a group of relatively close objects, and the final goal is to obtain a data group with a compact distance and a high degree of separation [16].
(2) Algorithm principle: the initial dataset is assumed as (x1, x2 … xn), and each data unit ring is a p-dimensional vector (the p-dimensional vector is composed of p eigenvalues). The K-means clustering algorithm’s goal is to divide the original dataset into K categories G={G1, G2, …, Gk} with a given number of categories k (k=n). Each iteration of the K-means clustering algorithm must check whether the classification of each data unit is correct. If it is classified into the wrong category, the data must be adjusted. When the adjusted data is clustered with k points in the space as the center and the next iteration starts, the value of each cluster center is updated in turn until the cluster center does not change, indicating that the clustering criterion function has converged, and the best clustering result is got [17]. The algorithm’s workflow is shown in Figure 2.
C. Backpropagation (BP) neural network algorithm
Artificial Neural Network (ANN) is composed of numerous neurons, in which these neurons are connected. ANN has a strong nonlinear mapping ability [18]. BP neural network is a multi-layer feedforward network trained according to the backpropagation algorithm [19]. The topological structure of the BP neural network algorithm model includes an input layer, a hidden layer, and an output layer, as shown in Figure 2.
BP neural network is usually composed of multiple layers and multiple neurons, which are mainly divided into an input layer, a hidden layer, and an output layer [20]: The input vector should be:
In (3), sl is the number of neurons in the l-th layer. Assuming that is the connection weight between the j-th neuron in the l-th layer, is the threshold of the i-th neuron in the l-th layer, and is the input of the i-th neuron in the l-th layer, the following equation can be obtained:
D. Electricity user segmentation model
(1) Overall framework: based on the above theory, the primary database of smart cities is utilized to establish a functional structure model for electricity user segmentation (Figure 3). First, a data warehouse is established. Then, relevant user segmentation data are extracted for data analysis. Afterward, data are cleaned and conversed. The association analysis method is adopted for data mining, and finally, the mining results are analyzed. The primary smart city database is the foundation of the entire model. Pre-processing of data is the guarantee for real and effective mining results. The effectiveness of user segmentation depends largely on selecting user consideration standards and establishing measurements. The adopted mining method based on actual needs is the key to the entire model.
(2) User segmentation: currently, the research and the adopted electricity data analysis technology use traditional data mining and statistical methods. The smart city public primary database data are added to the electricity big data analysis for improving the algorithm’s accuracy and usability. Besides, the big data method is utilized for prediction, and the used data types are as many as possible. The prediction task that has been impossible previously can be completed by exploring the data association relationship, which can ensure high precision simultaneously. The electricity value of the population analyzes users’ electricity value from a personal perspective and obtains the gathering area of high-potential users through personal information and social insurance information.
(3) Data processing: for confidentiality concerns, the Dongfangtong TI-ETL tools, and data desensitization technology are utilized to transform sensitive or confidential information through desensitization rules, thereby protecting the sensitive and private data. For some missing data, the citizen’s name, gender, address, and other elements are extracted from other information. Various social security databases are integrated, and the collected information is used to roughly restore the demographic information and provide the basis for electricity user segmentation.
(4) Algorithm realization: it is divided into population electricity value information, enterprise commercial value distribution, and macroeconomic information. For human electricity value information, as shown in Figure 4, the electricity users are segmented, and the integrated resident data are arranged in a table from high to low in the order of individual units according to residents’ social insurance information, social security information, corporate information, and the potential and influence of electricity use. Each administrative district is taken as a unit. As for the data of the corporate legal person, the legal person’s registered capital is used as the analysis target, and the social insurance information is based on the insurance amount, the social security information based on the subsidy amount, and the housing provident fund based on the monthly payment amount [21].
The distribution of enterprise value is shown in Figure 5. The organization code is used as the search basis to match each commission, office, and bureau’s source data. The evaluation and ranking are based on four dimensions: business category, registered capital, annual turnover, and the number of employees. Each administrative district is taken as a unit. For corporate legal person’s data, K-means cluster analysis is performed based on turnover, registered capital, and the number of employees. For business categories, the conversion weight ratio of the construction industry to turnover is set to 10%, that of the manufacturing is 100%, the wholesale retail industry is 30%, and the service industry is 15% [22].
In terms of the macro-economic information, the macro value evaluation aims to evaluate the administrative districts’ electricity consumption potential for the segmentation of electricity users. The data of some districts can be accurate to the administrative streets. According to previous studies, several significant data categories are selected, such as regional Gross Domestic Product (GDP), per capita disposable income, per capita GDP, total asset investment, and trade data [23].
Five districts A, B, C, D, and E in a city are chosen for empirical research. In District A, four companies are chosen from the industrial area A11-A14; in District B, four companies are chosen from the office building area B11-B14; in District C, four neighborhoods are selected from the residential areas C11-C14; District D and E are comparison controls.
E. Model of electricity demand prediction
(1) Impact indicators: electric energy consumption is affected by multiple factors. However, traditional prediction introduces fewer factors as variables. These methods only consider the internal data of electricity companies and fail to fully consider the impact of changes in other factors on prediction. Therefore, the prediction accuracy of electricity information is very limited [24]. The external information of electricity companies provided by the primary database of smart cities is fully utilized. Given the impact of changes in various relevant objects on the prediction value, the prediction of regional annual electricity consumption is researched involving multiple influencing factors.
In addition to the electricity companies’ factors, the total electricity consumption is also affected by many factors such as population and corporate trends, economic conditions, energy policies, and electricity price adjustments. In particular, the development of social and economic operations needs to consume a large amount of electric energy, and there is a correlation between electricity consumption and economic indicators [25]. There are many statistical dimensions of economic data. The characteristic relationship of a district’s social product, per capita GDP, price index, total import and export, and other economic indicators are combined with the internal data of electricity companies to establish a mathematical model for electricity consumption prediction [26]. The specific names of the data indicators are as follows: (1) macroeconomic data; (2) policies and other external data; (3) regional electricity consumption data in past years; (4) electricity user segmentation data.
(2) Normalization processing: ANN usually normalizes the data before training. The training effects of different transfer functions are different to avoid neuron oversaturation [27]. The input data value must be within [0,1], which is the characteristic requirement of the transfer activation function. Therefore, the original data of the network must be processed. The original data are normalized, and the equation is as follows:
In (6), is the i-th feature parameter after normalization, is the original i-th feature parameter, is the minimum value of the i-th feature parameter, and is the maximum value of the i-th feature parameter.
(3) Parameter determination: after preliminary experiments, a three-layer network model structure with a hidden layer is determined. The number of neurons is 18, and the logsig transformation function is used. The number of neurons in the second layer is the same as the number of output variable vectors, and the output layer uses a pure linear transformation function. The input feature parameters are 65; that is, the number of input layer nodes is 65, and the number of output layer nodes is 5. Generally, increasing the number of nodes in the hidden layer can reduce the network’s training error more than increasing the number of hidden layers. The BP neural network algorithm can be set as a three-layer structure to map the n-dimensional input layer to the m-dimensional output layer. Therefore, the number of hidden layers in the network is determined as 1. When applying a neural network for electricity prediction, the reference equations for selecting the number of hidden layer neurons are as follows:
In (7) and (8), h is the number of nodes in the hidden layer, m is the number of nodes in the input layer, and n is the number of nodes in the output layer. After a comprehensive comparison of experiments, the number of nodes in the hidden layer is selected as 18. The S-tangent tansing is selected as the activation function for hidden layer neurons, and the activation function for output layer neurons is the S-type logarithmic logsig function.
(4) Data source: The streaming data in the power grid come from the collection of smart meters, PMUs, and various sensors. These data are large in scale, diverse in structure, and fast. To accurately obtain the electricity consumption data of different electric equipment of users, the electric power company has installed a large number of smart meters, which will send real-time electricity consumption information to the grid every 5 minutes. The real-time collection of streaming data requires the characteristics of fast collection speed, high reliability, real-time monitoring of data changes, and simple data processing. Therefore, the collection system is a distributed, reliable, and highly available system of massive log aggregation, which can monitor and receive data from the client and send it out. When a node fails, the log file is transferred to other nodes without loss, ensuring data integrity.
F. System improvement and verification
(1) System improvement: the influence of changing trends on the error surface. The BP neural network may fall into a local minimum, which can be prevented by the additional momentum. The adjustment equations for weight and threshold with additional momentum factor are:
In (9) and (10), w is the weight vector, k is the number of training, mc is the momentum factor, is the learning rate, is the gradient of the error function, and and are the correlation coefficients.
(2) Clustering algorithm evaluation: Here, the K-means clustering algorithm uses the square-error and criterion function to evaluate the clustering performance. X represents the given dataset, and each data unit is a p-dimensional feature vector. It is set to K categories. The algorithm randomly selects k data as the starting cluster center analyzes the distance from each data unit to the cluster and divides the data into the array sink where the corresponding cluster center is located. It is supposed that X contains k data groups X1, X2 … Xk, the amount of data units in each data group is m1, m2, ..., mk; the cluster centers of each data group are n1, n2, ..., nk. The used square error equation [28] is:
(3) BP neural network training: the training times of the neural network is 10,000, the expected error of training is 0.02, and the learning rate is 0.01. The pre-processed data matrix is imported into MATLAB and normalized. The newff function is employed to establish a BP neural network model. After the calculation, the data go through the denormalization processing, and the MATLAB toolbox performs calculations to obtain the relative error percentage and the predicted electricity demand value.