Model training method and device, power consumption prediction method and device, and equipment

CN122798568APending Publication Date: 2026-09-22SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610956463.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

[0004]然而,这种训练方法不仅增加了模型的计算负担,也可能因冗余数据或噪声数据的引入而干扰模型学习真实的用电量影响规律,从而导致训练得到的用电量预测模型的预测精度、可靠性较低且泛化性较差

Benefits of technology

[0030]上述模型训练方法、装置、用电量预测方法、装置和设备,获取待预测建筑在历史时段内的初始用电量序列、历史电力价格序列,以及不同气候维度的初始气候值序列;对初始用电量序列进行校正,得到历史用电量序列;根据历史用电量序列,从不同气候维度中确定目标气候维度,并根据与目标气候维度对应的初始气候值序列,得到历史气候数据;以历史气候数据和历史电力价格序列为样本,且以历史用电量序列为标签,对初始模型进行训练,得到待预测建筑的用电量预测模型。这样,对初始用电量序列进行校正能够提高用作标签的历史用电量序列的数据质量,同时,根据历史用电量序列确定目标气候维度,克服了传统技术将所有维度的气候数据用作训练样本带来的数据冗余问题,既减少了后续模型训练和用电量预测的计算负担,又避免冗余的初始气候值序列干扰模型学习,从而强化了关键的历史气候数据与用电量规律之间的关联表征,在此基础上,以历史气候数据与历史电力价格序列为样本、且以历史用电量序列为标签训练初始模型,能够使得模型学习到气候数据与电力价格耦合驱动下的建筑用电弹性规律,进而保证训练得到的用电量预测模型预测精度更高、泛化能力与鲁棒性更强。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122798568A_ABST
    Figure CN122798568A_ABST
Patent Text Reader

Abstract

The application relates to a model training method and device, a power consumption prediction method and device, and equipment. The model training method comprises the following steps: acquiring an initial power consumption sequence of a building to be predicted in a historical period, a historical power price sequence, and initial climate value sequences of different climate dimensions; correcting the initial power consumption sequence to obtain a historical power consumption sequence; determining a target climate dimension from the different climate dimensions according to the historical power consumption sequence, and obtaining historical climate data according to the initial climate value sequence corresponding to the target climate dimension; training an initial model by taking the historical climate data and the historical power price sequence as samples and taking the historical power consumption sequence as a label to obtain a power consumption prediction model of the building to be predicted. The method can improve the prediction accuracy, reliability and generalization of the power consumption prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electricity consumption prediction technology, and in particular to a model training method, apparatus, electricity consumption prediction method, apparatus and equipment. Background Technology

[0002] Building electricity consumption forecasting is a crucial component of power system planning, electricity market trading, and building energy management systems (EMS). Furthermore, the proportion of building energy consumption in total social energy consumption has been continuously increasing in recent years. Therefore, the accuracy of building electricity consumption forecasting directly impacts the economy and security of power dispatch. With the increasing penetration rate of distributed renewable energy, the volatility of power generation is intensifying, making the contradiction between rigid loads and fluctuating power sources more prominent. This also places higher demands on the robustness and accuracy of building electricity consumption forecasting.

[0003] Traditional building electricity consumption prediction models are trained by directly inputting multi-dimensional data (such as climate data, date type, etc.) and electricity consumption sequences that may affect building electricity consumption into the initial model for iterative training, in order to learn the nonlinear mapping relationship between multi-dimensional data and electricity consumption sequences.

[0004] However, this training method not only increases the computational burden on the model, but may also interfere with the model's learning of the actual electricity consumption impact patterns due to the introduction of redundant or noisy data, resulting in low prediction accuracy, reliability and poor generalization of the trained electricity consumption prediction model. Summary of the Invention

[0005] Therefore, it is necessary to provide a model training method, apparatus, electricity consumption prediction method, apparatus, and equipment to address the above-mentioned technical problems, which can improve the prediction accuracy, reliability, and generalization of the electricity consumption prediction model.

[0006] Firstly, this application provides a model training method, including:

[0007] Obtain the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence for different climate dimensions of the building to be predicted during the historical period;

[0008] The initial electricity consumption sequence is corrected to obtain the historical electricity consumption sequence;

[0009] Based on historical electricity consumption sequences, target climate dimensions are determined from different climate dimensions, and historical climate data are obtained based on the initial climate value sequences corresponding to the target climate dimensions.

[0010] Using historical climate data and historical electricity price series as samples, and historical electricity consumption series as labels, the initial model is trained to obtain the electricity consumption prediction model for the building to be predicted.

[0011] In one embodiment, the initial electricity consumption sequence is corrected to obtain a historical electricity consumption sequence, including: for each data point in the initial electricity consumption sequence, determining the distance between the data point and the corresponding associated data point; wherein the order of the data point and the associated data point satisfies a preset positional relationship; and correcting the initial electricity consumption sequence according to the obtained distances to obtain the historical electricity consumption sequence.

[0012] In one embodiment, the initial electricity consumption sequence is corrected based on the obtained distances to obtain a historical electricity consumption sequence, including: for each data point in the initial electricity consumption sequence, determining the reachability density of the data point in its local region based on the distance between the data point and its corresponding associated data point; wherein, the local region is the common area where the data point and associated data point in the initial electricity consumption sequence are located; determining the anomaly of each data point based on the reachability density of each data point in its local region; and correcting the data points in the initial electricity consumption sequence that represent anomalies to obtain the historical electricity consumption sequence.

[0013] In one embodiment, the target climate dimension is determined from different climate dimensions based on the historical electricity consumption sequence, including: establishing an electricity consumption regression model based on the historical electricity consumption sequence and the initial climate value sequence of different climate dimensions; determining the contribution of each climate dimension based on the electricity consumption regression model; wherein the contribution of each climate dimension is used to characterize the degree of contribution of the initial climate value sequence of the climate dimension to the historical electricity consumption sequence; sorting each climate dimension in descending order of contribution to obtain a sorting result; and taking the climate dimension that is located before a preset number of places in the sorting result as the target climate dimension.

[0014] In one embodiment, an initial model is trained using historical climate data and historical electricity price sequences as samples, and historical electricity consumption sequences as labels, to obtain an electricity consumption prediction model for the building to be predicted. This includes: inputting historical climate data and historical electricity price sequences into the initial model to obtain a predicted electricity consumption sequence for the building to be predicted within a historical period; determining the time-domain loss value and frequency loss value between the predicted electricity consumption sequence and the historical electricity consumption sequence, and determining the loss value of the initial model based on the time-domain loss value and frequency loss value; adjusting the model parameters of the initial model if the loss value does not meet the preset convergence condition, and returning to execute the operation of obtaining the predicted electricity consumption sequence until the loss value meets the preset convergence condition, and using the current initial model as the electricity consumption prediction model for the building to be predicted.

[0015] Secondly, this application also provides a method for predicting electricity consumption, including:

[0016] Obtain the future climate value sequence and future electricity price sequence for the building to be predicted in the future time period;

[0017] By inputting future climate value series and future electricity price series into the electricity consumption prediction model, the target electricity consumption series of the building to be predicted in the future period is obtained;

[0018] The electricity consumption prediction model was trained using the model training method described above.

[0019] Thirdly, this application also provides a model training apparatus, comprising:

[0020] The first acquisition module is used to acquire the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence of different climate dimensions of the building to be predicted in the historical period.

[0021] The correction module is used to correct the initial electricity consumption sequence to obtain the historical electricity consumption sequence;

[0022] The determination module is used to determine the target climate dimension from different climate dimensions based on the historical electricity consumption sequence, and to obtain historical climate data based on the initial climate value sequence corresponding to the target climate dimension.

[0023] The training module is used to train the initial model using historical climate data and historical electricity price series as samples and historical electricity consumption series as labels, so as to obtain the electricity consumption prediction model of the building to be predicted.

[0024] Fourthly, this application also provides a power prediction device, comprising:

[0025] The second acquisition module is used to acquire the future climate value sequence and future electricity price sequence of the building to be predicted in the future time period;

[0026] The input module is used to input future climate value sequences and future electricity price sequences into the electricity consumption prediction model to obtain the target electricity consumption sequence of the building to be predicted in the future period; wherein, the electricity consumption prediction model is trained according to the above model training method.

[0027] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the method embodiments of the first and / or second aspects described above.

[0028] In a sixth aspect, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method embodiments of the first and / or second aspects described above.

[0029] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the method embodiments of the first and / or second aspects described above.

[0030] The aforementioned model training method, apparatus, electricity consumption prediction method, apparatus, and equipment acquire the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence for different climate dimensions of the building to be predicted within a historical period; correct the initial electricity consumption sequence to obtain the historical electricity consumption sequence; determine the target climate dimension from different climate dimensions based on the historical electricity consumption sequence, and obtain historical climate data based on the initial climate value sequence corresponding to the target climate dimension; train the initial model using the historical climate data and historical electricity price sequence as samples, and the historical electricity consumption sequence as labels, to obtain the electricity consumption prediction model for the building to be predicted. In this way, correcting the initial electricity consumption sequence can improve the data quality of the historical electricity consumption sequence used as a label. At the same time, determining the target climate dimension based on the historical electricity consumption sequence overcomes the data redundancy problem caused by using climate data of all dimensions as training samples in traditional techniques. This reduces the computational burden of subsequent model training and electricity consumption prediction, and avoids redundant initial climate value sequences interfering with model learning. This strengthens the correlation between key historical climate data and electricity consumption patterns. On this basis, training the initial model with historical climate data and historical electricity price sequences as samples and historical electricity consumption sequences as labels enables the model to learn the elasticity of building electricity consumption driven by the coupling of climate data and electricity prices. This ensures that the trained electricity consumption prediction model has higher prediction accuracy, stronger generalization ability, and stronger robustness. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a diagram illustrating the application environment of a model training method in one embodiment;

[0033] Figure 2 This is a flowchart illustrating a model training method in one embodiment;

[0034] Figure 3 This is a schematic diagram of the process for correcting the initial electricity consumption sequence in one embodiment;

[0035] Figure 4 This is a flowchart illustrating the correction of the initial electricity consumption sequence in another embodiment;

[0036] Figure 5 This is a flowchart illustrating the process of determining the target climate dimension in one embodiment;

[0037] Figure 6 This is a schematic diagram of the process of training an initial model in one embodiment;

[0038] Figure 7 This is a flowchart illustrating the model training method in another embodiment;

[0039] Figure 8 This is a flowchart illustrating a power prediction method in one embodiment;

[0040] Figure 9 This is a structural block diagram of a model training device in one embodiment;

[0041] Figure 10 This is a structural block diagram of a power prediction device in one embodiment;

[0042] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0044] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0045] The model training method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on the cloud or other network servers. Terminal 102 can be, but is not limited to, a smart meter, data collector, edge computing gateway, personal computer, laptop, tablet, or smartphone, or any device with data acquisition and transmission capabilities. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal 102 is used to collect historical electricity consumption sequences, historical electricity price sequences, and initial climate value sequences for different climate dimensions of the building to be predicted, and uploads the collected data to the data storage system via the network. Server 104 is used to obtain the historical electricity consumption sequences, historical electricity price sequences, and initial climate value sequences for different climate dimensions from the data storage system to execute the model training method described in this application embodiment to obtain an electricity consumption prediction model.

[0046] In one exemplary embodiment, such as Figure 2 As shown, a model training method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0047] S201, obtain the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence for different climate dimensions of the building to be predicted during the historical period.

[0048] Among them, the buildings to be predicted are those that require future electricity consumption forecasting, such as residential buildings, office buildings, shopping malls, factories, etc.

[0049] The initial electricity consumption sequence can be a sequence of electricity consumption data from a historical period, ordered chronologically.

[0050] Historical electricity price series can be a sequence of electricity market price data arranged chronologically over a historical period, used to reflect the fluctuation patterns of historical electricity prices.

[0051] The initial climate value sequence for different climate dimensions can be a sequence of climate values ​​for different climate dimensions in historical time periods arranged in chronological order, and each climate dimension corresponds to an independent initial climate value sequence.

[0052] For example, climate dimensions may include temperature, humidity, dew point temperature, sea level pressure, wind direction, wind speed, etc.

[0053] It should be noted that the length of the historical period can be flexibly adjusted according to actual forecasting needs, and this application does not limit it. For example, the historical period can be the past 7 days.

[0054] Optionally, the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence of different climate dimensions of the building to be predicted can be obtained directly from the data storage system. Alternatively, the initial electricity consumption sequence can be obtained from the smart meter, power quality monitoring terminal, or building EMS installed at the main inlet of the building to be predicted, and the historical electricity price sequence can be obtained from the information released by the trading center, and the initial climate value sequence of different climate dimensions can be obtained from the climate dataset collected by the meteorological station.

[0055] S202, correct the initial electricity consumption sequence to obtain the historical electricity consumption sequence.

[0056] Since the initial electricity consumption sequence comes from data collection devices such as smart meters and building EMS, abnormal data points may be generated during the actual operation of the corresponding data collection devices due to sensor failure, communication interference, human error in recording, or sudden abnormal events (such as instantaneous equipment spikes or power outages and restarts). Therefore, it is necessary to correct the initial electricity consumption sequence to replace the abnormal data points and obtain the historical electricity consumption sequence.

[0057] Optionally, for each data point in the initial electricity consumption sequence, the abnormality of the data point can be determined based on the difference between the data point and its neighboring data points. Furthermore, linear interpolation or local mean can be used to replace the abnormal data points that represent the abnormality, i.e., the abnormal data points, to obtain the historical electricity consumption sequence.

[0058] S203. Based on the historical electricity consumption sequence, determine the target climate dimension from different climate dimensions, and obtain historical climate data based on the initial climate value sequence corresponding to the target climate dimension.

[0059] Different climate dimensions have varying degrees of impact on the electricity consumption of different buildings and appliances within them. For example, temperature significantly affects the frequency of air conditioning and heating use in buildings, while precipitation may have a smaller impact on the electricity consumption of high-rise buildings such as office buildings. Therefore, directly inputting all climate dimensions into the model for training without differentiation will not only increase computational costs but may also reduce the model's prediction accuracy due to interference from redundant data. Therefore, it is advisable to first screen the climate dimensions to determine the target climate dimension.

[0060] Optionally, for each climate dimension, the mutual information value between the climate dimension and the electricity consumption can be calculated based on the initial climate value sequence and the historical electricity consumption sequence of the climate dimension. The mutual information value is used to reflect the degree of non-linear correlation between the climate dimension and the electricity consumption. The higher the mutual information value, the higher the correlation between the corresponding climate dimension and the electricity consumption. Based on this, a (a is a positive integer) climate dimensions with higher corresponding mutual information values ​​can be selected as target climate dimensions.

[0061] After determining the target climate dimension, the initial climate value sequence corresponding to the target climate dimension can be used as historical climate data to participate in subsequent model training.

[0062] S204 uses historical climate data and historical electricity price series as samples, and historical electricity consumption series as labels, to train the initial model and obtain the electricity consumption prediction model for the building to be predicted.

[0063] Optionally, historical climate data and historical electricity price sequences can be input into the initial model to obtain the predicted electricity consumption sequence of the building to be predicted during the historical period. Based on the predicted electricity consumption sequence and the historical electricity consumption sequence, the loss value of the initial model is determined. If the loss value does not meet the preset convergence condition, the model parameters of the initial model are adjusted, and the operation of obtaining the predicted electricity consumption sequence is returned until the loss value meets the preset convergence condition. The current initial model is then used as the electricity consumption prediction model for the building to be predicted.

[0064] Optionally, the initial model may include a feature extraction module, a feature fusion module, and a prediction module.

[0065] Specifically, the feature extraction module includes climate channels and electricity price channels.

[0066] A climate channel can include multiple convolutional layers to extract features from the initial climate value sequences for each target dimension. Taking a climate channel with two convolutional layers as an example, the first convolutional layer processes historical climate data... Feature extraction was performed to obtain the first climate feature map. The process can be expressed as the following formula (1).

[0067] (1)

[0068] in, These are the weights of the first convolutional layer. This is the bias of the first convolutional layer.

[0069] Then, referring to the following formula (2), the first climate characteristic map can be obtained. A nonlinear activation is performed to obtain the first activated climate feature map. .

[0070] (2)

[0071] Referring to equation (3) below, the first activated climate feature map can be... Max pooling was performed to obtain the first climate pooling characteristics. .

[0072] (3)

[0073] in, This is a max pooling operation.

[0074] See equation (4) below, the second convolutional layer is used to process the first climate pooling feature. Feature extraction was performed to obtain the second climate feature map. .

[0075] (4)

[0076] in, The weights of the second convolutional layer, This is the bias of the second convolutional layer.

[0077] Accordingly, referring to the following formula (5), the second climate characteristic map can be obtained. A nonlinear activation is performed to obtain the second activated climate feature map. .

[0078] (5)

[0079] Refer to equation (6) below to analyze the second activated climate feature map. Max pooling was performed to obtain the second climate pooling characteristics. .

[0080] (6)

[0081] Finally, the second climate pooling feature is subjected to global average pooling and feature alignment to obtain the climate feature matrix. As an output of climate channels.

[0082] The electricity price channel is used to extract electricity price characteristics that represent the economic fluctuation patterns of electricity prices from historical electricity price series. The electricity price channel consists of a multi-layer fully connected network. Taking a two-layer fully connected network as an example, the first fully connected network processes the historical electricity price series... The first electricity price feature is obtained through processing. The process can be expressed as the following formula (7).

[0083] (7)

[0084] in, For activation function, The weights for the first fully connected network, This is the bias for the first fully connected network.

[0085] To accelerate the convergence speed of model training, the first electricity price feature can be used. By performing layer normalization, the normalized electricity price characteristics are obtained. See equation (8) below.

[0086] (8)

[0087] in, Representation layer normalization.

[0088] Then, referring to the following equation (9), the normalized electricity price characteristics are... The input is fed into a second fully connected network, which maps the feature dimensions to the target dimension to obtain the second electricity price feature. That is, the electricity price characteristic matrix The target dimension can be a climate feature matrix. Dimensions.

[0089] (9)

[0090] in, The weights of the second fully connected network are shifted. This is the bias for the second fully connected network.

[0091] Under different weather conditions, electricity prices have varying degrees of impact on the predicted electricity consumption of buildings. Correspondingly, under different electricity prices, climate values ​​also have varying degrees of impact on the predicted electricity consumption of buildings. Based on this, the feature fusion module can fuse the climate feature matrix and the electricity price feature matrix using a cross-attention mechanism. This allows the model to learn the nonlinear coupling relationship between electricity prices and climate, achieving more accurate electricity consumption predictions than simple feature splicing or fixed weighting.

[0092] Optionally, features can be extracted from historical electricity consumption sequences to obtain the inherent electricity consumption time series patterns, periodic regularities, and basic rigid load characteristics of the building to be predicted, and these can be used as the benchmark information for subsequent feature fusion.

[0093] Similar to the principles of the meteorological and electricity price channels mentioned above, the process of feature extraction from historical electricity consumption sequences can include first inputting the historical electricity consumption sequence into a multilayer perceptron and performing an initial nonlinear transformation to obtain the first hidden layer features. Then, layer normalization is performed on these first hidden layer features to accelerate model convergence. Next, the normalized first hidden layer features are input into a second fully connected layer and subjected to another nonlinear transformation to further extract local temporal fluctuations, short-term changes, and peak-valley features from the historical electricity consumption sequence, resulting in the second hidden layer features. The second hidden layer features are then subjected to layer normalization again to obtain the deep electricity consumption features. These deep electricity consumption features are then expanded into a fixed-dimensional temporal feature sequence through linear projection, making the temporal feature sequence compatible with the input format of the subsequent Transformer encoder. Finally, sine-cosine position encoding is added to the temporal features at each time step in the temporal feature sequence to inject time and position information, enabling the model to perceive the chronological order and time intervals of the historical electricity consumption sequence. The encoded time-series feature sequence is then input into the Transformer encoder. The Transformer encoder's multi-layer, multi-head self-attention mechanism captures long-term time-series features such as long-term dependence, intraday cyclical patterns, and inter-day correlation patterns in the historical electricity consumption sequence. Finally, an electricity consumption feature matrix containing complete local time-series patterns, long-range dependencies, periodic patterns, and fluctuation trends is obtained. , The dimension is also the target dimension.

[0094] Optionally, as shown in equation (10), corresponding weights can be applied to the electricity price feature matrix respectively. Climate characteristic matrix Electricity consumption characteristic matrix Perform a linear transformation to map it to the query vector (Query, ...) of the cross-attention mechanism. ), key vector (Key, ) and value vector (Value, ). It carries the economic incentive signal of market electricity prices. It contains the physical state of the building's external environment to be predicted. It contains the basic time-series pattern of the electricity consumption of the building to be predicted.

[0095] (10)

[0096] in, These are the characteristic matrices of electricity prices. Climate characteristic matrix Electricity consumption characteristic matrix The corresponding learnable weights.

[0097] Optionally, see equation (11) below, a query vector can be used. To match key vectors The coupling correlation between the two over time is calculated, and then normalized using Softmax (normalized exponential function) to obtain the cross-attention distribution matrix of electricity price and climate value. .

[0098] (11)

[0099] in, This is a scaling factor used to prevent the gradient from vanishing due to excessively large inner product values. This is the matrix transpose symbol.

[0100] Optionally, see equation (12) below, the attention distribution matrix can be... Multiply the sum vectors by a matrix to extract the elasticity of the combined influence of electricity prices and climate values ​​on electricity consumption. Then, multiply this elasticity feature by the electricity consumption feature matrix. Element-wise addition is performed to obtain deep fusion features. .

[0101] (12)

[0102] Subsequently, the deep fusion features are performed along the time and feature dimensions. Flattened into a one-dimensional global feature vector .at this time, It includes not only the macro-climate cycle patterns of the buildings to be predicted, but also the micro-economic response patterns.

[0103] Optionally, the prediction module may include a multi-step parallel prediction head to avoid the error accumulation problem caused by traditional recursive multi-step prediction. Each prediction head directly receives the global feature vector. Independently responsible for predicting the future Hourly electricity consumption See equation (13) below.

[0104] (13)

[0105] in, and They represent the first The weight vector and bias scalar of each prediction head.

[0106] Correspondingly, by performing parallel forward computation on T forecast heads, the predicted electricity consumption sequence corresponding to the historical period can be obtained.

[0107] The above model training method obtains the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence of different climate dimensions for the building to be predicted within a historical period; corrects the initial electricity consumption sequence to obtain the historical electricity consumption sequence; determines the target climate dimension from different climate dimensions based on the historical electricity consumption sequence, and obtains historical climate data based on the initial climate value sequence corresponding to the target climate dimension; trains the initial model using the historical climate data and historical electricity price sequence as samples, and uses the historical electricity consumption sequence as labels, to obtain the electricity consumption prediction model for the building to be predicted. In this way, correcting the initial electricity consumption sequence can improve the data quality of the historical electricity consumption sequence used as a label. At the same time, determining the target climate dimension based on the historical electricity consumption sequence overcomes the data redundancy problem caused by using climate data of all dimensions as training samples in traditional techniques. This reduces the computational burden of subsequent model training and electricity consumption prediction, and avoids redundant initial climate value sequences interfering with model learning. This strengthens the correlation between key historical climate data and electricity consumption patterns. On this basis, training the initial model with historical climate data and historical electricity price sequences as samples and historical electricity consumption sequences as labels enables the model to learn the elasticity of building electricity consumption driven by the coupling of climate data and electricity prices. This ensures that the trained electricity consumption prediction model has higher prediction accuracy, stronger generalization ability, and stronger robustness.

[0108] Based on the above embodiments, in an exemplary embodiment, such as Figure 3 As shown, S202 above, correcting the initial electricity consumption sequence to obtain the historical electricity consumption sequence, may include the following steps:

[0109] S301, for each data point in the initial electricity consumption sequence, determine the distance between the data point and the corresponding associated data point.

[0110] The data points and their associated data points are ordered according to a preset positional relationship. For example, for each data point, the associated data points can be a preset number of data points before and after it.

[0111] Optionally, the distance between a data point and its corresponding associated data point can be the absolute value of the numerical difference between the two data points, or the distance between the data point and its corresponding associated data point can be determined by the difference between the absolute value and the time index corresponding to the two data points.

[0112] S302, Based on the obtained distances, the initial electricity consumption sequence is corrected to obtain the historical electricity consumption sequence.

[0113] Optionally, a distance threshold can be preset according to the forecasting needs. Data points whose distance to all associated data points exceeds the distance threshold are regarded as abnormal data points. Abnormal data points in the initial electricity consumption sequence are replaced while normal data points other than abnormal data points remain unchanged to obtain the historical electricity consumption sequence.

[0114] In this embodiment, the initial electricity consumption sequence is corrected based on the distance between the data point and the corresponding associated data point. This achieves the correction of abnormal data points with lower computational cost, improving the reliability and accuracy of the historical electricity consumption sequence used as a label, and providing a more reliable and higher quality data foundation for subsequent model training.

[0115] Based on the above embodiments, in an exemplary embodiment, such as Figure 4 As shown, in step S302 above, the initial electricity consumption sequence is corrected based on the obtained distances to obtain the historical electricity consumption sequence, which may include the following steps:

[0116] S401, for each data point in the initial electricity consumption sequence, determine the reachability density of the data point in its local region based on the distance between the data point and its corresponding associated data point.

[0117] The local area refers to the common area where the data points and related data points in the initial electricity consumption sequence are located.

[0118] The reachability density of a data point within its local region describes the density of data distribution within that local region.

[0119] Optionally, as shown in equation (14), for any data point p, data point p can be associated with the corresponding set of related data points. The maximum distance between all associated data points in the dataset is taken as the k-nearest neighbor distance of data point p. .

[0120] (14)

[0121] Where o is the set of associated data points Any related data point in the middle, This represents the distance between data point p and its associated data point o.

[0122] Referring to equation (15), for any data point p and any associated data point o, the k-nearest neighbor distance of data point p can be calculated. The maximum value of the distances between data point p and associated data point o is taken as the k-th order reachable distance of data point p relative to associated data point o. .

[0123] (15)

[0124] Referring to equation (16), for any data point p, the reachability density of data point p in its local region can be determined based on the k-th order reachability distance of data point p relative to each associated data point and the total number of associated data points. .

[0125] (16)

[0126] in, This represents the total number of associated data points.

[0127] S402, determine the anomaly of each data point based on the reachability density of each data point in its local region.

[0128] Optionally, as shown in equation (17), for any data point p, the reachability density of that data point p can be used as a reference. The reachability density of each associated data point p within its local region is used to determine the outlier factor of the data point p within that local region. .

[0129] (17)

[0130] in, This represents the reachability density of the associated data point o within its local region. The process of determining can be found in equations (14) to (16) above, and will not be elaborated here.

[0131] In determining outlier factors Subsequently, if the outlier value is much greater than 1, it indicates that the data distribution of data point p in its local region is relatively uniform and does not conform to the normal data distribution pattern. Therefore, the outlier value of data points with an outlier value much greater than 1 can be identified as an anomaly. Conversely, if the outlier value is close to 1, it indicates that the data distribution of data point p in its local region conforms to the normal data distribution pattern. Therefore, the outlier value of data points with an outlier value close to 1 can be identified as normal.

[0132] S403, correct the abnormal data points in the initial electricity consumption sequence to obtain the historical electricity consumption sequence.

[0133] Optionally, for each abnormal data point in the initial electricity consumption sequence that represents an abnormality, the abnormal data point can be corrected by replacing it with the normal data points before and after the abnormal data point using linear interpolation or moving average, so as to obtain the historical electricity consumption sequence.

[0134] In this embodiment, since reachability density can more precisely characterize the density of data distribution in the local area to which the data point belongs, abnormal data points can be identified based on reachability density and replaced. This preserves the overall trend of the initial electricity consumption sequence and avoids the model learning false electricity fluctuations, further improving the data quality of the labels.

[0135] Based on the above embodiments, in an exemplary embodiment, such as Figure 5 As shown, S203 above, determining the target climate dimension from different climate dimensions based on historical electricity consumption sequences, may include the following steps:

[0136] S501. Based on historical electricity consumption sequences and initial climate value sequences for different climate dimensions, an electricity consumption regression model is established.

[0137] The electricity consumption regression model is used to characterize the mapping relationship between each climate dimension and electricity consumption. This model can be linear (e.g., multiple linear regression) or non-linear (e.g., decision trees, random forests, gradient boosting machines, or neural networks). It's important to note that the electricity consumption regression model is only used to determine the target climate dimension and is not the final electricity consumption prediction model used for forecasting.

[0138] Optionally, a power consumption regression model can be trained using historical electricity consumption sequences as the output target and initial climate value sequences for all climate dimensions as input features. After training, the power consumption regression model can predict the power consumption for future periods / times based on climate values ​​for those future periods / times.

[0139] S502, based on the electricity consumption regression model, determines the contribution of each climate dimension.

[0140] The contribution of each climate dimension is used to characterize the degree to which the initial climate value sequence of the climate dimension contributes to the historical electricity consumption sequence.

[0141] The higher the contribution, the more correlated the change in this climate dimension is with the change in electricity consumption; the lower the contribution, the weaker the correlation between this dimension and electricity consumption.

[0142] Optionally, as shown in Equation (18), the contribution of each climate dimension can be determined using the Shapley additive interpretation method.

[0143] (18)

[0144] in, Let M represent the contribution of the j-th climate dimension, and M be the total number of data points in the historical electricity consumption series. This indicates the degree of influence of the j-th climate dimension on the i-th data point in the historical electricity consumption sequence.

[0145] S503 ranks the climate dimensions in descending order of contribution, yielding the ranking results.

[0146] Optionally, sorting methods such as quicksort or bubble sort can be used to sort each climate dimension according to its contribution. In this case, the climate dimension that appears earlier in the sorted result has a greater contribution and a stronger impact on electricity consumption.

[0147] S504, take the climate dimension that is located before the preset number of positions in the sorting results as the target climate dimension.

[0148] Optionally, a preset number can be determined based on actual needs, and the climate dimension located before the preset number position can be selected from the sorting results as the target climate dimension.

[0149] For example, if the sorting result is [temperature, humidity, wind speed, air pressure, precipitation] and the preset quantity is 4, then the target climate dimensions are temperature, humidity and wind speed.

[0150] In this embodiment, while ensuring the explanatory power of electricity consumption, target climate dimensions that are more relevant to changes in electricity consumption are selected, effectively overcoming the data redundancy and computational overhead problems caused by traditional techniques that input all climate dimensions into the model. Furthermore, climate dimensions ranked before a preset number of positions in the sorting results are used as target climate dimensions, eliminating the need for subjectively setting contribution thresholds. This facilitates uniform implementation across different buildings or seasonal scenarios, improving the efficiency and generalization ability of model training.

[0151] Based on the above embodiments, in an exemplary embodiment, such as Figure 6 As shown, S204 above, using historical climate data and historical electricity price sequences as samples, and using historical electricity consumption sequences as labels, trains the initial model to obtain the electricity consumption prediction model for the building to be predicted, which may include the following steps:

[0152] S601: Input historical climate data and historical electricity price series into the initial model to obtain the predicted electricity consumption series of the building to be predicted during the historical period.

[0153] It should be noted that the process of obtaining the predicted electricity consumption sequence can be found in equations (1) to (13) above, and will not be repeated here.

[0154] S602, determine the time-domain loss value and frequency loss value between the predicted electricity consumption sequence and the historical electricity consumption sequence, and determine the loss value of the initial model based on the time-domain loss value and frequency loss value.

[0155] Among them, the time-domain loss value represents the sum of the numerical differences between the predicted electricity consumption sequence and the historical electricity consumption sequence at the same time in the time domain, and the frequency-domain loss value represents the sum of the amplitude differences between the predicted electricity consumption sequence and the historical electricity consumption sequence at the same frequency in the frequency domain.

[0156] Optionally, the time-domain loss value between the predicted electricity consumption series and the historical electricity consumption series can be determined according to the following formula (19). .

[0157] (19)

[0158] in, The predicted power consumption is output by the t-th prediction head. To and The actual electricity consumption during the same period, where T represents the total number of predicted heads. Let be the error penalty coefficient for the t-th prediction head. It can be determined based on the following formula (20).

[0159] (20)

[0160] in, This represents the training fitting error at a single time step. Based on The critical threshold for normal error defined by statistical criteria. This is the ratio between the number of abnormal data points and the number of normal data points in the initial electricity consumption sequence.

[0161] Optionally, the frequency domain loss value between the predicted electricity consumption series and the historical electricity consumption series can be determined according to the following formula (21). .

[0162] (twenty one)

[0163] in, This represents the Discrete Fourier Transform operation, used to convert a time series sequence to the frequency domain. K represents the total number of main effective frequency components to be selected and retained, and k is the index of the effective frequency component. for The amplitude of the kth effective frequency component.

[0164] Furthermore, referring to equation (22), after determining the time-domain loss value and frequency loss value between the predicted electricity consumption sequence and the historical electricity consumption sequence, the time-domain loss value and frequency loss value can be weighted to obtain the loss value of the initial model. .

[0165] (twenty two)

[0166] in, The weights corresponding to the time-domain loss values. The weights are the values ​​corresponding to the frequency domain loss values.

[0167] S603: If the loss value does not meet the preset convergence condition, adjust the model parameters of the initial model and return to execute the operation of obtaining the predicted electricity consumption sequence until the loss value meets the preset convergence condition, and use the current initial model as the electricity consumption prediction model of the building to be predicted.

[0168] The preset convergence condition can be that the loss value is less than or equal to the loss value threshold.

[0169] Optionally, if the loss value does not meet the preset convergence condition, the model parameters of the initial model are adjusted to obtain a new initial model. Then, based on the new initial model, the above S601 is executed again to obtain a new predicted electricity consumption sequence. According to the new predicted electricity consumption sequence and the historical electricity consumption sequence, the loss value of the new initial model is determined. If the loss value does not meet the preset convergence condition, the model parameters of the initial model are adjusted again, and the operation of obtaining the predicted electricity consumption sequence is repeated until the loss value meets the preset convergence condition. The current initial model can be used as the electricity consumption prediction model for the building to be predicted.

[0170] In this embodiment, the time-domain loss value constrains the numerical accuracy of the model's point-by-point predictions, ensuring that the predicted results are numerically close to the true values. The frequency loss value constrains the amplitude distribution of the predicted sequence in the frequency domain, enabling the model to focus on the overall fluctuation trend, periodicity, and peak-valley phase of the electricity consumption sequence. Jointly optimizing the time-domain and frequency-domain loss values ​​overcomes the problem of trend shifts and peak-valley misalignments in the predicted sequence caused by traditional training methods that only use time-domain losses (such as mean squared error). Thus, even in scenarios with drastic fluctuations in electricity consumption or frequent changes in electricity spot market prices, it can still maintain high prediction accuracy and trend consistency, further improving the robustness of the model and the reliability of power dispatch.

[0171] Based on the above embodiments, in an exemplary embodiment, such as Figure 7 As shown, an optional model training method is provided. Wherein:

[0172] S701, obtain the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence for different climate dimensions of the building to be predicted during historical periods.

[0173] S702, for each data point in the initial electricity consumption sequence, determine the distance between the data point and the corresponding associated data point.

[0174] The sorting of data points and associated data points satisfies a preset positional relationship.

[0175] S703, determine the reachability density of a data point in its local region based on the distance between the data point and its corresponding associated data point.

[0176] The local area refers to the common area where the data points and related data points in the initial electricity consumption sequence are located.

[0177] S704, based on the reachability density of each data point in its local region, determines the anomaly of each data point.

[0178] S705, corrects the abnormal data points in the initial electricity consumption sequence to obtain the historical electricity consumption sequence.

[0179] S706, based on historical electricity consumption sequences and initial climate value sequences for different climate dimensions, establishes an electricity consumption regression model.

[0180] S707 determines the contribution of each climate dimension based on the electricity consumption regression model.

[0181] The contribution of each climate dimension is used to characterize the degree to which the initial climate value sequence of the climate dimension contributes to the historical electricity consumption sequence.

[0182] S708 sorts the climate dimensions in descending order of contribution, and obtains the sorting results.

[0183] S709, take the climate dimension that is located before the preset number of positions in the sorting results as the target climate dimension.

[0184] S710: Historical climate data are obtained based on the initial climate value sequence corresponding to the target climate dimension.

[0185] S711 inputs historical climate data and historical electricity price series into the initial model to obtain the predicted electricity consumption series of the building to be predicted during the historical period.

[0186] S712, determine the time-domain loss value and frequency loss value between the predicted electricity consumption series and the historical electricity consumption series, and determine the loss value of the initial model based on the time-domain loss value and frequency loss value.

[0187] S713, determine whether the loss value meets the preset convergence condition. If the loss value meets the preset convergence condition, execute S714 as follows; otherwise, if the loss value does not meet the preset convergence condition, execute S715 as follows.

[0188] S714 uses the current initial model as the electricity consumption prediction model for the building to be predicted.

[0189] S715, adjust the model parameters of the initial model, and return to execute S711 above.

[0190] The specific implementation methods of S701-S715 are the same as those in the above method embodiments, and will not be repeated here.

[0191] like Figure 8 As shown in the embodiments of this application, a method for predicting electricity consumption is also provided, including:

[0192] S801, obtain the future climate value sequence and future electricity price sequence of the building to be predicted in the future time period.

[0193] Optionally, the process of obtaining future climate value sequences may include first obtaining initial climate value sequences of different climate dimensions for the building to be predicted in the future period from weather forecast information, and then selecting the climate value sequence of the target climate dimension from the initial climate value sequences of different climate dimensions in the future period as the future climate value sequence.

[0194] Optionally, the future electricity price sequence for future periods can be determined based on a locally deployed and pre-trained electricity price forecasting model, or the future electricity price sequence can be obtained from announcements from the electricity market or grid company.

[0195] S802 inputs the future climate value series and the future electricity price series into the electricity consumption prediction model to obtain the target electricity consumption series of the building to be predicted in the future period.

[0196] The electricity consumption prediction model is trained according to any of the model training methods in the above embodiments, which will not be elaborated here.

[0197] It should be noted that the length of the future time period can be the same as or different from the length of the historical time period. The specific length can be determined according to the actual forecasting needs, and the embodiments of this application do not limit this.

[0198] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0199] Based on the same inventive concept, this application also provides a model training apparatus for implementing the model training method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more model training apparatus embodiments provided below can be found in the limitations of the model training method described above, and will not be repeated here.

[0200] In one exemplary embodiment, such as Figure 9 As shown, a model training apparatus is provided, comprising: a first acquisition module 910, a correction module 920, a determination module 930, and a training module 940, wherein:

[0201] The first acquisition module 910 is used to acquire the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence of different climate dimensions of the building to be predicted during historical periods.

[0202] The correction module 920 is used to correct the initial electricity consumption sequence to obtain the historical electricity consumption sequence.

[0203] The determination module 930 is used to determine the target climate dimension from different climate dimensions based on the historical electricity consumption sequence, and to obtain historical climate data based on the initial climate value sequence corresponding to the target climate dimension.

[0204] Training module 940 is used to train the initial model using historical climate data and historical electricity price series as samples and historical electricity consumption series as labels, so as to obtain the electricity consumption prediction model of the building to be predicted.

[0205] In one embodiment, the correction module 920 may include:

[0206] The determining unit is used to determine the distance between each data point and its corresponding associated data point in the initial electricity consumption sequence; wherein the sorting of the data points and associated data points satisfies a preset positional relationship.

[0207] The correction unit is used to correct the initial electricity consumption sequence based on the obtained distances to obtain the historical electricity consumption sequence.

[0208] In one embodiment, the correction unit is specifically used to determine the reachability density of each data point in the initial electricity consumption sequence within its local region based on the distance between the data point and its corresponding associated data point; wherein, the local region is the common area where the data point and associated data point are located in the initial electricity consumption sequence; to determine the abnormality of each data point based on the reachability density of each data point within its local region; and to correct the abnormal data points in the initial electricity consumption sequence that represent abnormalities, thereby obtaining the historical electricity consumption sequence.

[0209] In one embodiment, the determining module 930 is specifically used to establish an electricity consumption regression model based on historical electricity consumption sequences and initial climate value sequences of different climate dimensions; determine the contribution of each climate dimension based on the electricity consumption regression model; wherein, the contribution of each climate dimension is used to characterize the degree of contribution of the initial climate value sequence of the climate dimension to the historical electricity consumption sequence; sort each climate dimension in descending order of contribution to obtain a sorting result; and take the climate dimension located before a preset number of places in the sorting result as the target climate dimension.

[0210] In one embodiment, the training module 940 is specifically used to input historical climate data and historical electricity price sequences into the initial model to obtain the predicted electricity consumption sequence of the building to be predicted within the historical period; determine the time domain loss value and frequency loss value between the predicted electricity consumption sequence and the historical electricity consumption sequence, and determine the loss value of the initial model based on the time domain loss value and frequency loss value; if the loss value does not meet the preset convergence condition, adjust the model parameters of the initial model, and return to execute the operation of obtaining the predicted electricity consumption sequence until the loss value meets the preset convergence condition, and use the current initial model as the electricity consumption prediction model of the building to be predicted.

[0211] This application also provides an electricity consumption forecasting device for implementing the electricity consumption forecasting method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the electricity consumption forecasting device provided below can be found in the limitations of the electricity consumption forecasting method described above, and will not be repeated here.

[0212] In one exemplary embodiment, such as Figure 10As shown, a power consumption prediction device is provided, including: a second acquisition module 1010 and an input module 1020, wherein:

[0213] The second acquisition module 1010 is used to acquire the future climate value sequence and future electricity price sequence of the building to be predicted in the future time period.

[0214] Input module 1020 is used to input future climate value series and future electricity price series into the electricity consumption prediction model to obtain the target electricity consumption series of the building to be predicted in the future period.

[0215] The electricity consumption prediction model is trained according to any of the above model training methods.

[0216] The modules in the aforementioned model training device and electricity consumption prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0217] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence for different climate dimensions of the building to be predicted over historical periods. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a model training method or an electricity consumption prediction method.

[0218] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0219] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0220] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0221] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0222] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0223] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0224] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A model training method, characterized in that, The method includes: Obtain the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence for different climate dimensions of the building to be predicted during the historical period; The initial electricity consumption sequence is corrected to obtain the historical electricity consumption sequence; Based on the historical electricity consumption sequence, a target climate dimension is determined from the different climate dimensions, and historical climate data is obtained based on the initial climate value sequence corresponding to the target climate dimension. Using the historical climate data and the historical electricity price series as samples, and the historical electricity consumption series as labels, the initial model is trained to obtain the electricity consumption prediction model for the building to be predicted.

2. The method according to claim 1, characterized in that, The step of correcting the initial electricity consumption sequence to obtain the historical electricity consumption sequence includes: For each data point in the initial electricity consumption sequence, the distance between the data point and the corresponding associated data point is determined; wherein the order of the data point and the associated data point satisfies a preset positional relationship; Based on the obtained distances, the initial electricity consumption sequence is corrected to obtain the historical electricity consumption sequence.

3. The method according to claim 2, characterized in that, The step of correcting the initial electricity consumption sequence based on the obtained distances to obtain the historical electricity consumption sequence includes: For each data point in the initial electricity consumption sequence, the reachability density of the data point in its local region is determined based on the distance between the data point and its corresponding associated data point; wherein, the local region is the common area where the data point and the associated data point are located in the initial electricity consumption sequence. Based on the reachability density of each data point in its local region, determine the anomaly of each data point; The abnormal data points in the initial electricity consumption sequence are corrected to obtain the historical electricity consumption sequence.

4. The method according to any one of claims 1-3, characterized in that, The step of determining the target climate dimension from the different climate dimensions based on the historical electricity consumption sequence includes: Based on the historical electricity consumption sequence and the initial climate value sequence of different climate dimensions, an electricity consumption regression model is established; Based on the electricity consumption regression model, the contribution of each climate dimension is determined; wherein, the contribution of each climate dimension is used to characterize the degree of contribution of the initial climate value sequence of the climate dimension to the historical electricity consumption sequence. The climate dimensions are sorted in descending order of contribution to obtain the sorting results; The climate dimension that is located before a preset number of positions in the sorting results is taken as the target climate dimension.

5. The method according to claim 1, characterized in that, The process of training an initial model using the historical climate data and historical electricity price sequences as samples, and the historical electricity consumption sequences as labels, to obtain an electricity consumption prediction model for the building to be predicted, includes: The historical climate data and the historical electricity price series are input into the initial model to obtain the predicted electricity consumption series of the building to be predicted during the historical period. Determine the time-domain loss value and frequency loss value between the predicted electricity consumption sequence and the historical electricity consumption sequence, and determine the loss value of the initial model based on the time-domain loss value and the frequency loss value; If the loss value does not meet the preset convergence condition, the model parameters of the initial model are adjusted, and the operation of obtaining the predicted electricity consumption sequence is returned until the loss value meets the preset convergence condition. The current initial model is then used as the electricity consumption prediction model for the building to be predicted.

6. A method for predicting electricity consumption, characterized in that, The method includes: Obtain the future climate value sequence and future electricity price sequence for the building to be predicted in the future time period; The future climate value sequence and the future electricity price sequence are input into the electricity consumption prediction model to obtain the target electricity consumption sequence of the building to be predicted in the future time period. The electricity consumption prediction model is trained using the method described in any one of claims 1 to 5.

7. A model training device, characterized in that, The device includes: The first acquisition module is used to acquire the initial electricity consumption sequence, historical electricity price sequence, and initial climate value sequence of different climate dimensions of the building to be predicted in the historical period. A correction module is used to correct the initial electricity consumption sequence to obtain a historical electricity consumption sequence; The determination module is used to determine the target climate dimension from the different climate dimensions based on the historical electricity consumption sequence, and to obtain historical climate data based on the initial climate value sequence corresponding to the target climate dimension. The training module is used to train the initial model using the historical climate data and the historical electricity price series as samples, and the historical electricity consumption series as labels, to obtain the electricity consumption prediction model for the building to be predicted.

8. A power consumption prediction device, characterized in that, The device includes: The second acquisition module is used to acquire the future climate value sequence and future electricity price sequence of the building to be predicted in the future time period; An input module is used to input the future climate value sequence and the future electricity price sequence into the electricity consumption prediction model to obtain the target electricity consumption sequence of the building to be predicted in the future time period; wherein the electricity consumption prediction model is trained by the method according to any one of claims 1 to 5.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.