CN114648152B - Building energy consumption prediction method and system based on state constraint and time-frequency characteristics - Google Patents

Building energy consumption prediction method and system based on state constraint and time-frequency characteristics Download PDF

Info

Publication number
CN114648152B
CN114648152B CN202210107998.XA CN202210107998A CN114648152B CN 114648152 B CN114648152 B CN 114648152B CN 202210107998 A CN202210107998 A CN 202210107998A CN 114648152 B CN114648152 B CN 114648152B
Authority
CN
China
Prior art keywords
energy consumption
time
state
sequence
feature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210107998.XA
Other languages
Chinese (zh)
Other versions
CN114648152A (en
Inventor
田备
张琦
孔军
蒋敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Yuanboqun Intelligent Technology Co ltd
Original Assignee
Jiangsu Yuanboqun Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Yuanboqun Intelligent Technology Co ltd filed Critical Jiangsu Yuanboqun Intelligent Technology Co ltd
Priority to CN202210107998.XA priority Critical patent/CN114648152B/en
Publication of CN114648152A publication Critical patent/CN114648152A/en
Application granted granted Critical
Publication of CN114648152B publication Critical patent/CN114648152B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2216/00Indexing scheme relating to additional aspects of information retrieval not explicitly covered by G06F16/00 and subgroups
    • G06F2216/03Data mining

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Human Resources & Organizations (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Operations Research (AREA)
  • Economics (AREA)
  • Biophysics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Strategic Management (AREA)
  • Biomedical Technology (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Tourism & Hospitality (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Evolutionary Biology (AREA)
  • Algebra (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Quality & Reliability (AREA)
  • Game Theory and Decision Science (AREA)
  • General Business, Economics & Management (AREA)

Abstract

The invention relates to a building energy consumption prediction method based on state constraint and time-frequency characteristics, which comprises the steps of inputting historical energy consumption sequence data and carrying out normalization processing to obtain a historical energy consumption sequence; inputting the historical energy consumption sequence into a time perception attention module to obtain an output value, generating global time dependence characteristics based on the output value, performing short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram of the historical energy consumption sequence, extracting high-dimensional characteristics of the two-dimensional spectrogram by utilizing a two-dimensional convolution layer, and generating local composition structural characteristics based on the high-dimensional characteristics; inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors, and connecting the variables to generate a characteristic sequence; inputting the feature sequence into a state feature network to generate state features; generating connection features based on the global time-dependent features, the structural features, and the state features; and obtaining a prediction result by using the connection characteristic. The invention can realize high-precision energy consumption prediction.

Description

Building energy consumption prediction method and system based on state constraint and time-frequency characteristics
Technical Field
The invention relates to the technical field of data mining, in particular to a building energy consumption prediction method and system based on state constraint and time-frequency characteristics.
Background
The accurate energy consumption prediction has important significance for building energy management and energy policy formulation, and is also the basis of tasks such as anomaly detection. With the rapid development of artificial intelligence, data-driven based models are becoming the dominant approach in the field of building energy consumption prediction, which benefits from their simple modeling process and strong ability to fit nonlinear data. Traditional machine learning algorithms such as Support Vector Regression (SVR) and Artificial Neural Network (ANN) have performances obviously superior to those of traditional methods based on statistical regression, and are widely applied. In recent years, research in this field has mainly two trends, application of an integrated learning method and exploration of a deep network model. The method is characterized in that a plurality of basic models are combined together to construct an integrated model, the advantages of each model are fully utilized to carry out joint prediction, and the performance of the integrated model is superior to that of a single model; the latter is represented by sequential connection of a convolutional neural network CNN, a long-short-term memory cyclic neural network LSTM or a variant Bi-LSTM thereof, namely, firstly, the local information perceptibility and the feature extraction capability of the CNN are utilized to extract high-dimensional feature representation from original input data, and then the high-dimensional feature representation is sent to the LSTM to construct time sequence feature representation, so that a final prediction result is obtained.
However, most of the existing methods only stay on the stacking of the simple models, and deep mining of useful information in the existing methods is not considered, and particularly a large amount of interference information exists in meteorological factors, which prevents further improvement of prediction accuracy. LSTM based methods explore timing information in energy consumption sequences, however, such models ignore complex time-dependent relationships in energy consumption sequences, including periodicity and interactions at different time points.
Based on the above consideration, a building energy consumption prediction method is provided for solving the defects of insufficient extraction of useful information and easy interference of redundant information existing in the prior art, so as to furthest excavate the useful information in input data, and realize high-precision energy consumption prediction.
Disclosure of Invention
Therefore, the technical problem to be solved by the invention is to overcome the problems existing in the prior art, and provide a building energy consumption prediction method and system based on state constraint and time-frequency characteristics, which extract time dependence and frequency information in a historical energy consumption sequence, map influencing factors such as time, weather and the like into specific state characteristics, and avoid the negative influence of interference information, so that high-precision energy consumption prediction is realized.
In order to solve the technical problems, the invention provides a building energy consumption prediction method based on state constraint and time-frequency characteristics, which comprises the following steps:
s10: inputting historical energy consumption sequence data and carrying out normalization processing to obtain a normalized historical energy consumption sequence;
s20: inputting the historical energy consumption sequence to a time perception attention module to obtain an output value, generating global time dependence characteristics by the output value through a one-dimensional convolution layer and a flat layer, simultaneously carrying out short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram of the historical energy consumption sequence, extracting high-dimensional characteristics of the two-dimensional spectrogram by using the two-dimensional convolution layer, and generating local composition structural characteristics by the high-dimensional characteristics through the flat layer;
s30: inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors, and connecting the variables to generate a characteristic sequence;
s40: inputting the feature sequence into a state feature network to generate a state feature;
s50: generating connection features based on the global time-dependent features, the constituent structural features, and the state features;
s60: and obtaining a prediction result by using the connection characteristic.
In one embodiment of the present invention, in S20, inputting the historical energy consumption sequence to a time-aware attention module to obtain an output value includes:
calculating a global relationship matrix R, R (i, j) =α·sin (θ) ij ) -beta.h (i, j), wherein θ i =arccos (x i ) For the energy consumption value x at the moment i i H (i, j) represents the ith instant t i And the jth time t j The shortest time difference between the two,alpha and beta are two trainable parameters, and the value of each position (i, j) in R represents the dependency relationship between two time points;
converting the global relation matrix R into three-dimensional features R f ∈R C×H×W Where C represents the number of channels, H and W represent the height and width of the feature, respectively, and the relationship between a certain point in time and other values is stored in the channel dimension, i.e. R f (j, H, i) =r (i, j), wherein c=w=li, h=1, and simultaneously performing feature extraction on the input historical energy consumption sequence to obtain feature values, and connecting the feature values with the three-dimensional feature R in the channel dimension f Generating an attention map of a historical energy consumption sequence through a convolution layer and an activation function, weighting the historical energy consumption sequence by using the attention map, and adding residual connection to obtain an output value V containing a global time dependency relationship and retaining original information of the sequence t =A·x e +x e Wherein a=tanh (g (x e1 ,R f ) G represents a 1 x 1 convolution operation.
In one embodiment of the present invention, in S30, processing and concatenating the variables in the meteorological factor and the time factor to generate a feature sequence includes:
normalizing continuous variable in the meteorological factors and the time factors, and performing label smoothing one-hot coding on the discrete variable;
and connecting the continuous variable after normalization processing with the discrete variable after encoding processing to generate a characteristic sequence.
In one embodiment of the present invention, in S40, the state feature network is constructed using an ANN, where the ANN is composed of a plurality of linear layers, and a ReLU activation function is connected to a back end of each linear layer.
In one embodiment of the present invention, in S40, inputting the feature sequence into a state feature network generates a state feature, including:
the state characteristic network converts the meteorological factors and the time factors into energy consumption states so as to filter interference information contained in the meteorological factors and the time factors.
In one embodiment of the present invention, the generation policy of the state label of the state feature network is: in consideration of the lack of real labels capable of representing three different states in the training process as supervision information, historical energy consumption data x= { x is analyzed 1 ,x 2 ,…,x t ,…x m And generating energy consumption states at all times t, thereby adding energy consumption state labels to the original data set, wherein m represents the total number of samples of the data set.
In one embodiment of the present invention, in S40, the generating policy of the state label of the state feature network specifically includes:
mean of the differential absolute values |diff| of the energy consumption data at time t and preceding time period t And standard deviation std t Calculate the status threshold th t =mean t +0.01×std t When the energy consumption value of a period is always at an extremely low level, adding a min (diff) item ensures that the energy consumption state of the period is always kept; then compare diff t =(x t -x t-1 ) And th t The magnitude relation between if diff t >th t The state at time t is "up" (1, 0), if diff t <-th t Marked at time tThe state is "decrease" (0, 1, 0), otherwise the state is "hold" (0, 1) at time t, and in the training phase, one-hot encoding is performed on the three states to convert to (1, 0), (0, 1, 0) and (0, 1), respectively, using cross entropy loss as a loss function of training.
In addition, the invention also provides a building energy consumption prediction system based on state constraint and time-frequency characteristics, which comprises:
the data input module is used for inputting historical energy consumption sequence data and carrying out normalization processing to obtain a normalized historical energy consumption sequence, and is also used for inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors and connecting the variables to generate a characteristic sequence;
the global time-dependent feature extraction module is used for inputting the historical energy consumption sequence into the time perception attention module to obtain an output value, and generating a global time-dependent feature by the output value through a one-dimensional convolution layer and a Flatten layer;
the local composition structural feature extraction module is used for carrying out short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram of the historical energy consumption sequence, extracting high-dimensional features of the two-dimensional spectrogram by utilizing a two-dimensional convolution layer, and generating the local composition structural features by the high-dimensional features through a Flatten layer;
the state feature generation module is used for inputting the feature sequence into a state feature network to generate state features;
the feature connection module is used for generating connection features based on the global time-dependent features, the local composition structural features and the state features;
and the prediction module is used for obtaining a prediction result by utilizing the connection characteristic.
In one embodiment of the present invention, the data input module includes:
the normalization processing sub-module is used for carrying out normalization processing on the continuous variable in the meteorological factors and the time factors;
the coding submodule carries out label smoothing one-hot coding on the discrete variable;
and the sequence generation sub-module is used for connecting the continuous variable after normalization processing and the discrete variable after encoding processing to generate a characteristic sequence.
In one embodiment of the present invention, the global time-dependent feature extraction module includes:
a global relationship matrix calculation sub-module for calculating a global relationship matrix R, R (i, j) =α·sin (θ) ij ) -beta.h (i, j), wherein θ i =arccos(x i ) For the energy consumption value x at the moment i i H (i, j) represents the ith instant t i And the jth time t j The shortest time difference between the two,alpha and beta are two trainable parameters, and the value of each position (i, j) in R represents the dependency relationship between two time points;
a global relationship matrix conversion sub-module for converting the global relationship matrix into three-dimensional features R f ∈R C×H×W Where C represents the number of channels, H and W represent the height and width of the feature, respectively, and the relationship between a certain point in time and other values is stored in the channel dimension, i.e. R f (j, H, i) =r (i, j), wherein c=w=li, h=1;
the characteristic extraction submodule is used for carrying out characteristic extraction on the input historical energy consumption sequence to obtain a characteristic value;
a feature attention generation sub-module for connecting feature values with the three-dimensional features R in the channel dimension f Generating an attention map of the historical energy consumption sequence through a convolution layer and an activation function;
a weighting sub-module for weighting the historical energy consumption sequence by using the attention force diagram and adding residual connection to obtain an output value V containing global time dependency relationship and retaining original information of the sequence t =A·x e +x e Wherein a=tanh (g (x e1 ,R f ) G represents a 1 x 1 convolution operation.
Compared with the prior art, the technical scheme of the invention has the following advantages:
the invention provides a building energy consumption prediction method and a system based on state constraint and time-frequency characteristics, which fully excavate useful information in input data, extract time dependence and frequency information in historical energy consumption sequences, map time and weather factors into state characteristics representing energy consumption change conditions, greatly reduce influence of useless information, and integrate global time dependence characteristics, local composition structural characteristics and state characteristics for prediction, thereby realizing high-precision energy consumption prediction.
Drawings
In order that the invention may be more readily understood, a more particular description of the invention will be rendered by reference to specific embodiments thereof that are illustrated in the appended drawings.
FIG. 1 is a flow diagram of a method for predicting building energy consumption based on state constraints and time-frequency characteristics of the present invention.
Fig. 2 is a diagram of an algorithm model of the present invention.
Fig. 3 is a schematic diagram of the structure of the time-aware attention module of the present invention.
FIG. 4 is a preferred schematic of the features encompassed by the time factors and weather factors of the present invention.
Fig. 5 is a visual representation of the test results of the proposed method on a certain sample.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and specific examples, which are not intended to be limiting, so that those skilled in the art will better understand the invention and practice it.
Example 1
Referring to fig. 1, the present embodiment provides a building energy consumption prediction method based on state constraint and time-frequency characteristics, which includes the following steps:
s10: inputting historical energy consumption sequence data and carrying out normalization processing to obtain a normalized historical energy consumption sequence x e ∈R li Where li denotes the input sequence length;
s20: sequencing the historical energy consumption x e Input to a time perception attention module to obtain an output value, and generate a global time dependent feature F by the output value through a one-dimensional convolution layer and a Flatten layer t Simultaneously, carrying out short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram, extracting high-dimensional features of the two-dimensional spectrogram by utilizing a two-dimensional convolution layer, and generating local composition structural features F by the high-dimensional features through a Flatten layer p
S30: inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors, and connecting the variables to generate a characteristic sequence x f ∈R n×lo Where lo represents the feature sequence length and n represents the feature quantity at each time instant;
s40: the characteristic sequence x f Input to a State feature network to generate State features F s ∈R lo
S50: based on the global time dependent feature F t Structural features F of local composition p Status feature F s Generating connection features (F) t ,F p ,F s );
S60: by means of the connection feature (F t ,F p ,F s ) And obtaining a prediction result.
Referring to fig. 2, the model of the present invention includes three main branches, which extract global time-dependent features, local component structural features, and state features, respectively. Wherein the extraction of the global time-dependent features is mainly done by the time-aware attention module. In addition, compared with the existing building energy consumption prediction method, the method introduces the extraction of local composition structural features and state features for the first time, particularly in state branches, time and meteorological factors are mapped into the state features representing the energy consumption change condition at a certain moment, and the state features are used as important constraint information of a prediction result.
In the building energy consumption prediction method based on the state constraint and the time-frequency characteristic disclosed by the invention, the S10 and the S30 can be performed simultaneously, and the S20 and the S40 can be performed simultaneously.
In the building energy consumption prediction method based on state constraint and time-frequency characteristics disclosed by the invention, for S20 of the above embodiment, the historical energy consumption sequence is input into a time perception attention module to obtain an output value, and the method comprises the steps of calculating a global relation matrix and converting the global relation matrix into a three-dimensional characteristic R f ∈R C×H×W Wherein C represents the number of channels, H and W represent the height and width of the features respectively, and simultaneously, the input historical energy consumption sequence is subjected to feature extraction to obtain feature values, and the feature values are connected with R in the channel dimension f Generating an attention map of the historical energy consumption sequence through a convolution layer and an activation function, weighting the historical energy consumption sequence by using the attention map, and adding residual connection to obtain an output value containing a global time dependency relationship and retaining original information of the sequence.
The time perception attention module provided in the above step S20 focuses on the mutual influence of energy consumption between different time points while extracting time sequence information, so as to mine complex time dependency relationship in the historical energy consumption sequence, and enhance the time characteristics.
The S20 generates a spectrogram of the original sequence by short-time fourier transform. On the one hand, it is possible to extract information difficult to obtain in the frequency domain, such as the frequency composition and the periodic characteristics of the sequence, from the frequency domain. On the other hand, the method converts one-dimensional data into two-dimensional space, and the prediction performance of the model can be effectively improved by utilizing the strong characteristic extraction capability of the convolutional neural network to extract the structural characteristics of the sequence.
In the building energy consumption prediction method based on state constraint and time-frequency characteristics, for the S30 of the embodiment, variables in the meteorological factors and the time factors are processed and connected to generate a characteristic sequence, wherein the method comprises the steps of normalizing continuous variables in the meteorological factors and the time factors, and performing label smoothing one-hot coding on the discrete variables; and connecting the continuous variable after normalization processing with the discrete variable after encoding processing to generate a characteristic sequence.
In the building energy consumption prediction method based on the state constraint and the time-frequency characteristic disclosed by the invention, for the S30 of the embodiment, the characteristic sequence is input into a state characteristic network to generate the state characteristic, the state characteristic network is included to convert the meteorological factors and the time factors into the energy consumption state, and interference information contained in the meteorological factors and the time factors is filtered. The state characteristic network is constructed by adopting an ANN, the ANN consists of a plurality of linear layers, and the rear end of each linear layer is connected with a ReLU activation function.
In the building energy consumption prediction method based on the state constraint and the time-frequency characteristic disclosed by the invention, for the step S40 of the embodiment, the connection characteristic is generated based on the global time-dependent characteristic, the local composition structural characteristic and the state characteristic, and the connection characteristic is generated by connecting the global time-dependent characteristic, the local composition structural characteristic and the state characteristic.
The invention provides a building energy consumption prediction method based on state constraint and time-frequency characteristics, which fully excavates useful information in input data, extracts time dependence and frequency information in a historical energy consumption sequence, maps time and weather factors into state characteristics representing energy consumption change conditions, greatly reduces influence of useless information, and fuses global time dependence characteristics, local composition structural characteristics and state characteristics to predict, thereby realizing high-precision energy consumption prediction.
For a better explanation of the invention, an application example based on the invention is described below, in which the input historical energy consumption sequence length li is 168 and the energy consumption sequence length to be predicted is 24 in hours.
The specific method of normalization in the above example S10 is: input x for time t t The normalization mode isWhere max and min represent preset maximum and minimum values, respectively, max=159.05 in this example, min=11.17. Of course, other normalization methods may be used.
The time-aware attention module in the above example S20 is specifically implemented as follows: as shown in fig. 3, for an input historical energy consumption sequence x e First, a global relation matrix R, R (i, j) =α·sin (θ) is calculated ij ) - β·h (i, j), wherein θi=arccoss (x i ) For the energy consumption value x at the moment i i H (i, j) represents the ith instant t i And the jth time t j The shortest time difference between the two,alpha and beta are two trainable parameters, and the value of each position (i, j) in R represents the dependency between two time points. Then R is converted into R f ∈R C×H×W Storing a relationship between a point in time and other values in the channel dimension, i.e. R f (j, H, i) =r (i, j), where c=w=li, h=1. At the same time, the historical energy consumption sequence x of the input is convolved by using 1 multiplied by 1 e Extracting features to obtain a feature value x e1 . Connecting x in the channel dimension e1 And R is R f The attention map a of the input sequence is then generated through a 1 x 1 convolution layer and a tanh activation function. Finally, the obtained attention force diagram A is used for weighting attention to the original sequence, and residual connection is added to ensure that the output V t Contains global time dependency relationship and retains original information in sequence, namely V t =A·x e +x e Wherein a=tanh (g (x e1 ,R f ) G represents a 1 x 1 convolution operation.
The specific method of the short-time fourier transform in the above example S20 is: the short-time Fourier transform is to slide on the time domain signal by using the moving window, calculate the Fourier transform of each window respectively, form the frequency domain signal corresponding to different time windows, splice together and become the two-dimensional spectrogram of the frequency change along with time. The window adopted by the invention is a Hamming window, the window length is 32, and the overlapping area is 50% of the window length.
The convolution kernel size of the two-dimensional convolution layer in the above example S20 is k×k, two layers in this example, and each layer is followed by a ReLU activation function, k=3.
The time factors and weather factors included in the above example S30 are shown in fig. 4, and may be reasonably changed in implementation.
The normalization process of the continuity variable in the above-described example S30 is the same as that in S10. In this example, the maximum value max of the outdoor temperature T =38.00 ℃, minimum min T = -7.00 ℃ and maximum value max of precipitation probability P =0.00, min P =0.85。
The specific method for the label-smoothed one-hot coding in the above example S30 is: in order to convert the class variables into a form that is easy to use for the algorithm model, the discrete variables are binarized using one-hot encoding, for example, the working day and the non-working day are defined as (0, 1) and (1, 0), respectively, and monday is defined as (1,0,0,0,0,0,0). In addition, considering that such coding scheme brings about a large number of 0 values, which is not beneficial to training of the model, we perform smoothing processing on the coding result, and replace the 0 value with a smaller value (e.g., 0.1) approaching 0.
The state feature network referred to in the above example S40 is constructed using an ANN, which in this example consists of 4 linear layers, with an input feature number of 80 and an output feature number of 3, each linear layer being followed by a ReLU activation function.
The main function of the state-feature network referred to in the above example S40 is to convert time, weather factors into energy consumption states ("increase", "decrease" or "hold") so as to constrain the trend of the predicted outcome and filter out a lot of interference information contained in these factors.
The generation policy of the state label of the state feature network referred to in the above example S40 is: considering that the training process lacks real labels capable of representing three different states as supervision information, the invention provides a stateTag generation strategy by analyzing historical energy consumption data x= { x 1 ,x 2 ,…,x t ,…x m And generating energy consumption states at all times t, thereby adding energy consumption state labels to the original data set, wherein m represents the total number of samples of the data set, and m=5136 in the example from 0 in 1 st 6 th 2020 to 23 in 31 nd 12 th 2020. The specific method comprises the following steps: first, the mean value mean of the absolute value |diff| of the energy consumption data difference of the previous week, namely 169 hours, at the moment t is passed t And standard deviation std t Calculate the status threshold th t =mean t +0.01×std t The function of adding a min (diff) term is to ensure that the energy consumption state of a period is always kept when the energy consumption value of the period is always at an extremely low level, so that erroneous state estimation is avoided; then compare diff t =(x t -x t-1 ) And th t The magnitude relation between if diff t >th t The state at time t is "up" (1, 0), if diff t <-th t The state at time t is "decrease" (0, 1, 0), otherwise the state at time t is "hold" (0, 1). In the training phase, one-hot encoding is performed on the three states to convert into (1, 0), (0, 1, 0) and (0, 1), respectively, using cross entropy loss as a loss function of training.
In order to verify the accuracy and the robustness of the method, fig. 5 shows a visual diagram of a test result on a certain sample, and the prediction accuracy of the method for predicting the building energy consumption based on the state constraint and the time-frequency characteristic provided by the invention is high and the prediction error is small.
Example two
The following describes a building energy consumption prediction system based on state constraint and time-frequency characteristics according to the second embodiment of the present invention, and the building energy consumption prediction system based on state constraint and time-frequency characteristics described below and the building energy consumption prediction method based on state constraint and time-frequency characteristics described above may be referred to correspondingly.
The second embodiment of the invention discloses a building energy consumption prediction system based on state constraint and time-frequency characteristics, which comprises:
the data input module is used for inputting historical energy consumption sequence data and carrying out normalization processing to obtain a normalized historical energy consumption sequence, and is also used for inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors and connecting the variables to generate a characteristic sequence;
the global time-dependent feature extraction module is used for inputting the historical energy consumption sequence into the time perception attention module to obtain an output value, and generating a global time-dependent feature by the output value through a one-dimensional convolution layer and a Flatten layer;
the local composition structural feature extraction module is used for carrying out short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram of the historical energy consumption sequence, extracting high-dimensional features of the two-dimensional spectrogram by utilizing a two-dimensional convolution layer, and generating the local composition structural features by the high-dimensional features through a Flatten layer;
the state feature generation module is used for inputting the feature sequence into a state feature network to generate state features;
the feature connection module is used for generating connection features based on the global time-dependent features, the local composition structural features and the state features;
and the prediction module is used for obtaining a prediction result by utilizing the connection characteristic.
In the building energy consumption prediction system based on state constraint and time-frequency characteristics disclosed by the invention, the data input module comprises:
the normalization processing sub-module is used for carrying out normalization processing on the continuous variable in the meteorological factors and the time factors;
the coding submodule carries out label smoothing one-hot coding on the discrete variable;
and the sequence generation sub-module is used for connecting the continuous variable after normalization processing and the discrete variable after encoding processing to generate a characteristic sequence.
In the building energy consumption prediction system based on state constraint and time-frequency characteristics disclosed by the invention, the global time-dependent characteristic extraction module comprises:
the global relation matrix calculation and conversion sub-module is used for calculating a global relation matrix and converting the global relation matrix into three-dimensional features;
the characteristic extraction submodule is used for carrying out characteristic extraction on the input historical energy consumption sequence to obtain a characteristic value;
the characteristic attention generation sub-module is used for connecting the characteristic value with the three-dimensional characteristic in the channel dimension and generating an attention map of the historical energy consumption sequence through a convolution layer and an activation function;
and the weighting sub-module is used for weighting the historical energy consumption sequence by using the attention force diagram and adding residual connection to obtain an output value containing the global time dependency relationship and retaining the original information of the sequence.
The building energy consumption prediction system based on the state constraint and the time-frequency characteristic of the embodiment is used for realizing the building energy consumption prediction method based on the state constraint and the time-frequency characteristic, so that the specific implementation of the system can be seen from the part of the embodiment of the building energy consumption prediction method based on the state constraint and the time-frequency characteristic in the foregoing, and therefore, the specific implementation of the system can be referred to the description of the corresponding embodiment of each part and will not be further described herein.
In addition, since the building energy consumption prediction system based on the state constraint and the time-frequency characteristic of the present embodiment is used to implement the foregoing building energy consumption prediction method based on the state constraint and the time-frequency characteristic, the function thereof corresponds to the function of the foregoing method, and the details thereof are not repeated herein.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations and modifications of the present invention will be apparent to those of ordinary skill in the art in light of the foregoing description. It is not necessary here nor is it exhaustive of all embodiments. And obvious variations or modifications thereof are contemplated as falling within the scope of the present invention.

Claims (5)

1. The building energy consumption prediction method based on state constraint and time-frequency characteristics is characterized by comprising the following steps of:
s10: inputting historical energy consumption sequence data and carrying out normalization processing to obtain a normalized historical energy consumption sequence;
s20: inputting the historical energy consumption sequence to a time perception attention module to obtain an output value, generating global time dependence characteristics by the output value through a one-dimensional convolution layer and a flat layer, simultaneously carrying out short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram of the historical energy consumption sequence, extracting high-dimensional characteristics of the two-dimensional spectrogram by using the two-dimensional convolution layer, and generating local composition structural characteristics by the high-dimensional characteristics through the flat layer;
s30: inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors, and connecting the variables to generate a characteristic sequence;
s40: inputting the feature sequence into a state feature network to generate a state feature;
s50: generating connection features based on the global time-dependent features, the constituent structural features, and the state features;
s60: obtaining a prediction result by utilizing the connection characteristic;
wherein in S40, inputting the feature sequence into a state feature network generates a state feature, including:
the state characteristic network converts weather factors and time factors into energy consumption states so as to filter interference information contained in the weather factors and the time factors;
the generating strategy of the state label of the state characteristic network is as follows: consider the lack of ability to represent three different shapes during its training processThe real tag of the state is used as supervision information, and historical energy consumption data x= { x is analyzed 1 ,x 2 ,…,x t ,…x m Generating energy consumption states at all times t, thereby adding energy consumption state labels to the original data set, wherein m represents the total number of samples of the data set;
in S40, the generating policy of the state label of the state feature network specifically includes:
mean of the differential absolute values |diff| of the energy consumption data at time t and preceding time period t And standard deviation std t Calculate the status threshold th t =mean t +0.01×std t When the energy consumption value of a period is always at an extremely low level, adding a min (diff) item ensures that the energy consumption state of the period is always kept; then compare diff t =(x t -x t-1 ) And th t The magnitude relation between if diff t >th t The state at time t is "up" (1, 0), if diff t <-th t Marking the t moment state as 'reduced' (0, 1, 0), otherwise marking the t moment state as 'kept' (0, 1), and performing one-hot coding on the three states to respectively convert the three states into (1, 0), (0, 1, 0) and (0, 1) in a training stage, and using cross entropy loss as a loss function of training;
in S20, the historical energy consumption sequence is input to a time-aware attention module, and an output value is obtained, including:
calculating a global relationship matrix R, R (i, j) =α·sin (θ) ij ) -beta.h (i, j), wherein θ i =arccos(x i ) For the energy consumption value x at the moment i i H (i, j) represents the ith instant t i And the jth time t j The shortest time difference between the two,alpha and beta are two trainable parameters, and the value of each position (i, j) in R represents the dependency relationship between two time points;
converting the global relation matrix RIs three-dimensional characteristic R f ∈R C×H×W Where C represents the number of channels, H and W represent the height and width of the feature, respectively, and the relationship between a certain point in time and other values is stored in the channel dimension, i.e. R f (j, H, i) =r (i, j), wherein c=w=li, h=1, and simultaneously performing feature extraction on the input historical energy consumption sequence to obtain feature values, and connecting the feature values with the three-dimensional feature R in the channel dimension f Generating an attention map of a historical energy consumption sequence through a convolution layer and an activation function, weighting the historical energy consumption sequence by using the attention map, and adding residual connection to obtain an output value V containing a global time dependency relationship and retaining original information of the sequence t =A·x e +x e Wherein a=tanh (g (x e1 ,R f ) G represents a 1 x 1 convolution operation.
2. The method for predicting building energy consumption based on state constraints and time-frequency characteristics according to claim 1, wherein in S30, processing and connecting variables in the meteorological factors and time factors to generate a characteristic sequence comprises:
normalizing continuous variable in the meteorological factors and the time factors, and performing label smoothing one-hot coding on the discrete variable;
and connecting the continuous variable after normalization processing with the discrete variable after encoding processing to generate a characteristic sequence.
3. The method for predicting building energy consumption based on state constraint and time-frequency characteristics according to claim 1, wherein in S40, the state characteristic network is constructed by adopting an ANN, the ANN is composed of a plurality of linear layers, and a ReLU activation function is connected to the rear end of each linear layer.
4. A building energy consumption prediction system based on state constraints and time-frequency characteristics, comprising:
the data input module is used for inputting historical energy consumption sequence data and carrying out normalization processing to obtain a normalized historical energy consumption sequence, and is also used for inputting weather factors and time factors corresponding to the moment to be predicted, processing variables in the weather factors and the time factors and connecting the variables to generate a characteristic sequence;
the global time-dependent feature extraction module is used for inputting the historical energy consumption sequence into the time perception attention module to obtain an output value, and generating a global time-dependent feature by the output value through a one-dimensional convolution layer and a Flatten layer;
the local composition structural feature extraction module is used for carrying out short-time Fourier transform on the historical energy consumption sequence to obtain a two-dimensional spectrogram of the historical energy consumption sequence, extracting high-dimensional features of the two-dimensional spectrogram by utilizing a two-dimensional convolution layer, and generating the local composition structural features by the high-dimensional features through a Flatten layer;
the state feature generation module is used for inputting the feature sequence into a state feature network to generate state features;
the feature connection module is used for generating connection features based on the global time-dependent features, the local composition structural features and the state features;
the prediction module is used for obtaining a prediction result by utilizing the connection characteristics;
the state feature generating module inputs the feature sequence to a state feature network to generate a state feature, and the state feature generating module comprises:
the state characteristic network converts weather factors and time factors into energy consumption states so as to filter interference information contained in the weather factors and the time factors;
the generating strategy of the state label of the state characteristic network is as follows: in consideration of the lack of real labels capable of representing three different states in the training process as supervision information, historical energy consumption data x= { x is analyzed 1 ,x 2 ,…,x t ,…x m Generating energy consumption states at all times t, thereby increasing energy consumption for the original data setA status tag, m, representing the total number of samples of the dataset;
the generation strategy of the state label of the state characteristic network specifically comprises the following steps:
mean of the differential absolute values |diff| of the energy consumption data at time t and preceding time period t And standard deviation std t Calculate the status threshold th t =mean t +0.01×std t When the energy consumption value of a period is always at an extremely low level, adding a min (diff) item ensures that the energy consumption state of the period is always kept; then compare diff t =(x t -x t-1 ) And th t The magnitude relation between if diff t >th t The state at time t is "up" (1, 0), if diff t <-th t Marking the t moment state as 'reduced' (0, 1, 0), otherwise marking the t moment state as 'kept' (0, 1), and performing one-hot coding on the three states to respectively convert the three states into (1, 0), (0, 1, 0) and (0, 1) in a training stage, and using cross entropy loss as a loss function of training;
the global time-dependent feature extraction module includes:
a global relationship matrix calculation sub-module for calculating a global relationship matrix R, R (i, j) =α·sin (θ) ij ) -beta.h (i, j), wherein θ i =arccos(x i ) For the energy consumption value x at the moment i i H (i, j) represents the ith instant t i And the jth time t j The shortest time difference between the two,alpha and beta are two trainable parameters, and the value of each position (i, j) in R represents the dependency relationship between two time points;
a global relationship matrix conversion sub-module for converting the global relationship matrix into three-dimensional features R f ∈R C×H×W Wherein C represents the number of channels, H and W represent the height and width of the feature, respectively, in the channel dimensionStoring the relationship between a certain point in time and other values, i.e. R f (j, H, i) =r (i, j), wherein c=w=li, h=1;
the characteristic extraction submodule is used for carrying out characteristic extraction on the input historical energy consumption sequence to obtain a characteristic value;
a feature attention generation sub-module for connecting feature values with the three-dimensional features R in the channel dimension f Generating an attention map of the historical energy consumption sequence through a convolution layer and an activation function;
a weighting sub-module for weighting the historical energy consumption sequence by using the attention force diagram and adding residual connection to obtain an output value V containing global time dependency relationship and retaining original information of the sequence t =A·x e +x e Wherein a=tanh (g (x e1 ,R f ) G represents a 1 x 1 convolution operation.
5. The building energy consumption prediction system based on state constraints and time-frequency characteristics of claim 4, wherein the data input module comprises:
the normalization processing sub-module is used for carrying out normalization processing on the continuous variable in the meteorological factors and the time factors;
the coding submodule carries out label smoothing one-hot coding on the discrete variable;
and the sequence generation sub-module is used for connecting the continuous variable after normalization processing and the discrete variable after encoding processing to generate a characteristic sequence.
CN202210107998.XA 2022-01-28 2022-01-28 Building energy consumption prediction method and system based on state constraint and time-frequency characteristics Active CN114648152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210107998.XA CN114648152B (en) 2022-01-28 2022-01-28 Building energy consumption prediction method and system based on state constraint and time-frequency characteristics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210107998.XA CN114648152B (en) 2022-01-28 2022-01-28 Building energy consumption prediction method and system based on state constraint and time-frequency characteristics

Publications (2)

Publication Number Publication Date
CN114648152A CN114648152A (en) 2022-06-21
CN114648152B true CN114648152B (en) 2024-02-02

Family

ID=81993366

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210107998.XA Active CN114648152B (en) 2022-01-28 2022-01-28 Building energy consumption prediction method and system based on state constraint and time-frequency characteristics

Country Status (1)

Country Link
CN (1) CN114648152B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309955A (en) * 2019-06-13 2019-10-08 南瑞集团有限公司 A kind of non-load predicting method and device shut down when upgrading of cloud environment application system
CN112733927A (en) * 2021-01-05 2021-04-30 福州数据技术研究院有限公司 Fan blade sound boundary positioning method based on one-dimensional convolutional neural network and storage device
CN113205203A (en) * 2021-03-29 2021-08-03 北京金茂绿建科技有限公司 CNN-LSTM-based building energy consumption prediction method and system
CN113505877A (en) * 2021-07-08 2021-10-15 中国海洋大学 Regression prediction method based on multi-task learning and application

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309955A (en) * 2019-06-13 2019-10-08 南瑞集团有限公司 A kind of non-load predicting method and device shut down when upgrading of cloud environment application system
CN112733927A (en) * 2021-01-05 2021-04-30 福州数据技术研究院有限公司 Fan blade sound boundary positioning method based on one-dimensional convolutional neural network and storage device
CN113205203A (en) * 2021-03-29 2021-08-03 北京金茂绿建科技有限公司 CNN-LSTM-based building energy consumption prediction method and system
CN113505877A (en) * 2021-07-08 2021-10-15 中国海洋大学 Regression prediction method based on multi-task learning and application

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
An energy‑efficient prediction model for data aggregation in sensor network;Khushboo Jain;Journal of Ambient Intelligence and Humanized Computing;第5205–5216页 *
Predicting the energy consumption in software defined wireless sensor networks: a probabilistic Markov model approach;Atefeh Rahimifar etal;Journal of Ambient Intelligence and Humanized Computing;第9053–9066页 *
Predicting unusual energy consumption events from smart home sensor network by data stream mining with misclassified recall;Simon Fong etal;Journal of Ambient Intelligence and Humanized Computing;第1197–1221页 *
农村地区民居建筑整体温度调节能耗预测;赵倩;林建泉;黄忠;;计算机仿真(03);全文 *
基于PCA-BP神经网络的大型公共建筑能耗预测;李明海;刘敏;赵明强;;现代建筑电气(04);全文 *

Also Published As

Publication number Publication date
CN114648152A (en) 2022-06-21

Similar Documents

Publication Publication Date Title
Zhao et al. Forecasting wavelet transformed time series with attentive neural networks
CN110210513A (en) Data classification method, device and terminal device
US20220365946A1 (en) Methods And Systems For Wavelet Based Representation
CN112308080A (en) Image description prediction method for directional visual understanding and segmentation
US9659122B2 (en) Aerodynamic design optimization using information extracted from analysis of unstructured surface meshes
CN105654110A (en) Supervised learning optimization method under tensor mode and system thereof
CN112508099A (en) Method and device for detecting target in real time
CN115131700A (en) Training method of two-way hierarchical mixed model for weakly supervised audio and video content analysis
CN117094451B (en) Power consumption prediction method, device and terminal
CN114595635A (en) Feature selection method, system and equipment for main steam temperature data of thermal power generating unit
Shekar et al. A combined deep CNN-RNN network for rainfall-runoff modelling in Bardha Watershed, India
Madhavi et al. Multivariate deep causal network for time series forecasting in interdependent networks
CN109190800A (en) A kind of sea surface temperature prediction technique based on spark frame
CN114648152B (en) Building energy consumption prediction method and system based on state constraint and time-frequency characteristics
CN110532868B (en) Method for predicting free space semantic boundary
CN116342961B (en) Time sequence classification deep learning system based on mixed quantum neural network
Seddik et al. Multi-variable time series decoding with long short-term memory and mixture attention
CN116341720A (en) Multi-fan wind speed and direction prediction method based on dynamic graph convolution and transformation
Trirat et al. Universal time-series representation learning: A survey
CN116050579A (en) Building energy consumption prediction method and system based on depth feature fusion network
CN114610871B (en) Information system modeling analysis method based on artificial intelligence algorithm
CN114241411B (en) Counting model processing method and device based on target detection and computer equipment
CN115358473A (en) Power load prediction method and prediction system based on deep learning
CN111062477B (en) Data processing method, device and storage medium
Signoretto et al. High level high performance computing for multitask learning of time-varying models

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant