A method and system for predicting enterprise energy consumption based on time series profiling technology

Through the enterprise energy consumption prediction method based on timing image technology, the generalized addition of nonlinear regression model and long and short-term memory network are used to solve the shortcomings of existing energy consumption prediction methods in dealing with dynamic changes and nonlinear relationships, and more accurate and universal energy consumption prediction is achieved.

CN118313548BActive Publication Date: 2025-03-14STATE GRID SHANDONG ELECTRIC POWER CO
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410409923.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-07
Publication Date
2025-03-14
Estimated Expiration
2044-04-07

AI Technical Summary

Technical Problem

The existing energy consumption prediction methods have limitations in data requirements and stability assumptions, lack the ability to deal with dynamic changes and nonlinear relationships, rely on feature engineering and high parameter adjustment, insufficient processing capacity for complex seasonal data, and lack considerations for industry, region and other dimensions.

Method used

The enterprise energy consumption prediction method based on timing image technology is adopted to obtain historical energy consumption data, identify and correct missing values ​​and outliers, extract the characteristics of energy consumption data, build timing image, and use a generalized addition nonlinear regression model and a long and short-term memory network combined with whale optimization algorithm to predict energy consumption.

Benefits of technology

It realizes a good sample nonlinear fitting function, has adaptive, self-organizing and self-learning capabilities, as well as large-scale parallel computing capabilities, and can perform time splitting, industry classification and comprehensive energy consumption prediction under regional fences, improving the accuracy and universality of the prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118313548B_ABST
    Figure CN118313548B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of information processing technology, and provides a method and system for predicting enterprise energy consumption based on time series portrait technology. In the present invention, missing values ​​and abnormal values ​​in historical energy consumption data are identified, and the missing values ​​and abnormal values ​​are corrected to obtain processed energy consumption data; based on the analysis of the enterprise energy consumption pattern, the characteristics of the processed energy consumption data are extracted to construct the enterprise time series portrait; according to the constructed time series portrait, a preset energy consumption prediction model is used to obtain an energy consumption prediction result; through the shallow time series feature learning of the time series portrait, and the deep time series feature learning, not only the characteristics in the time series data are deeply mined, but also the enterprise energy consumption pattern is considered, so that the real situation behind the data can be understood more comprehensively, and the energy consumption prediction model adopted has a good sample nonlinear fitting function, has a strong ability of self-adaptation, self-organization and self-learning, and has the ability of large-scale parallel computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information processing technology, and in particular relates to a method and system for predicting enterprise energy consumption based on time series profiling technology. Background Art

[0002] The main methods for predicting energy consumption include: modeling and forecasting based on historical energy consumption data through the moving average method, exponential smoothing method and seasonal decomposition method in statistical methods; learning the nonlinear relationship of data and the complex interaction between features through linear regression, support vector regression, decision tree and random forest algorithm in machine learning methods to improve the accuracy of energy consumption forecasting; and capturing the trend and autocorrelation of time series data and conducting energy consumption forecasting through the autoregressive moving average model and autoregressive integrated moving average model in time series analysis methods.

[0003] The inventors found that the existing energy consumption forecasting methods have their own limitations in terms of data requirements and stability assumptions, insufficient ability to handle dynamic changes and nonlinear relationships, high requirements for feature engineering and parameter adjustment, insufficient ability to handle complex seasonal data, and excessive reliance on sample size and computing resources. In addition, the existing methods lack consideration of dimensions such as industry and region, and the granularity of the required data cannot be freely defined, resulting in the inability to fill in the data under multiple time series with predicted values, and the inability to make a unified time slice system for the data, making it difficult to coordinate external data such as industry enterprise capacity, output, market conditions, industrial structure, etc.; it is impossible to complete the comprehensive energy consumption forecast under time segmentation, industry classification, and regional fences. Summary of the invention

[0004] In order to solve the above problems, the present invention proposes a method and system for predicting enterprise energy consumption based on time series profiling technology. The present invention can have good sample nonlinear fitting function, strong self-adaptation, self-organization and self-learning capabilities, as well as large-scale parallel computing capabilities; neural network modeling can be used to perform time splitting, industry classification and comprehensive energy consumption prediction under regional fences.

[0005] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0006] In a first aspect, the present invention provides a method for predicting enterprise energy consumption based on time series profiling technology, comprising:

[0007] Obtain the company’s historical energy consumption data;

[0008] Identify missing values ​​and outliers in historical energy consumption data, and correct them to obtain processed energy consumption data;

[0009] Based on the analysis of the enterprise's energy consumption pattern, the characteristics of the processed energy consumption data are extracted to build a time series portrait of the enterprise;

[0010] According to the constructed time series portrait, the energy consumption prediction results are obtained by using the preset energy consumption prediction model;

[0011] Among them, when learning the energy consumption prediction model, a generalized additive nonlinear regression model is used to learn shallow time series features, and a long short-term memory network combined with a whale optimization algorithm is used to learn deep time series features, and the learned shallow time series features and deep time series features are combined to predict energy consumption.

[0012] Furthermore, the horizontal short-term year-on-year anomaly detection method is used to detect whether the data in the time window follows the periodic characteristics, and the year-on-year amplitude longitudinal anomaly detection method is used to detect whether each value in the time series data satisfies the horizontal periodic characteristics of the sequence that changes at every moment within the same day, so as to identify missing values ​​and outliers.

[0013] Furthermore, the missing values ​​and outliers are corrected based on the Lagrange interpolation method:

[0014]

[0015] in, Fill in missing values ​​and outliers; and The first i and j The sampling time of each data point; is the number of sample points used to construct the polynomial; Energy consumption data.

[0016] Furthermore, the energy consumption time series data are reduced in dimension based on local linear embedding. For the reduced time series data, probability density fitting is performed on the long-term development characteristics of the load based on the non-parametric kernel density estimation method, and the corresponding energy consumption curves and related characteristics are obtained at the enterprise level and industry level respectively. Based on the energy consumption curves and related characteristics, the construction of the enterprise energy consumption time series portrait is completed.

[0017] Furthermore, the final prediction results for:

[0018]

[0019] in, Based on the generalized additive nonlinear regression model t Energy consumption forecast at the moment; Based on long short-term memory network t Energy consumption forecast at the moment; and is the weight.

[0020] Furthermore, the mean absolute percentage error is used as the loss function of the whale algorithm.

[0021] Furthermore, when the loss value reaches the requirement, the optimization parameters are obtained, and the loss function TrainingLoss is defined as:

[0022]

[0023] in, The prediction result is predicted values; is the first True value; n is the number of prediction samples.

[0024] In a second aspect, the present invention further provides an enterprise energy consumption prediction system based on time series profiling technology, comprising:

[0025] The data acquisition module is configured to: acquire historical energy consumption data of the enterprise;

[0026] The abnormality identification module is configured to: identify missing values ​​and abnormal values ​​in the historical energy consumption data, and correct the missing values ​​and abnormal values ​​to obtain processed energy consumption data;

[0027] The time series profile building module is configured to: extract the features of the processed energy consumption data based on the analysis of the enterprise's energy consumption pattern and build the enterprise's time series profile;

[0028] The energy consumption prediction module is configured to: obtain energy consumption prediction results based on the constructed time series portrait and using a preset energy consumption situation prediction model;

[0029] Among them, when learning the energy consumption prediction model, a generalized additive nonlinear regression model is used to learn shallow time series features, and a long short-term memory network combined with a whale optimization algorithm is used to learn deep time series features, and the learned shallow time series features and deep time series features are combined to predict energy consumption.

[0030] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for predicting enterprise energy consumption based on time series profiling technology described in the first aspect.

[0031] In a fourth aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for predicting enterprise energy consumption based on time series profiling technology described in the first aspect are implemented.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. In the present invention, first, the missing values ​​and outliers in the historical energy consumption data are identified, and the missing values ​​and outliers are corrected to obtain the processed energy consumption data; then, based on the analysis of the enterprise energy consumption pattern, the characteristics of the processed energy consumption data are extracted to construct the enterprise time series portrait; finally, according to the constructed time series portrait, the energy consumption prediction result is obtained by using the preset energy consumption situation prediction model; wherein, when learning the energy consumption situation prediction model, the shallow time series features are learned by using the generalized additive nonlinear regression model, and the deep time series features are learned by using the long short-term memory network combined with the whale optimization algorithm, and the learned The shallow time series features and deep time series features of the time series portrait are used to predict energy consumption; by learning the shallow time series features of the time series portrait and the deep time series features, not only the features in the time series data are deeply mined, but also the energy consumption mode of the enterprise is considered, which can more comprehensively understand the real situation behind the data. In addition, the energy consumption situation prediction model adopted has good sample nonlinear fitting function, strong self-adaptation, self-organization and self-learning capabilities, and large-scale parallel computing capabilities; the energy consumption situation prediction model can be used to perform time splitting, industry classification and comprehensive energy consumption prediction under regional fences;

[0034] 2. Traditional energy consumption forecasting methods often only focus on single or a few dimensions of data, such as historical energy consumption data or certain fixed external factors. However, this invention uses time series profiling technology to not only deeply mine the patterns, trends and periodicity in time series data, but also combines multi-dimensional information such as industry characteristics and regional differences. This deep integration enables the forecasting model to more fully understand the real situation behind the data;

[0035] 3. The present invention uses a generalized additive nonlinear regression model and a long short-term memory network LSTM combined with the whale optimization algorithm WOA to build a model, which not only takes into account the time series characteristics of the data, but also captures the nonlinear relationship in the data; in addition, the introduction of time series profiling technology allows the pattern, trend and periodicity of the data to be fully considered, greatly improving the accuracy of the prediction;

[0036] 4. Existing energy consumption prediction methods often lack consideration of dimensions such as industry and region, resulting in the need for a large amount of customized development in different application scenarios. The prediction system of the present invention not only takes into account the characteristics of time series data, but also combines factors such as industry characteristics and regional differences, making the system highly universal and able to be quickly deployed and applied in both large industrial enterprises and small commercial units. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings in the specification that constitute a part of this embodiment are used to provide a further understanding of this embodiment. The schematic embodiments of this embodiment and their descriptions are used to explain this embodiment and do not constitute improper limitations on this embodiment.

[0038] Figure 1 is a flow chart of the method of embodiment 1 of the present invention;

[0039] Figure 2 Constructing a basic flow chart for the enterprise energy consumption data portrait of Example 1 of the present invention;

[0040] Figure 3 This is a flow chart of the power load prediction model of WOA-LSTM according to Embodiment 1 of the present invention;

[0041] Figure 4 This is a flow chart of the whale optimization algorithm of Example 1 of the present invention;

[0042] Figure 5 This is a structural diagram of the LSTM model of WOA-LSTM in Example 1 of the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0044] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0045] Embodiment 1:

[0046] The existing energy consumption monitoring systems only have comprehensive analysis and monitoring functions in the fields of energy consumption, energy efficiency, unit consumption and energy conservation. They cannot realize energy consumption forecasting and cannot provide forward-looking decision-making basis for energy consumption quota allocation. Specifically, the existing energy consumption forecasting methods have their own limitations in terms of data requirements and stability assumptions, insufficient ability to handle dynamic changes and nonlinear relationships, high requirements for feature engineering and parameter adjustment, insufficient ability to handle complex seasonal data, and excessive reliance on sample size and computing resources. In addition, the existing methods lack consideration of dimensions such as industry and region, and the granularity of the required data cannot be freely defined, resulting in the inability to fill in the data under multiple time series with predicted values, and the inability to make a unified time slice system for the data. It is difficult to coordinate external data such as industry and enterprise production capacity, output, market conditions, industrial structure, etc.; it is impossible to complete time segmentation, industry classification, and comprehensive energy consumption forecasting under regional fences.

[0047] In view of the above problems, this embodiment provides a method for predicting enterprise energy consumption based on time series profiling technology. Through time series profiling technology, the historical energy consumption data of the enterprise is deeply analyzed and predicted, so as to provide the enterprise with more accurate and forward-looking energy consumption prediction results; not only the pattern, trend and periodicity of time series data are considered, but also the industry characteristics, regional differences and other factors are combined to make the prediction more accurate and practical; the method includes:

[0048] Obtain the company’s historical energy consumption data;

[0049] Identify missing values ​​and outliers in historical energy consumption data, and correct them to obtain processed energy consumption data;

[0050] Based on the analysis of the enterprise's energy consumption pattern, the characteristics of the processed energy consumption data are extracted to build a time series portrait of the enterprise;

[0051] According to the constructed time series portrait, the energy consumption prediction results are obtained by using the preset energy consumption prediction model;

[0052] Among them, when learning the energy consumption prediction model, a generalized additive nonlinear regression model is used to learn shallow time series features, and a long short-term memory network combined with a whale optimization algorithm is used to learn deep time series features, and the learned shallow time series features and deep time series features are combined to predict energy consumption.

[0053] Specifically, by learning the shallow time series features of the time series portrait and the deep time series features, we not only deeply explore the features in the time series data, but also take into account the energy consumption patterns of the enterprises, so as to have a more comprehensive understanding of the real situation behind the data. In addition, the energy consumption prediction model adopted has good sample nonlinear fitting function, strong self-adaptation, self-organization and self-learning capabilities, as well as large-scale parallel computing capabilities; the energy consumption prediction model can be used to perform time splitting, industry classification and comprehensive energy consumption prediction under regional fences.

[0054] Time series data is data collected at different times and used to describe how phenomena change over time. This type of data reflects the state or degree of change of a thing or phenomenon over time. Data profiling technology is a technology that organizes, mines and analyzes large amounts of data to draw the overall picture, characteristics and behavior patterns of users or entities. Time series profiling draws the overall picture and characteristics of data by analyzing and mining the patterns, trends and periodicity in time series data, as well as the relationship with other factors. The main purpose is to predict unknown data based on existing historical data of the enterprise.

[0055] The specific steps of the method in this embodiment are:

[0056] S1. Identify missing values ​​and abnormal values ​​in the original energy consumption data, and complete the correction of missing and abnormal data;

[0057] S2. Build a time series portrait for each enterprise through the processed data;

[0058] S3, modeling the neural network through the enterprise energy consumption characteristics in the portrait;

[0059] S4. Predict the energy consumption of the enterprise and optimize the time series profile and model based on the prediction results.

[0060] As one or more embodiments, the step 1: identifying missing values ​​and abnormal values ​​in the original energy consumption data, and completing the correction of the missing and abnormal data, specifically includes the following steps:

[0061] Missing values ​​and outliers are identified based on the short-term month-on-month horizontal anomaly detection method and the year-on-year amplitude longitudinal anomaly detection method, and missing and bad data are filled based on the Lagrange interpolation method.

[0062] Specifically, for energy consumption time series data, The value of time for There is a strong dependence on time. The horizontal short-term month-on-month anomaly detection method is used to obtain the most recent time window ( ) follows the periodic characteristics of the data. Set to , take the test value ( ) is the previous filling value and the past If the time is greater than the threshold, Add 1 if Exceeding the setting , then the point is considered to be an outlier, and the formula is as follows:

[0063]

[0064]

[0065] in, It is the short-term month-on-month horizontal anomaly detection result, 0 means no anomaly, 1 means anomaly; For the moment data, ; Dynamic value It is for The time series data within the time window is calculated. The maximum value of the data in the time window is , the minimum value is , the average value is .

[0066] Each value in the time series data must not only satisfy the horizontal periodicity characteristics of the sequence that changes at all times within the same day, but also satisfy the continuous n The longitudinal periodic characteristics followed at the same time of the day. The year-on-year amplitude longitudinal anomaly detection method can be used to find outliers in the energy consumption time series data. The formula is as follows:

[0067]

[0068]

[0069]

[0070] in, The year-on-year amplitude longitudinal anomaly detection result, 0 means no anomaly, 1 means anomaly; For reference to the past sky The data at the moment is obtained The amplitude value takes the maximum value, ; Static threshold It is calculated for the whole day time series data. The maximum value of the whole day data is MAX , the minimum value is MIN , the average value is AVG.

[0071] If both methods show that the data is normal, the data is considered normal. On the contrary, if one or more methods show abnormality, the data at that point is considered abnormal. For abnormal points and missing points, select the neighboring points of the point. m Normal data points are used as samples to calculate the Lagrange polynomial:

[0072]

[0073] in, and The first The sampling time of each data point; is the number of sample points used to construct the polynomial; finally, the missing moments Substitution The filling values ​​of missing and abnormal moments can be obtained.

[0074] In step S2, a time series profile is constructed for each enterprise using the processed data, such as Figure 2 As shown, the specific steps include:

[0075] S2.1. Preliminary classification of enterprises based on industry classification standards;

[0076] S2.2, Enterprise energy consumption pattern based on cluster analysis;

[0077] S2.3, extracting enterprise electricity consumption characteristics;

[0078] S2.4. Build a profile of enterprise energy consumption.

[0079] The method of step S2.1 is as follows:

[0080] Optionally, the standard GB / T4754-2017 is used as a benchmark to preliminarily classify enterprises according to their industry types. This standard specifies the classification and codes of economic activities in the whole society. Using GB / T4754-2017 as the standard for user classification ensures the accuracy and comprehensiveness of the classification, which is the premise and basis for cluster analysis of enterprise groups in various industries and the construction of enterprise energy consumption portraits.

[0081] The method of step S2.2 is as follows:

[0082] Optionally, Locally Linear Embedding (LLE) is used to reduce the dimension of the energy consumption time series data to ensure that the refined time series data obtained after the dimension reduction can help the clustering algorithm to better divide the samples. Its working principle is as follows:

[0083] For the sample set , set the number of nearest neighbors and the dimension d after dimensionality reduction;

[0084] Using Euclidean distance as a metric, calculate each sample Recent Nearest Neighbor ;

[0085] For each sample , find the local covariance matrix , and find the corresponding weight coefficient vector:

[0086]

[0087] By weight coefficient vector Composition weight coefficient matrix , calculate the matrix ;

[0088] Calculating the Matrix Before eigenvalues ​​and calculate this The eigenvalues ​​corresponding to the eigenvectors ;

[0089] From the second eigenvector to the The matrix composed of the eigenvectors is the low-dimensional sample set matrix after dimensionality reduction. .

[0090] The specific working principle of fuzzy C-means clustering (FCM) based on LLE dimensionality reduction is as follows:

[0091] Setting parameters: According to the size of the industry's user group, determine the number range of industry electricity consumption patterns and set the minimum number of clusters at the beginning of the algorithm. , maximum number of clusters And the parameters related to the FCM algorithm, let ;

[0092] Execute clustering algorithm: Assume that there are Enterprises, of which users The energy consumption curve is ,right The energy consumption curve of each user is clustered using the LLE-FCM algorithm;

[0093] Evaluation of clustering effect: The silhouette coefficient is used to evaluate the compactness and separability of clustering. The silhouette coefficient for:

[0094]

[0095]

[0096]

[0097] in, express and The average distance of the remaining samples within the class; express AND The minimum average distance of class sample distances; The closer it is to 1, the better the sample compactness and class separability, and the better the clustering effect. The silhouette coefficient of all samples is averaged to evaluate the effectiveness of this clustering, which is expressed as follows:

[0098]

[0099] If the current number of clusters Then And repeat the clustering algorithm until ;

[0100] The optimal number of clusters is the one with the largest mean value of the silhouette coefficient. After normalizing the various cluster centers obtained by this clustering, the typical energy consumption curve of the industry is obtained. The typical curve of the energy consumption mode is recorded as .

[0101] The method of step S2.3 is as follows:

[0102] The non-parametric kernel density estimation method is used to perform probability density fitting on the long-term development characteristics of the load, and then extract typical characteristics. Its working principle is as follows:

[0103] Taking the saturated load density as an example, assuming that There are 100 companies with typical energy consumption patterns , of which users The saturation load density is , then the probability density function of this feature is for:

[0104]

[0105] in, is the kernel function ; h is the bandwidth.

[0106] Select the probability density fitting function The point with the largest value is taken as the typical characteristic value of this type of typical energy consumption mode:

[0107]

[0108] in For the Typical characteristic values ​​of saturated load density for typical energy consumption patterns.

[0109] The method of step S2.4 is as follows:

[0110] After completing the energy consumption characteristics analysis from the enterprise level to the industry level, the corresponding energy consumption curves and related features were obtained at the enterprise level and industry level respectively. These features include energy consumption trends, periodicity, mutation points, etc. Based on these features, the construction of the enterprise energy consumption time series portrait is completed.

[0111] In step S3, the neural network is modeled based on the energy consumption characteristics of the enterprise in the portrait. The specific steps include:

[0112] S3.1. Learning shallow time series features based on Prophet: The Prophet model can integrate the features extracted from the time series portrait with the original energy consumption data as the input of the model;

[0113] S3.2, learning deep temporal features based on WOA-LSTM;

[0114] S3.3. Obtain the prediction value after joint optimization by assigning weights and performing weighted summation.

[0115] Specifically: Located in t The energy consumption forecast values ​​at each time are and , the weights are and , the final prediction result is , the formula is as follows:

[0116]

[0117] The specific principle of learning shallow time series features based on Prophet is:

[0118] Growth module by fitting logistic regression to trend term in time series , Fourier series periodic modules of periodic terms , irregular fluctuation module caused by holidays and the error term for unpredictable factors To complete the prediction, the formula is as follows:

[0119]

[0120] in, To represent the predicted value under shallow time series features.

[0121] Trend: For example, at certain change points such as the changing months of seasons, the trend of each segment of energy consumption data will change with the situation. In order to mine the trend changes of nonlinear growth contained in the time series, the segmented logistic regression growth algorithm is used. Indicates trend changes, the formula is as follows:

[0122]

[0123]

[0124] in, is the saturation value of the curve; is the curve growth rate; express The changes of the moment; is the midpoint of the curve; for The offset after smoothing at each moment; For the A turning point moment.

[0125] Periodicity: Most time series have periodic changes such as days, weeks, months, and years. All periodic functions can be represented by superposition of sine and cosine functions, so flexible periodic models are constructed using Fourier series. Represents periodic changes, the formula is as follows:

[0126]

[0127] in, For the cycle; is the smoothing parameter; is the Fourier order.

[0128] Holidays: Irregular holidays will cause large fluctuations in the prediction of the induction motor ratio. The Prophet model sets holidays to be separated from each other, and can set different impact ranges before and after holidays. The formula is as follows:

[0129]

[0130] in, is the regression matrix of the set holidays; Represents the set of time windows before and after the holiday; Represents the prior parameters of each holiday, which follows a normal distribution; The factors affecting this holiday are: The larger the value, the higher the impact of the holiday;

[0131] In addition, for other features in the feature profile The introduction of can expand the model to:

[0132]

[0133] in, is the regression coefficient, indicating the characteristic Impact on energy consumption.

[0134] like Figure 3 As shown in the figure, the LSTM model based on WOA is constructed. The specific steps include:

[0135] The mean absolute percentage error (MAPE) is used as the loss function of the whale algorithm. When the loss value reaches the requirement, the optimization parameter is obtained. The loss function TrainingLoss is defined as:

[0136]

[0137] in, The prediction result is predicted values; is the first True value; n is the number of prediction samples.

[0138] like Figure 4 As shown, WOA initializes the population, updates its position according to the optimal value in evolution, determines the update method, and iterates until the model parameters meet the requirements. Specifically:

[0139] Initialize the search particle in the search space of WOA. When , WOA enters local search. When , WOA enters global search, the formula is as follows:

[0140]

[0141]

[0142]

[0143] in, is the current number of iterations; Indicates the maximum number of iterations; is a number related to the number of iterations The relevant parameter, which decreases from 2 to 0 as the number of iterations increases; and is a coefficient used to adjust the whale's search behavior, Is a random number.

[0144] In the local search phase, other particles update their position information while approaching the optimal particle. Modeling is done through two methods: shrinkage and spiral update. Represents the best solution so far.

[0145] Specifically, the shrinking and encircling phase:

[0146] At this stage, Therefore The range of the search particle It may reach any position, and the position update formula of the search particle is as follows:

[0147]

[0148]

[0149] in, is the distance between the target and the search particle.

[0150] Specifically, the spiral update phase:

[0151] The formula for updating the position of a particle through the spiral equation is as follows:

[0152]

[0153]

[0154] in, represents the distance between the optimal solution and the search particle, is a constant coefficient, Is a random number.

[0155] Whales hunt by combining two methods to capture food, introducing probability To determine how the whale preys at this time, the formula is as follows:

[0156]

[0157] in, is the probability of random generation, when When the shrinking and encircling method is adopted, A spiral update method is adopted.

[0158] In the global search phase, a search particle is randomly selected from the population for update, and other particles move away from this particle to perform a global search. The search formula is as follows:

[0159]

[0160]

[0161] in, The search particle with the table is randomly selected from the population.

[0162] First, the population is randomly initialized. During the iteration process, if the optimal particle changes, update When the termination condition is met, the iteration is terminated. Parameters In WOA, global and local searches are performed alternately. WOA can avoid local optimal solutions and accurately find the global optimal solution.

[0163] like Figure 5 The figure shows the structure of a single neuron in the LSTM model, which consists of three parts: input gate, forget gate and output gate. for Input data at the moment; and , respectively and Hidden layer output at each moment; , They are and The state of the cell unit at the moment; express function; express Function; the output value is 0 or 1, which describes the ratio of information transmission and indicates the amount of information allowed to be transmitted. and From the previous moment , and to decide.

[0164] Its working principle is:

[0165] Forget gate: choose to forget some past information (through The control gate forgets part of the cell state, where The activation function is often used as a threshold function of a neural network to map variables between 0 and 1. The calculation formula of the forget gate is as follows:

[0166]

[0167] Input gate: remember some current information (the current information is passed through Activate and then pass The control gate forgets part, where the tanh function is a function in the hyperbolic function), then the calculation formula for the input gate part is:

[0168]

[0169]

[0170] Merge past and present memories:

[0171]

[0172] The output gate calculation formula is:

[0173]

[0174]

[0175] The above is the working principle of the LSTM model, where: , , They are the weight matrices of the forget gate, input gate, and output gate respectively; , , are the offsets of the forget gate, input gate, and output gate, respectively. All of the above are parameters to be trained; is the hidden layer; for User feature input at the moment; in this embodiment = , is the output, which in this embodiment is the result of the energy consumption forecast of the corresponding enterprise.

[0176] In step S4, the energy consumption of the enterprise is predicted, and the time series profile and model are optimized by comparing the predicted results with the actual energy consumption. The specific steps include:

[0177] The predicted results of the output enterprise energy consumption are verified in step S1 and fed back to step S2 to supplement and improve the enterprise portrait, thereby further improving the accuracy of the energy consumption prediction.

[0178] Embodiment 2:

[0179] This embodiment provides an enterprise energy consumption prediction system based on time series profiling technology, including:

[0180] The data acquisition module is configured to: acquire historical energy consumption data of the enterprise;

[0181] The abnormality identification module is configured to: identify missing values ​​and abnormal values ​​in the historical energy consumption data, and correct the missing values ​​and abnormal values ​​to obtain processed energy consumption data;

[0182] The time series profile building module is configured to: extract the features of the processed energy consumption data based on the analysis of the enterprise's energy consumption pattern and build the enterprise's time series profile;

[0183] The energy consumption prediction module is configured to: obtain energy consumption prediction results based on the constructed time series portrait and using a preset energy consumption situation prediction model;

[0184] Among them, when learning the energy consumption prediction model, a generalized additive nonlinear regression model is used to learn shallow time series features, and a long short-term memory network combined with a whale optimization algorithm is used to learn deep time series features, and the learned shallow time series features and deep time series features are combined to predict energy consumption.

[0185] The working method of the system is the same as the enterprise energy consumption prediction method based on time series profiling technology in Example 1, and will not be repeated here.

[0186] Embodiment 3:

[0187] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the enterprise energy consumption prediction method based on time series profiling technology described in Example 1 are implemented.

[0188] Embodiment 4:

[0189] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for predicting enterprise energy consumption based on time series profiling technology described in Example 1 are implemented.

[0190] The above description is only a preferred embodiment of the present embodiment and is not intended to limit the present embodiment. For those skilled in the art, the present embodiment may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present embodiment shall be included in the protection scope of the present embodiment.

Claims

1. A method for predicting enterprise energy consumption based on time series portrait technology, characterized in that: include: Obtain the company’s historical energy consumption data; Identify missing values ​​and outliers in historical energy consumption data, and correct them to obtain processed energy consumption data; Based on the analysis of the enterprise's energy consumption pattern, the characteristics of the processed energy consumption data are extracted to build a time series portrait of the enterprise; The processed data is used to construct a time series profile for each enterprise. The specific steps include: S2.

1. Preliminary classification of enterprises based on industry classification standards; S2.2, Enterprise energy consumption pattern based on cluster analysis; S2.3, extracting enterprise electricity consumption characteristics; S2.4, build a profile of enterprise energy consumption; The method of step S2.2 is as follows: Local linear embedding is used to reduce the dimension of energy consumption time series data. Its working principle is as follows: For the sample set , set the number of nearest neighbors and the dimension d after dimensionality reduction; Using Euclidean distance as a metric, calculate each sample Recent Nearest Neighbor ; For each sample , find the local covariance matrix , and find the corresponding weight coefficient vector: By weight coefficient vector Composition weight coefficient matrix , calculate the matrix ; Calculating the Matrix Before eigenvalues ​​and calculate this The eigenvalues ​​corresponding to the eigenvectors ; From the second eigenvector to the The matrix composed of the eigenvectors is the low-dimensional sample set matrix after dimensionality reduction. ; The fuzzy C-means clustering based on LLE dimension reduction has the following working principle: Setting parameters: According to the size of the industry's user group, determine the number range of industry electricity consumption patterns and set the minimum number of clusters at the beginning of the algorithm. , maximum number of clusters And the parameters related to the FCM algorithm, let ; Execute clustering algorithm: Assume that there are Enterprises, of which users The energy consumption curve is ,right The energy consumption curve of each user is clustered using the LLE-FCM algorithm; Evaluation of clustering effect: The silhouette coefficient is used to evaluate the compactness and separability of clustering. The silhouette coefficient for: in, express and The average distance of the remaining samples within the class; express AND The minimum average distance of class sample distances; The closer it is to 1, the better the sample compactness and class separability, and the better the clustering effect; the silhouette coefficient of all samples is averaged to evaluate the effectiveness of this clustering, which is expressed as follows: If the current number of clusters Then And repeat the clustering algorithm until ; The optimal number of clusters is the one with the largest mean value of the silhouette coefficient. After normalizing the various cluster centers obtained by this clustering, the typical energy consumption curve of the industry is obtained. The typical curve of the energy consumption mode is recorded as ; The method of step S2.3 is as follows: The nonparametric kernel density estimation method is used to fit the probability density of the long-term development characteristics of the load, and then the typical characteristics are extracted; The method of step S2.4 is as follows: After completing the energy consumption characteristics analysis from the enterprise level to the industry level, the corresponding energy consumption curves and related features were obtained at the enterprise level and industry level respectively. The features include the trend, periodicity and mutation point of energy consumption. Based on the features, the time series portrait of enterprise energy consumption was constructed. According to the constructed time series portrait, the energy consumption prediction results are obtained by using the preset energy consumption prediction model; When learning the energy consumption prediction model, a generalized additive nonlinear regression model is used to learn shallow time series features, and a long short-term memory network combined with a whale optimization algorithm is used to learn deep time series features. The learned shallow time series features and deep time series features are combined to perform energy consumption prediction. Based on Prophet learning of shallow time series features, prediction is completed by fitting the logistic regression growth module of the trend term in the time series, the Fourier series periodic module of the periodic term, the irregular fluctuation module caused by the holiday term, and the error term of the unpredictable factors; the mean absolute percentage error is used as the loss function of the whale algorithm, and the optimization parameters are obtained when the loss value meets the requirements; After verification, the predicted results of the output enterprise's energy consumption are supplemented and improved to further improve the accuracy of the energy consumption forecast.

2. The method for predicting enterprise energy consumption based on time series portrait technology according to claim 1, characterized in that: The horizontal short-term year-on-year anomaly detection method is used to detect whether the data in the time window follows the periodic characteristics, and the year-on-year amplitude longitudinal anomaly detection method is used to detect whether each value in the time series data satisfies the horizontal periodic characteristics of the sequence that changes at every moment within the same day, so as to identify missing values ​​and outliers.

3. The method for predicting enterprise energy consumption based on time series profiling technology according to claim 1, characterized in that: Correct missing values ​​and outliers based on Lagrange interpolation: in, Filling values ​​for missing values ​​and outliers at time t; and The first i and j The sampling time of each data point; is the number of sample points used to construct the polynomial; Energy consumption data.

4. The method for predicting enterprise energy consumption based on time series profiling technology according to claim 1, characterized in that: Final prediction results for: in, Based on the generalized additive nonlinear regression model t Energy consumption forecast at the moment; Based on long short-term memory network t Energy consumption forecast at the moment; and is the weight.

5. The method for predicting enterprise energy consumption based on time series profiling technology according to claim 1, characterized in that: When the loss value reaches the requirement, the optimized parameters are obtained, and the loss function TrainingLoss is defined as: in, h ( i ) is the first predicted values; is the first True value; n is the number of prediction samples.

6. An enterprise energy consumption prediction system based on time series portrait technology, characterized in that: include: The data acquisition module is configured to: acquire historical energy consumption data of the enterprise; The abnormality identification module is configured to: identify missing values ​​and abnormal values ​​in the historical energy consumption data, and correct the missing values ​​and abnormal values ​​to obtain processed energy consumption data; The time series profile building module is configured to: extract the features of the processed energy consumption data based on the analysis of the enterprise's energy consumption pattern and build the enterprise's time series profile; The processed data is used to construct a time series profile for each enterprise. The specific steps include: S2.

1. Preliminary classification of enterprises based on industry classification standards; S2.2, Enterprise energy consumption pattern based on cluster analysis; S2.3, extracting enterprise electricity consumption characteristics; S2.4, build a profile of enterprise energy consumption; The method of step S2.1 is as follows: Using industry standards as a benchmark, companies are preliminarily classified according to their industry type; The method of step S2.2 is as follows: Local linear embedding is used to reduce the dimension of energy consumption time series data. Its working principle is as follows: For the sample set , set the number of nearest neighbors and the dimension d after dimensionality reduction; Using Euclidean distance as a metric, calculate each sample Recent Nearest Neighbor ; For each sample , find the local covariance matrix , and find the corresponding weight coefficient vector: By weight coefficient vector Composition weight coefficient matrix , calculate the matrix ; Calculating the Matrix Before eigenvalues ​​and calculate this The eigenvalues ​​corresponding to the eigenvectors ; From the second eigenvector to the The matrix composed of the eigenvectors is the low-dimensional sample set matrix after dimensionality reduction. ; The fuzzy C-means clustering based on LLE dimension reduction has the following working principle: Setting parameters: According to the size of the industry's user group, determine the number range of industry electricity consumption patterns and set the minimum number of clusters at the beginning of the algorithm. , maximum number of clusters And the parameters related to the FCM algorithm, let ; Execute clustering algorithm: Assume that there are Enterprises, of which users The energy consumption curve is ,right The energy consumption curve of each user is clustered using the LLE-FCM algorithm; Evaluation of clustering effect: The silhouette coefficient is used to evaluate the compactness and separability of clustering. The silhouette coefficient for: in, express and The average distance of the remaining samples within the class; express AND The minimum average distance of class sample distances; The closer it is to 1, the better the sample compactness and class separability, and the better the clustering effect; the silhouette coefficient of all samples is averaged to evaluate the effectiveness of this clustering, which is expressed as follows: If the current number of clusters Then And repeat the clustering algorithm until ; The number of clusters with the largest mean value of the silhouette coefficient is the optimal number of clusters. After normalizing the various cluster centers obtained by this clustering, the typical energy consumption curve of the industry is obtained. The typical curve of the energy consumption mode is recorded as ; The method of step S2.3 is as follows: The nonparametric kernel density estimation method is used to fit the probability density of the long-term development characteristics of the load, and then the typical characteristics are extracted; The method of step S2.4 is as follows: After completing the energy consumption characteristics analysis from the enterprise level to the industry level, the corresponding energy consumption curves and related features were obtained at the enterprise level and industry level respectively. The features include the trend, periodicity and mutation point of energy consumption. Based on the features, the time series portrait of enterprise energy consumption was constructed. The energy consumption prediction module is configured to: obtain energy consumption prediction results based on the constructed time series portrait and using a preset energy consumption situation prediction model; When learning the energy consumption prediction model, a generalized additive nonlinear regression model is used to learn shallow time series features, and a long short-term memory network combined with a whale optimization algorithm is used to learn deep time series features. The learned shallow time series features and deep time series features are combined to perform energy consumption prediction. Based on Prophet learning of shallow time series features, prediction is completed by fitting the logistic regression growth module of the trend term in the time series, the Fourier series periodic module of the periodic term, the irregular fluctuation module caused by the holiday term, and the error term of the unpredictable factors; the mean absolute percentage error is used as the loss function of the whale algorithm, and the optimization parameters are obtained when the loss value meets the requirements; After verification, the predicted results of the output enterprise's energy consumption are supplemented and improved to further improve the accuracy of the energy consumption forecast.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the enterprise energy consumption prediction method based on time series profiling technology as described in any one of claims 1 to 5 are implemented.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the enterprise energy consumption prediction method based on time series profiling technology as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • User electricity consumption prediction method based on Prophet-LSTM model

    CN112990556A

  • Power time series data anomaly detection method and filling method thereof

    CN113077357A

  • Short-term power load prediction method and device based on deep mixed learning model

    CN115936208A

  • Energy consumption prediction method and system based on machine learning

    CN116780536A