Urban intelligent energy management method based on double-carbon digital platform

By adaptively adjusting the forget gate bias term of the LSTM model, the prediction bias problem in urban smart energy load forecasting is solved, improving prediction accuracy and energy management efficiency.

CN120580091BActive Publication Date: 2025-11-25TANGSHAN SNOWMAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510664823.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-11-25
Estimated Expiration
2045-05-22

AI Technical Summary

Technical Problem

In urban smart energy load forecasting, existing LSTM models suffer from biases due to the inability of the fixed bias term of the forget gate to adaptively adjust. This makes it difficult to strengthen memory during periods of feature stability, leading to the loss of long-term dependencies. Furthermore, they cannot promptly forget abnormal changes during periods of drastic feature fluctuations, resulting in biased predictions and impacting multi-energy coordinated scheduling and strategy formulation.

Method used

By acquiring multidimensional data vectors of smart energy in the city, analyzing the degree of memory bias and the bias adjustment factor, dynamically adjusting the forget gate bias term of the LSTM model, and replacing the bias term in the LSTM model with the degree of memory bias and the bias adjustment factor, the prediction results are optimized.

Benefits of technology

It has improved the accuracy of smart energy load forecasting in cities, optimized multi-energy coordinated scheduling and strategy formulation, and achieved more precise energy management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580091B_ABST
    Figure CN120580091B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and especially relates to a kind of urban wisdom energy management method based on double carbon digital platform, the method obtains the multidimensional data vector sequence of urban wisdom energy at current sampling time;The multidimensional data vector sequence is regarded as the input of LSTM model, obtains the hidden state data vector and multidimensional activation vector at current sampling time, obtains memory tendency degree according to multidimensional activation vector;For any dimension data in hidden state data vector, obtain target time series data, obtain bias adjustment factor according to target time series data;According to memory tendency degree and bias adjustment factor, obtain the adaptive bias item of any dimension data;The adaptive bias item of each dimension data in hidden state data vector is used to replace the bias item in LSTM model, obtain the result of predicting multidimensional data vector at next sampling time, so that the prediction result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a city smart energy management method based on a double-carbon digital platform. BACKGROUND

[0002] City smart energy refers to the coordinated optimization of multiple energies such as electricity, heat, storage, gas, and carbon through digital means, realizing real-time monitoring, prediction, and optimal scheduling of energy, promoting renewable energy consumption, reducing carbon emission intensity, and optimizing multi-energy collaborative scheduling through load prediction. Demand response and energy saving and carbon reduction are realized, and energy saving control and strategy formulation are assisted by government or operation personnel.

[0003] Because city smart energy data often presents different patterns between different days, weekdays and weekends, and different seasons, it is not only affected by historical load, but also related to many external variables such as temperature, humidity, holiday policy, and traffic flow. Through the mechanism of forget gate, input gate, and output gate, LSTM (time recurrent neural network) can retain short-term peak information (such as today's morning peak) and save long-term seasonal trends (such as summer air conditioning electricity consumption), which is suitable for application in city smart energy load prediction, demand response, and scheduling optimization, providing reliable data support for energy allocation and energy saving decision-making.

[0004] Therefore, in the prior art, a standard LSTM model is constructed to predict the load of city smart energy, and then to optimize subsequent multi-energy collaborative scheduling and strategy formulation. Because city smart energy data varies in different environments and times, the importance of different energy data (such as electricity, heat, and gas load) to the prediction result changes dynamically (for example, temperature at night has little effect on air conditioning load, but still occupies the same "gate resource"), and the forget gate of LSTM uniformly affects the bias of all features to memory and forgetting through a fixed bias term, ignoring the problem that the importance of features changes over time. This mechanism makes it difficult for the model to effectively strengthen memory when some features enter a stable period, missing long-term dependencies, and unable to forget abnormal changes in time when features fluctuate sharply, resulting in over-memory, and finally causing the prediction result to deviate from the actual situation, thereby affecting subsequent multi-energy collaborative scheduling and strategy formulation.

[0005] Therefore, how to adaptively adjust the bias term in the forget gate of LSTM to obtain accurate prediction results has become a problem to be solved. SUMMARY

[0006] Therefore, the embodiments of the present application provide a city smart energy management method based on a double-carbon digital platform to solve the problem of how to adaptively adjust the bias term in the forget gate of LSTM to obtain accurate prediction results.

[0007] This invention provides a smart energy management method for cities based on a dual-carbon digital platform, the method comprising the following steps:

[0008] Obtain the multidimensional data vector of smart energy in the city at each sampling time to obtain the multidimensional data vector sequence at the current sampling time;

[0009] Obtain the LSTM model corresponding to the previous sampling time at the current sampling time, use the multidimensional data vector sequence as the input of the LSTM model to obtain the hidden state data vector and multidimensional activation vector at the current sampling time, and obtain the memory tendency degree at the current sampling time based on the data differences between the data of each dimension in the multidimensional activation vector.

[0010] For any dimension of the hidden state data vector, data belonging to the same dimension as the data in each sampling time are obtained from the hidden state data vector to form target time series data. Based on the trend and periodic changes of the target time series data, the bias term adjustment factor of the data in any dimension is obtained.

[0011] In the hidden state data vector of the previous sampling time, data belonging to the same dimension as the data of any dimension is obtained and denoted as target data. The bias term of the target data is adjusted according to the memory tendency degree and the bias term adjustment factor to obtain the adaptive bias term of the data of any dimension.

[0012] By using the adaptive bias term of each dimension of the hidden state data vector, the bias term in the LSTM model is replaced to obtain the prediction result of the multidimensional data vector for the next sampling time at the current sampling time.

[0013] Preferably, the step of obtaining the memory tendency at the current sampling time based on the data differences between the data in each dimension of the multidimensional activation vector includes:

[0014] The absolute values ​​of the data in all dimensions of the multidimensional activation vector are summed to obtain the total dimension data. For any dimension of the multidimensional activation vector, the ratio between the absolute value of the data in that dimension and the total dimension data is obtained. The product of the ratio and the data in that dimension is calculated to obtain the forgetting influence factor of that dimension.

[0015] Obtain the mean of data in all dimensions of the multidimensional activation vector, denoted as the feature mean; obtain the difference between the data in any dimension and the feature mean to obtain the deviation direction value; obtain the absolute value of the difference between the data in any dimension and the feature mean to obtain the degree of deviation; obtain the product of the deviation direction value and the degree of deviation to obtain the memory tendency factor of any dimension.

[0016] Obtain the forgetting influence factors of all dimensions in the multidimensional activation vector, and obtain the cumulative value of the forgetting influence factors. Perform hyperbolic tangent processing on the cumulative value of the forgetting influence factors to obtain the first memory level.

[0017] Obtain the memory tendency factor of all dimensions in the multidimensional activation vector, and obtain the cumulative value of the memory tendency factor. Perform hyperbolic tangent processing on the cumulative value of the memory tendency factor to obtain the second memory degree.

[0018] The memory tendency at the current sampling time is obtained by averaging the first memory level and the second memory level.

[0019] Preferably, obtaining the bias term adjustment factor for any dimension of the data based on the trend and periodic changes of the target time-series data includes:

[0020] The target time series data is subjected to first-order difference processing to obtain a corresponding first-order difference data sequence. Based on the trend change of the first-order difference data in the first-order difference data sequence, the trend change index of any dimension data is obtained.

[0021] Obtain the maximum value in the target time series data, and obtain the periodic change index of the data in any dimension based on the numerical difference between the maximum values ​​in the target time series data and the difference in sampling time.

[0022] Obtain the variance of the target time series data, perform hyperbolic tangent processing on the variance of the target time series data to obtain the disorder level of the target time series data, obtain the maximum value between the trend change index and the period change index, and obtain the bias term adjustment factor of the data in any dimension based on the difference between the maximum value and the disorder level.

[0023] Preferably, obtaining the trend change index of any dimension data based on the trend change of the first-order difference data in the first-order difference data sequence includes:

[0024] The average value of the first-order difference data sequence is obtained and denoted as the difference mean. The absolute value of the difference between each first-order difference data in the first-order difference data sequence and the difference mean is accumulated to obtain the accumulated absolute value of the difference. The opposite of the accumulated absolute value of the difference is substituted into an exponential function with the natural constant as the base to obtain the trend change index of the data in any dimension.

[0025] Preferably, obtaining the periodic change index of any dimension of the data based on the numerical difference between the maxima and the sampling time difference in the target time series data includes:

[0026] The absolute values ​​of the differences between any two adjacent maxima in the target time series data are accumulated to obtain the accumulated maximum difference value. The negative of the accumulated maximum difference value is substituted into an exponential function with the natural constant as the base to obtain the first periodic feature value of the data in any dimension.

[0027] The sampling times of the maximum value in the target time series data are formed into a sampling time data sequence. The sampling time data sequence is subjected to second-order difference processing to obtain a corresponding second-order difference data sequence. The second-order difference data in the second-order difference data sequence are accumulated to obtain the interval time difference accumulation value. The negative number of the interval time difference accumulation value is put into an exponential function with the natural constant as the base to obtain the second periodic feature value of the data in any dimension.

[0028] The periodic change index of any dimension of data is obtained by averaging the first periodic feature value and the second periodic feature value.

[0029] Preferably, adjusting the bias term of the target data according to the memory tendency degree and the bias term adjustment factor to obtain the adaptive bias term of the data in any dimension includes:

[0030] The weighted summation of the memory tendency degree and the bias term adjustment factor yields the bias term adjustment degree for any dimension of the data.

[0031] Based on the degree of bias term adjustment, the bias term of the target data is adjusted to obtain the adaptive bias term of the data in any dimension.

[0032] Preferably, adjusting the bias term of the target data according to the degree of bias term adjustment to obtain the adaptive bias term of the data in any dimension includes:

[0033] The constant 1 is added to the degree of bias adjustment to obtain the bias adjustment weight. The adaptive bias term of any dimension data is obtained by multiplying the bias term of the target data with the bias adjustment weight.

[0034] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:

[0035] This invention acquires multidimensional data vectors of urban smart energy at each sampling time, obtaining a multidimensional data vector sequence for the current sampling time; it acquires the LSTM model corresponding to the previous sampling time, using the multidimensional data vector sequence as input to the LSTM model to obtain the hidden state data vector and multidimensional activation vector for the current sampling time; based on the data differences between the data of each dimension in the multidimensional activation vector, it obtains the memory tendency degree for the current sampling time; for any dimension of data in the hidden state data vector, it extracts data belonging to the same dimension as the data in the hidden state data vector at each sampling time to form the target. For time-series data, based on the trend and periodic changes of the target time-series data, the bias term adjustment factor of any dimension data is obtained; in the hidden state data vector of the previous sampling time, data belonging to the same dimension as the data of any dimension is obtained and denoted as target data. According to the memory tendency degree and the bias term adjustment factor, the bias term of the target data is adjusted to obtain the adaptive bias term of the data of any dimension; using the adaptive bias term of each dimension data in the hidden state data vector, the bias term in the LSTM model is replaced to obtain the prediction result of the multi-dimensional data vector of the next sampling time for the current sampling time. Specifically, by acquiring the memory tendency at the current sampling time, the degree to which the multi-dimensional activation vector needs to be remembered at the current sampling time (i.e., its importance to subsequent predictions) is reflected. Then, by analyzing the trend and periodic changes of the target time series data, the bias term adjustment factor of any dimension of the data is obtained to improve the accuracy of the adjustment. Finally, by using the memory tendency and the bias term adjustment factor, the bias term of the target data is adjusted, thereby predicting the multi-dimensional data vector of the next sampling time from the current sampling time. This effectively improves the accuracy of smart energy load prediction in the city, and thus optimizes subsequent multi-energy coordinated scheduling and strategy formulation. Attached Figure Description

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

[0037] Figure 1 This is a flowchart of a smart energy management method for cities based on a dual-carbon digital platform, provided in Embodiment 1 of the present invention. Detailed Implementation

[0038] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.

[0039] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.

[0040] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0041] See Figure 1 This is a flowchart of a smart city energy management method based on a dual-carbon digital platform provided in Embodiment 1 of the present invention. Figure 1 As shown, the method may include:

[0042] Step S101: Obtain the multidimensional data vector of the city's smart energy at each sampling time to obtain the multidimensional data vector sequence at the current sampling time.

[0043] Smart energy in cities refers to the use of digital means to coordinate and optimize multiple energy sources such as electricity, heat, storage, gas, and carbon, to achieve real-time monitoring, forecasting, and optimized scheduling of energy, promote the consumption of renewable energy, reduce carbon emission intensity, and optimize multi-energy coordinated scheduling through load forecasting to achieve on-demand response and energy conservation and carbon reduction, and assist governments or operation and maintenance personnel in energy conservation regulation and strategy formulation.

[0044] Existing technologies construct standard LSTM models to predict urban smart energy loads, thereby optimizing subsequent multi-energy coordinated scheduling and strategy formulation. However, the importance of different energy data (such as electricity, heat, and gas loads) to the prediction results dynamically changes under different environments and times (for example, nighttime temperature has a negligible impact on air conditioning load, yet still occupies the same "gated resources"). The forgetting gate in LSTM uniformly influences the bias of all features towards memory and forgetting through a fixed bias term, ignoring the issue of feature importance changing over time. This mechanism makes it difficult for the model to effectively reinforce memory when certain features enter a stable period, missing long-term dependencies. Conversely, it cannot promptly forget abnormal changes when features fluctuate drastically, resulting in over-memorization. Ultimately, this leads to deviations between the prediction results and actual conditions, thus affecting subsequent multi-energy coordinated scheduling and strategy formulation.

[0045] Therefore, this embodiment collects multidimensional data vectors of urban smart energy at each sampling time to form a multidimensional data vector sequence at the current sampling time. By analyzing the multidimensional data vector sequence, the memory tendency and bias term adjustment factor are obtained, and the bias term in the LSTM model is adjusted. Then, the multidimensional data vector of the next sampling time is predicted, which effectively improves the accuracy of urban smart energy load prediction.

[0046] Smart energy in cities encompasses five core dimensions: electricity, heat, gas, storage, and carbon. It combines building and user-related energy consumption data with renewable energy data to form a multi-source, heterogeneous, and high-dimensional data system. Data such as electricity consumption, natural gas usage, and carbon emission factors are collected through smart meters and various sensors (temperature, humidity, etc.).

[0047] Since the collected smart energy data may contain missing values, spline interpolation is required to reduce the impact of missing values. Furthermore, because LSTM is a strictly time-step-based sequence model, and the data collection frequencies of smart energy data vary due to differences in equipment and business requirements, it is necessary to unify the time granularity and sampling period for these multi-source heterogeneous data. For example, high-frequency data can be aggregated (mean, maximum), low-frequency data can be filled using linear interpolation, and the data can be normalized to the [0, 1] interval using Min-Max to reduce the sensitivity of LSTM to the data range and match the LSTM activation function. Spline interpolation, data aggregation, linear interpolation, and Min-Max normalization are existing technologies and will not be elaborated here.

[0048] If the time period for collecting smart energy data is too short, it may only contain local fluctuations, making it easy to be overly sensitive to occasional small changes and misjudge trends or cycles. If the time period for collecting smart energy data is too long, although it can more accurately capture long-term trends and cycles, if the smart energy data changes rapidly (such as sudden weather or peak energy consumption), the LSTM model will become sluggish. Therefore, in this embodiment, 9 hours of smart energy data, including the current sampling time, are collected. The processed smart energy data is then uniformly sampled at a frequency of once per second. The smart energy data at each sampling time is composed of a multidimensional data vector, and the 9 hours of multidimensional data vectors are composed of a multidimensional data vector sequence for subsequent analysis. There are no restrictions here, and the settings can be adjusted according to the specific implementation scenario.

[0049] Step S102: Obtain the LSTM model corresponding to the previous sampling time of the current sampling time, use the multidimensional data vector sequence as the input of the LSTM model to obtain the hidden state data vector and multidimensional activation vector at the current sampling time, and obtain the memory tendency degree at the current sampling time based on the data differences between the data of each dimension in the multidimensional activation vector.

[0050] After obtaining the multidimensional data vector sequence, the LSTM model corresponding to the previous sampling time is obtained. The multidimensional data vector sequence is used as the input to the model to obtain the hidden state data vector and multidimensional activation vector at the current sampling time. Let z be the multidimensional activation vector at the current sampling time. t =W f ×[h t-1 ,x t ], where z t W is the multidimensional activation vector at the current sampling time. f h is the forget gate weight matrix. t-1 x is the hidden state data vector from the previous sampling time to the current sampling time. t This is the input for the current sampling time.

[0051] The multidimensional activation vector at the current sampling time reflects the signal strength of the input and historical hidden state data vectors at the current sampling time regarding whether the data "needs to be forgotten" at the current sampling time. It is a key factor in determining the output of the forget gate. Since the traditional LSTM model does not consider the dynamic changes in the importance of different input dimensions at different sampling times, we can analyze the importance of different input dimensions in the multidimensional activation vector at the current sampling time. This allows the more important dimensions to dominate whether the forget gate chooses to remember, thus enabling the more important input dimension data at the current sampling time to dominate the bias adjustment of the forget gate and dynamically guide the LSTM model to make a more reasonable memory selection. At the same time, we can obtain the memory tendency at the current sampling time by comparing the difference between each dimension of the multidimensional activation vector and the total dimension data. This allows for a comprehensive analysis of the overall memory tendency of the multidimensional activation vector at the current sampling time.

[0052] The method for obtaining the memory tendency at the current sampling time by analyzing the difference between the data in each dimension of the multidimensional activation vector and the total data in the current sampling time is as follows:

[0053] The absolute values ​​of the data in all dimensions of the multidimensional activation vector are summed to obtain the total dimension data. For any dimension of the multidimensional activation vector, the ratio between the absolute value of the data in that dimension and the total dimension data is obtained. The product of the ratio and the data in that dimension is calculated to obtain the forgetting influence factor of that dimension.

[0054] Obtain the mean of data in all dimensions of the multidimensional activation vector, denoted as the feature mean; obtain the difference between the data in any dimension and the feature mean to obtain the deviation direction value; obtain the absolute value of the difference between the data in any dimension and the feature mean to obtain the degree of deviation; obtain the product of the deviation direction value and the degree of deviation to obtain the memory tendency factor of any dimension.

[0055] Obtain the forgetting influence factors of all dimensions in the multidimensional activation vector, and obtain the cumulative value of the forgetting influence factors. Perform hyperbolic tangent processing on the cumulative value of the forgetting influence factors to obtain the first memory level.

[0056] Obtain the memory tendency factor of all dimensions in the multidimensional activation vector, and obtain the cumulative value of the memory tendency factor. Perform hyperbolic tangent processing on the cumulative value of the memory tendency factor to obtain the second memory degree.

[0057] The memory tendency at the current sampling time is obtained by averaging the first memory level and the second memory level.

[0058] In one embodiment, the formula for calculating the memory tendency at the current sampling time is:

[0059]

[0060] Among them, P t The degree of memory tendency at the current sampling time; z t,i z' represents the data of the i-th dimension in the multidimensional activation vector at the current sampling time; n is the total number of dimensions of the input at the current sampling time, m is the total number of dimensions of the hidden state data vector, and n+m is the total number of dimensions of the multidimensional activation vector; t is the characteristic mean; tanh() is the hyperbolic tangent function; || is the absolute value symbol.

[0061] It should be noted that, Let z be the forgetting influence factor of the i-th dimension in the multidimensional activation vector at the current sampling time. t,i The larger, The larger the value, the more likely z is to be. t,i The stronger the impact on the forget gate at the current sampling time; The larger the size, the stronger the first memory level. The larger the value, the more the input at the current sampling moment tends to promote memory retention. Therefore, the forget gate should enhance the tendency to retain historical states, and the greater the tendency to remember at the current sampling moment; (z t,i -z' t )×|z t,o -z' t | represents the memory tendency factor of the i-th dimension in the multidimensional activation vector at the current sampling time, z.t,i The larger (z) t,i -z' t )×|z t,i -z' t The larger the value, the more the multidimensional activation vector tends to memorize, indicating a higher degree of memorization. The larger the value, the greater the tendency to remember at the current sampling time.

[0062] Thus, the degree of memory tendency at the current sampling moment is obtained.

[0063] Step S103: For any dimension of the hidden state data vector, obtain data belonging to the same dimension as the data of any dimension in the hidden state data vector at each sampling time, form target time series data, and obtain the bias term adjustment factor of the data of any dimension according to the trend change and periodic change of the target time series data.

[0064] Since the hidden state data vector is the input data pattern learned through the LSTM mechanism, analyzing the hidden state data vector is better at capturing the long-term dependencies and dynamic changes between data than directly analyzing the input data. Therefore, for any dimension of data in the hidden state data vector, data belonging to the same dimension as the data in any dimension can be obtained from the hidden state data vector at each sampling time corresponding to the multidimensional data vector sequence, forming the target time series data. Based on the trend and periodic changes of the target time series data, the bias term adjustment factor of any dimension data can be obtained. Then, combined with the bias term adjustment factor and the memory tendency, the bias term can be adjusted, making the urban smart energy load forecast more accurate.

[0065] The method for obtaining the bias term adjustment factor for any dimension of data based on the trend and periodic changes of the target time series data is as follows:

[0066] (1) Perform first-order difference processing on the target time series data to obtain a corresponding first-order difference data sequence. Based on the trend change of the first-order difference data in the first-order difference data sequence, obtain the trend change index of the data in any dimension. The first-order difference processing is an existing technology and will not be described in detail here.

[0067] Specifically, the average value of the first-order difference data sequence is obtained and denoted as the difference mean. The absolute value of the difference between each first-order difference data in the first-order difference data sequence and the difference mean is accumulated to obtain the accumulated absolute value of the difference. The negative of the accumulated absolute value of the difference is substituted into an exponential function with the natural constant as the base to obtain the trend change index of the data in any dimension.

[0068] In one implementation, taking the i-th dimension of the hidden state data vector as an example, the formula for calculating the trend change index of the i-th dimension data is:

[0069]

[0070] Among them, T i Δh is an indicator of the trend change of the i-th dimension of the hidden state data vector. j is the j-th first-order difference data in the first-order difference data sequence; N is the number of data in the target time series data; exp(-) is an exponential function with the natural constant as the base, used for inverse proportional normalization; || is the absolute value symbol.

[0071] It should be noted that, The mean of the differences represents the average value of the first-order difference data sequence. This represents the difference between the j-th first-order difference data point and the mean difference in a first-order difference data sequence. The smaller the value, the more stable the changes in the target time series data, the more similar the change amplitude of the data in the i-th dimension at each sampling time, the more obvious and stable the trend, and the larger the trend change index of the data in the i-th dimension in the hidden state data vector at the current sampling time.

[0072] (2) Obtain the maximum value in the target time series data according to the derivative method. The derivative method is an existing technology and will not be described in detail here. Based on the numerical difference between the maximum values ​​in the target time series data and the difference in sampling time, obtain the periodic change index of the data in any dimension.

[0073] Specifically, the absolute values ​​of the differences between any two adjacent maxima in the target time series data are accumulated to obtain the accumulated maximum difference value. The negative of the accumulated maximum difference value is then substituted into an exponential function with the natural constant as the base to obtain the first periodic feature value of the data in any dimension.

[0074] The sampling times of the maximum value in the target time series data are formed into a sampling time data sequence. The sampling time data sequence is subjected to second-order difference processing to obtain a corresponding second-order difference data sequence. The second-order difference data in the second-order difference data sequence are accumulated to obtain an interval time difference accumulation value. The negative of the interval time difference accumulation value is put into an exponential function with the natural constant as the base to obtain the second periodic feature value of the data in any dimension. The second-order difference processing is a prior art and will not be described in detail here.

[0075] The periodic change index of any dimension of data is obtained by averaging the first periodic feature value and the second periodic feature value.

[0076] In one implementation, taking the i-th dimension of the hidden state data vector as an example, the formula for calculating the periodicity index of the i-th dimension data is as follows:

[0077]

[0078] Among them, L i Δh' is the periodic change index of the i-th dimension of the hidden state data vector. k Δ is the difference between the (k+1)th maximum and the kth maximum in the target time series data; l is the number of maximum values ​​in the target time series data; Δ 2 t k is the k-th second-order difference data in the second-order difference data sequence; exp(-) is an exponential function with the natural constant as the base, used for inverse proportional normalization; || is the absolute value symbol.

[0079] It should be noted that, Let be the first periodic feature value of the i-th dimension of the data. The smaller the difference between any two adjacent maxima in the target time series data, the more stable the data fluctuations in the target time series data, i.e., the more periodic it is. The larger the value, the larger the periodic change index of the i-th dimension of the hidden state data vector; Let Δ be the second periodic feature value of the data in the i-th dimension. 2 t k The smaller the value, the more regular the occurrence of maxima in the target time series data, i.e., the more periodic it is. The larger the value, the larger the periodic change index of the i-th dimension data in the hidden state data vector.

[0080] (3) Obtain the bias adjustment factor for any dimension of data.

[0081] The trend change index of the i-th dimension data in the hidden state data vector obtained in step (1) above can reflect the trend of data change. The periodic change index of the i-th dimension data in the hidden state data vector obtained in step (2) above can reflect the periodicity of data change. Since relying solely on trend or periodic features is insufficient to ensure the overall stability of the data, if the data fluctuates greatly and is distributed chaotically, hastily enhancing the bias term of the i-th dimension data may cause the LSTM model to over-memorize noise features. Variance can reflect the degree of chaos in the data distribution. Therefore, based on the trend change index and periodic change index of the i-th dimension data in the hidden state data vector, combined with the variance of the target time series data, the bias term adjustment factor of any dimension data is obtained, thereby improving the accuracy and robustness of the adjustment.

[0082] Specifically, the variance of the target time series data is obtained, and hyperbolic tangent processing is performed on the variance of the target time series data to obtain the disorder level of the target time series data. The maximum value between the trend change index and the period change index is obtained, and the bias term adjustment factor of the data in any dimension is obtained based on the difference between the maximum value and the disorder level.

[0083] In one implementation, taking the i-th dimension of the hidden state data vector as an example, the formula for calculating the bias term adjustment factor of the i-th dimension data is:

[0084]

[0085] Where, σ i T is the bias adjustment factor for the i-th dimension of the hidden state data vector; i L represents the trend change index of the i-th dimension of the hidden state data vector; i This is the periodic change index of the i-th dimension of the hidden state data vector; denoted as the variance of the target time series data; max() is the maximum value function; tanh() is the hyperbolic tangent function.

[0086] It should be noted that max(T) i ,L i ) represents T i and L i The maximum value in the value range, because trend and periodicity respectively characterize different data change patterns, but they both point to the same adjustment direction: the more regular the data changes, the larger the bias term should be to strengthen the memory of this regularity. Therefore, T is selected. i and L i Using the maximum value in the bias term as the basis for adjusting the bias term can make the decision logic more direct and clear, avoid weak mode interference, and ensure that the LSTM model focuses on remembering the most significant dynamic features. This indicates the degree of disorder in the target time series data. The smaller the value, the less disordered the data in the target time series data is, i.e., the more stable it is. The more the bias term should be increased to strengthen memory, and the larger the adjustment factor of the bias term of the i-th dimension of the hidden state data vector should be.

[0087] Thus, the bias term adjustment factor for the i-th dimension of the hidden state data vector has been obtained.

[0088] Step S104: In the hidden state data vector of the previous sampling time, obtain the data that belongs to the same dimension as the data of any dimension, and record it as the target data. Adjust the bias term of the target data according to the memory tendency degree and the bias term adjustment factor to obtain the adaptive bias term of the data of any dimension.

[0089] In step S103 above, the memory tendency at the current sampling time is obtained, reflecting the overall data's bias towards memory selection. In step S104, the bias adjustment factor for the i-th dimension of the hidden state data vector is obtained. Further, in the hidden state data vector from the previous sampling time, data belonging to the same dimension as the i-th dimension is extracted and denoted as target data. The bias of the target data is adjusted using the memory tendency at the current sampling time and the bias adjustment factor for the i-th dimension of the hidden state data vector. The method for adjusting the bias of the target data is as follows:

[0090] (1) The weighted summation of the memory tendency degree and the bias term adjustment factor is performed to obtain the bias term adjustment degree of any dimension data.

[0091] In one implementation, taking the i-th dimension of the hidden state data vector as an example, the formula for calculating the degree of adjustment of the bias term of the i-th dimension data is as follows:

[0092] δ i =μ1P t +μ2σ i

[0093] Where, δ i The degree of adjustment for the bias term of the i-th dimension data; P t The degree of memory tendency at the current sampling time; σ i μ1 is the bias term adjustment factor for the i-th dimension of the hidden state data vector; μ2 is the weight coefficient of the memory tendency at the current sampling time; μ3 is the weight coefficient of the bias term adjustment factor for the i-th dimension of the hidden state data vector.

[0094] It should be noted that P t The larger σ is, the more the overall data tends to retain information at the current sampling time. In this case, the bias term needs to be increased to strengthen memory, and the degree of adjustment of the bias term for the i-th dimension data will be greater; i The larger the value of P, the more the trend of change in the i-th dimension data at the current sampling time needs to be remembered, and the greater the degree of adjustment of the bias term of the i-th dimension data; since P t σ reflects the overall data retention tendency at the current sampling time. i The bias term reflects the memory tendency of the i-th dimension data at the current sampling time, while the forget gate bias term reflects a long-term memory preference and should be based on single-dimensional data. Therefore, in this implementation, μ1 = 0.4 and μ2 = 0.6 are set. There are no restrictions here, and they can be set according to the specific implementation scenario.

[0095] (2) Adjust the bias terms of the target data according to the degree of bias term adjustment to obtain the adaptive bias terms of the data of any dimension.

[0096] Specifically, the constant 1 is added to the degree of bias adjustment to obtain the bias adjustment weight. The adaptive bias term of any dimension data is obtained by multiplying the bias term of the target data with the bias adjustment weight.

[0097] In one implementation, taking the i-th dimension of the hidden state data vector as an example, the formula for calculating the adaptive bias term of the i-th dimension data is:

[0098] b f (i,t)=b f (i,t-1)×(1+δ i )

[0099] Among them, b f (i,t) represents the adaptive bias term for the i-th dimension of the hidden state data vector at the current sampling time; b f (ii,t-1) represents the bias term of the target data (i.e., the bias term of the i-th dimension of the hidden state data vector from the previous sampling time); δ i Adjust the bias term of the i-th dimension data to a certain degree.

[0100] It should be noted that the greater the degree of adjustment of the bias term of the i-th dimension data, the more the bias term of the i-th dimension data at the current sampling time needs to be adjusted, and the larger the adaptive bias term of the i-th dimension data of the hidden state data vector at the current sampling time will be.

[0101] Thus, we have obtained the adaptive bias term for the i-th dimension of the hidden state data vector at the current sampling time. Similarly, we obtain the adaptive bias term for each dimension of the hidden state data vector at the current sampling time.

[0102] Step S105: Using the adaptive bias term of each dimension of the hidden state data vector, the bias term in the LSTM model is replaced to obtain the result of predicting the multidimensional data vector of the next sampling time at the current sampling time.

[0103] Furthermore, the adaptive bias terms of each dimension of the hidden state data vector at the current sampling time are used to replace the bias terms in the LSTM model, thereby optimizing the model parameters of the LSTM model and obtaining the optimized LSTM model, which is the LSTM model at the current sampling time. Then, the multidimensional data vector sequence at the current sampling time is used as the input of the LSTM model at the current sampling time. Based on the combined action of the input and output gates of the LSTM model at the current sampling time, the prediction result of the multidimensional data vector at the next sampling time is finally generated. Then, based on the prediction result, the peak and valley demand of electricity, heat or gas in the future are estimated, providing a decision-making basis for grid dispatch, distributed energy dispatch and energy storage system charging and discharging strategies, thereby realizing precise and efficient management of smart energy in the city.

[0104] The main objective of this invention is to adaptively adjust the bias term in the forget gate of LSTM to obtain accurate prediction results. Obtaining prediction results based on the LSTM model is existing technology and will not be elaborated here.

[0105] In summary, this embodiment of the invention obtains multi-dimensional data vectors of smart energy in the city at each sampling time, resulting in a multi-dimensional data vector sequence for the current sampling time; it obtains the LSTM model corresponding to the previous sampling time, uses the multi-dimensional data vector sequence as input to the LSTM model, and obtains the hidden state data vector and multi-dimensional activation vector for the current sampling time; based on the data differences between the data of each dimension in the multi-dimensional activation vector, it obtains the memory tendency degree for the current sampling time; for any dimension of data in the hidden state data vector, it extracts data belonging to the same dimension as the data of that dimension from the hidden state data vector at each sampling time. The target time series data is composed, and the bias term adjustment factor of any dimension data is obtained based on the trend and periodic changes of the target time series data. In the hidden state data vector of the previous sampling time, data belonging to the same dimension as the data of any dimension is obtained and denoted as target data. The bias term of the target data is adjusted according to the memory tendency degree and the bias term adjustment factor to obtain the adaptive bias term of the data of any dimension. The adaptive bias term of each dimension data in the hidden state data vector is used to replace the bias term in the LSTM model to obtain the prediction result of the multidimensional data vector of the next sampling time for the current sampling time. Specifically, by acquiring the memory tendency at the current sampling time, the degree to which the multi-dimensional activation vector needs to be remembered at the current sampling time (i.e., its importance to subsequent predictions) is reflected. Then, by analyzing the trend and periodic changes of the target time series data, the bias term adjustment factor of any dimension of the data is obtained to improve the accuracy of the adjustment. Finally, by using the memory tendency and the bias term adjustment factor, the bias term of the target data is adjusted, thereby predicting the multi-dimensional data vector of the next sampling time from the current sampling time. This effectively improves the accuracy of smart energy load prediction in the city, and thus optimizes subsequent multi-energy coordinated scheduling and strategy formulation.

[0106] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A smart energy management method for cities based on a dual-carbon digital platform, characterized in that: The method includes: Obtain the multidimensional data vector of smart energy in the city at each sampling time to obtain the multidimensional data vector sequence at the current sampling time; Obtain the LSTM model corresponding to the previous sampling time at the current sampling time, use the multidimensional data vector sequence as the input of the LSTM model to obtain the hidden state data vector and multidimensional activation vector at the current sampling time, and obtain the memory tendency degree at the current sampling time based on the data differences between the data of each dimension in the multidimensional activation vector. For any dimension of the hidden state data vector, data belonging to the same dimension as the data in each sampling time are obtained from the hidden state data vector to form target time series data. Based on the trend and periodic changes of the target time series data, the bias term adjustment factor of the data in any dimension is obtained. In the hidden state data vector of the previous sampling time, data belonging to the same dimension as the data of any dimension is obtained and denoted as target data. The bias term of the target data is adjusted according to the memory tendency degree and the bias term adjustment factor to obtain the adaptive bias term of the data of any dimension. By using the adaptive bias term of each dimension of the hidden state data vector, the bias term in the LSTM model is replaced to obtain the prediction result of the multidimensional data vector of the next sampling time for the current sampling time; Based on the data differences between the dimensions of the multidimensional activation vector, the memory tendency at the current sampling time is obtained, including: The absolute values ​​of the data in all dimensions of the multidimensional activation vector are summed to obtain the total dimension data. For any dimension of the multidimensional activation vector, the ratio between the absolute value of the data in that dimension and the total dimension data is obtained. The product of the ratio and the data in that dimension is calculated to obtain the forgetting influence factor of that dimension. Obtain the mean of data in all dimensions of the multidimensional activation vector, denoted as the feature mean; obtain the difference between the data in any dimension and the feature mean to obtain the deviation direction value; obtain the absolute value of the difference between the data in any dimension and the feature mean to obtain the degree of deviation; obtain the product of the deviation direction value and the degree of deviation to obtain the memory tendency factor of any dimension. Obtain the forgetting influence factors of all dimensions in the multidimensional activation vector, and obtain the cumulative value of the forgetting influence factors. Perform hyperbolic tangent processing on the cumulative value of the forgetting influence factors to obtain the first memory level. Obtain the memory tendency factor of all dimensions in the multidimensional activation vector, and obtain the cumulative value of the memory tendency factor. Perform hyperbolic tangent processing on the cumulative value of the memory tendency factor to obtain the second memory degree. The memory tendency at the current sampling time is obtained by averaging the first memory level and the second memory level. Based on the trend and periodic changes of the target time series data, the bias term adjustment factor of any dimension of the data is obtained, including: The target time series data is subjected to first-order difference processing to obtain a corresponding first-order difference data sequence. Based on the trend change of the first-order difference data in the first-order difference data sequence, the trend change index of any dimension data is obtained. Obtain the maximum value in the target time series data, and obtain the periodic change index of the data in any dimension based on the numerical difference between the maximum values ​​in the target time series data and the difference in sampling time. Obtain the variance of the target time series data, perform hyperbolic tangent processing on the variance of the target time series data to obtain the disorder level of the target time series data, obtain the maximum value between the trend change index and the period change index, and obtain the bias term adjustment factor of the data in any dimension based on the difference between the maximum value and the disorder level.

2. The urban smart energy management method based on a dual-carbon digital platform according to claim 1, characterized in that, The step of obtaining the trend change index of any dimension of data based on the trend change of the first-order difference data in the first-order difference data sequence includes: The average value of the first-order difference data sequence is obtained and denoted as the difference mean. The absolute value of the difference between each first-order difference data in the first-order difference data sequence and the difference mean is accumulated to obtain the accumulated absolute value of the difference. The opposite of the accumulated absolute value of the difference is substituted into an exponential function with the natural constant as the base to obtain the trend change index of the data in any dimension.

3. The urban smart energy management method based on a dual-carbon digital platform according to claim 1, characterized in that, The step of obtaining the periodic change index of any dimension of data based on the numerical difference between the maxima and the sampling time difference in the target time series data includes: The absolute values ​​of the differences between any two adjacent maxima in the target time series data are accumulated to obtain the accumulated maximum difference value. The negative of the accumulated maximum difference value is substituted into an exponential function with the natural constant as the base to obtain the first periodic feature value of the data in any dimension. The sampling times of the maximum value in the target time series data are formed into a sampling time data sequence. The sampling time data sequence is subjected to second-order difference processing to obtain a corresponding second-order difference data sequence. The second-order difference data in the second-order difference data sequence are accumulated to obtain the interval time difference accumulation value. The negative number of the interval time difference accumulation value is put into an exponential function with the natural constant as the base to obtain the second periodic feature value of the data in any dimension. The periodic change index of any dimension of data is obtained by averaging the first periodic feature value and the second periodic feature value.

4. The urban smart energy management method based on a dual-carbon digital platform according to claim 1, characterized in that, The step of adjusting the bias term of the target data according to the memory tendency degree and the bias term adjustment factor to obtain the adaptive bias term of the data in any dimension includes: The weighted summation of the memory tendency degree and the bias term adjustment factor yields the bias term adjustment degree for any dimension of the data. Based on the degree of bias term adjustment, the bias term of the target data is adjusted to obtain the adaptive bias term of the data in any dimension.

5. The urban smart energy management method based on a dual-carbon digital platform according to claim 4, characterized in that, The step of adjusting the bias term of the target data according to the degree of bias term adjustment to obtain the adaptive bias term of the data in any dimension includes: The constant 1 is added to the degree of bias adjustment to obtain the bias adjustment weight. The adaptive bias term of any dimension data is obtained by multiplying the bias term of the target data with the bias adjustment weight.

Citation Information

Patent Citations

  • Smart city optimization management method and system based on multi-source data fusion

    CN115861011A

  • Computerized-method and system for predicting a probability of fraudulent financial-account access

    US11900385B1