Dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scene
Patent Information
- Application Number
- CN202611028077.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]本申请旨在解决交通场景下多类型能耗行为差异显著导致单一模型难以兼顾、多源驱动因子融合建模困难、能耗序列多尺度特性难以同时刻画,从而导致交通场景能耗预测的效果较差的问题;本申请提供一种交通场景下基于残差多尺度LSTM的动态能耗预测方法,能够融合多源异构数据、兼顾多尺度时序特征并实现交通节点能耗精准预测
[0004]本申请旨在解决交通场景下多类型能耗行为差异显著导致单一模型难以兼顾、多源驱动因子融合建模困难、能耗序列多尺度特性难以同时刻画,从而导致交通场景能耗预测的效果较差的问题;本申请提供一种交通场景下基于残差多尺度LSTM的动态能耗预测方法,能够融合多源异构数据、兼顾多尺度时序特征并实现交通节点能耗精准预测。
Smart Images

Figure CN122886858A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of energy consumption prediction technology in traffic scenarios, specifically to a dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios. Background Technology
[0002] Energy consumption forecasting in traffic scenarios is a crucial aspect of energy management. Taking highway service areas as an example, their electricity consumption is characterized by strong diversity, complex driving factors, and significant differences in sub-energy consumption behaviors. On the one hand, traditional energy consumption such as lighting, air conditioning, and office work is driven by multiple factors including time patterns, weather conditions, and population density. On the other hand, the large-scale access of charging piles has made charging energy consumption a new source of uncertainty. The peak energy consumption at traffic nodes may surge sharply in a short period due to the concentration of through traffic, or drop significantly due to low traffic volume at night, exhibiting significant time variability and non-stationarity.
[0003] In related technologies, traditional short-term energy consumption forecasting methods mainly include time series analysis models (such as Autoregressive Moving Average (ARIMA) and Exponential Smoothing) and statistical regression models (such as Support Vector Regression (SVR) and Random Forest (RF). These methods are computationally efficient but have limited ability to capture nonlinear relationships. Deep learning-based methods, such as Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs), have achieved good results in power consumption forecasting. However, these methods still have the following shortcomings in energy consumption forecasting under complex traffic scenarios: First, the behavior of various types of energy consumption differs significantly, and a single model strategy cannot take all forecasting objectives into account; second, the fusion modeling of multiple driving factors (weather, traffic flow, holidays, charging pile operation records, etc.) is difficult; third, energy consumption sequences simultaneously exhibit minute-level short-term fluctuations, hour-level intraday patterns, and daily periodicity, and a single time-scale model cannot simultaneously characterize these multi-level patterns. Summary of the Invention
[0004] This application aims to address the problems of poor energy consumption prediction in traffic scenarios, such as the significant differences in energy consumption behaviors of various types, the difficulty of using a single model to take into account the differences, the difficulty of modeling the fusion of multiple driving factors, and the difficulty of simultaneously characterizing the multi-scale characteristics of energy consumption sequences. This application provides a dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios, which can integrate multi-source heterogeneous data, take into account multi-scale time series characteristics, and achieve accurate prediction of energy consumption at traffic nodes.
[0005] To achieve the above objectives, this application provides the following technical solution: In a first aspect, embodiments of this application provide a dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios, the method comprising: Acquire multi-source historical data of traffic scenarios; among which, multi-source historical data includes at least one of the following: electricity meter reading data, holiday calendar data, traffic flow data, charging pile operation record data, and weather data; Data processing is performed on multi-source historical data to obtain processed data; Multi-level features are determined based on the processed data; among them, multi-level features include at least one of time features, calendar features, weather features, traffic flow features, energy consumption history features, charging behavior features, and multi-source cross features; The total energy consumption prediction value of the traffic scenario in the future time period is determined based on the trained residual multi-scale LSTM model and multi-level features. The predicted proportion of sub-energy consumption is determined based on the trained graph neural network and multi-level features; wherein, sub-energy consumption includes at least one of lighting energy consumption, air conditioning energy consumption, office energy consumption and charging pile energy consumption. The predicted values for sub-energy consumption are determined based on the total energy consumption prediction value and the prediction ratio. The total energy consumption forecast and the sub-energy consumption forecast are determined as the energy consumption forecast results for the traffic scenario in the future time period.
[0006] In some embodiments of this application, the trained residual multiscale LSTM model includes an enhanced feature attention layer, a short-term LSTM branch, a medium-term LSTM branch, a long-term LSTM branch, and a fully connected fusion layer. Based on the trained residual multi-scale LSTM model and multi-level features, the total energy consumption prediction value of the traffic scene in future time periods is determined, including: The adaptive weights of each feature in the multi-level features are determined by enhancing the feature attention layer, and the multi-level features are weighted according to the adaptive weights to obtain weighted features. The first temporal feature is obtained by extracting the sequence of the weighted features within a first preset time period through a short-term LSTM branch. The second temporal feature is obtained by extracting the sequence within a second preset duration from the weighted features through the intermediate LSTM branch; wherein the second preset duration is longer than the first preset duration. The third temporal feature is obtained by extracting the complete sequence of weighted features through a long-term LSTM branch; The first, second, and third temporal features are concatenated and fused through a fully connected fusion layer to obtain multi-scale features. Energy consumption prediction values are determined based on multi-scale characteristics.
[0007] In some embodiments of this application, the trained residual multiscale LSTM model further includes a first residual connection layer, a multi-head temporal attention layer, a global average pooling layer, a second residual connection layer, and a first fully connected layer. Determining energy consumption predictions based on multi-scale features includes: The first residual connection layer adds the result of the weighted feature after linear projection at the last time step to the multi-scale feature to obtain the first fused feature. The first fused feature is processed by scaling dot product attention through a multi-head temporal attention layer to obtain the attention weights for each historical moment. The first fusion feature is weighted and aggregated according to the attention weight to obtain the temporal attention feature; The temporal attention features are averaged in the temporal dimension by a global average pooling layer to obtain pooled features. The second fused feature is obtained by adding the result of linear projection of the first fused feature to the pooling feature through the second residual connection layer. The total energy consumption prediction value is obtained by mapping the second fused feature through the first fully connected layer.
[0008] In some embodiments of this application, the trained graph neural network includes a projection layer, a dynamic graph structure learning module, a message passing layer, and a second fully connected layer. The predicted proportion of sub-energy consumption is determined based on the trained graph neural network and multi-level features, including: The multi-level features are projected onto each sub-energy consumption node through the projection layer to obtain the initial features of the sub-energy consumption node. The dynamic adjacency matrix between each sub-energy consumption node is determined by the dynamic graph structure learning module and the context features of the current time step; wherein, the context features include at least one of time information, weekday information, holiday type information, temperature range information, and traffic flow level information. Through a message passing layer and a dynamic adjacency matrix, the initial features of the sub-energy consumption nodes are passed through multiple rounds of message passing to obtain the updated features of the sub-energy consumption nodes. The prediction score of the sub-energy consumption node is determined by the update features of the second fully connected layer and the sub-energy consumption node. The predicted scores of sub-energy consumption nodes are normalized to obtain the predicted proportion of sub-energy consumption.
[0009] In some embodiments of this application, the dynamic adjacency matrix between each sub-energy consumption node is determined through a dynamic graph structure learning module and the context features of the current time step, including: The learnable embedding vectors of each sub-energy consumption node are obtained through the dynamic graph structure learning module. The context features are encoded by the context encoder in the dynamic graph structure learning module to obtain the context vector; The transformation matrix for the current time step is determined based on the context vector; Based on the learnable embedding vectors and transformation matrices, the correlation strength scores between each sub-energy consumption node are determined. The association strength score is normalized to obtain the dynamic adjacency matrix.
[0010] In some embodiments of this application, time features are used to characterize time and the division of operating periods; Calendar features are used to characterize the impact of date type and pre- and post-holiday effects on energy consumption; Weather characteristics are used to characterize the driving effects of temperature, humidity, precipitation, and sunlight on energy consumption; Traffic flow characteristics are used to characterize the impact of traffic volume, its changing trend, and the balance between inbound and outbound traffic on energy consumption. Historical energy consumption characteristics are used to characterize the inertia and periodic changes in energy consumption and the daily electricity consumption progress. Charging behavior characteristics are used to characterize charging load intensity, user charging patterns, and equipment utilization. Multi-source crossover features are used to characterize the impact of synergistic or competitive effects between different driving factors on energy consumption.
[0011] In some embodiments of this application, the method further includes: Acquire historical training data; the historical training data includes historical multi-source data and corresponding historical total energy consumption labels and each sub-energy consumption label; Construct historical multi-level features based on historical multi-source data; By inputting historical multi-level features into the residual multi-scale LSTM model to be trained, the predicted total energy consumption value is obtained. By inputting historical multi-level features into the graph neural network to be trained, the predicted proportions of each sub-energy consumption are obtained. Total energy loss is determined based on the difference between the predicted total energy consumption value and the historical total energy consumption label; The sub-energy consumption ratio loss is determined based on the difference between the predicted ratio of each sub-energy consumption and the sub-energy consumption label. Based on the weighted sum of total energy loss and sub-energy loss ratio, update the parameters of the residual multi-scale LSTM model and the graph neural network to be trained until the convergence condition is met, thus obtaining the trained residual multi-scale LSTM model and the trained graph neural network.
[0012] In some embodiments of this application, multi-source historical data is processed to obtain processed data, including: Based on the time range of electricity meter data, holiday calendar data, traffic flow data, charging pile operation record data and weather data are unified to a preset time granularity to obtain the first processed data; Electricity meter data is categorized into four energy consumption categories: lighting energy consumption, air conditioning energy consumption, office energy consumption, and charging pile energy consumption. The total energy consumption is obtained by linearly superimposing the four energy consumption components. The processed data is determined based on the first processed data, the four types of energy consumption components, and the total energy consumption.
[0013] Secondly, embodiments of this application provide an electronic device, including a processor and a memory storing processor-executable instructions; when the instructions are executed by the processor, the dynamic energy consumption prediction method based on residual multi-scale LSTM in the above-mentioned traffic scenario is implemented.
[0014] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the dynamic energy consumption prediction method based on residual multi-scale LSTM in the above-mentioned traffic scenario. Attached Figure Description
[0015] To more intuitively illustrate the prior art and this application, several exemplary figures are provided below. It should be understood that the specific shapes and structures shown in the figures should not generally be regarded as limiting conditions for implementing this application; for example, based on the technical concept disclosed in this application and the exemplary figures, those skilled in the art are able to easily make conventional adjustments or further optimizations to the addition / reduction / classification, specific shapes, positional relationships, connection methods, size ratios, etc. of certain units (components).
[0016] Figure 1 A schematic diagram illustrating the implementation process of the dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios provided in this application embodiment; Figure 2 A schematic diagram of the overall architecture of the dynamic energy consumption prediction method based on residual multi-scale LSTM provided in the embodiments of this application; Figure 3 Schematic diagram of experimental results provided for embodiments of this application Figure 1 ; Figure 4 Schematic diagram of experimental results provided for embodiments of this application Figure 2 ; Figure 5 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application.
[0017] Figure label: Electronic device 1, processor 11, memory 12, communication interface 13, bus 14. Detailed Implementation
[0018] 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. Any combination of different embodiments is possible.
[0019] In the description of this application: unless otherwise stated, "a plurality of" means two or more. The terms "first," "second," "third," etc., in this application are intended to distinguish the objects referred to and do not have any special meaning in terms of technical connotation (e.g., they should not be construed as an emphasis on importance or order). Expressions such as "including," "comprising," and "having" also mean "not limited to" (certain units, components, materials, steps, etc.).
[0020] With the deepening of the "dual carbon" goals and the continuous growth of new energy vehicle ownership, the energy consumption structure of transportation infrastructure is undergoing profound changes. Transportation hubs, exemplified by highway service areas, exhibit diverse characteristics in their electricity consumption, including complex driving factors and significant differences in sub-energy consumption behaviors. On the one hand, traditional energy consumption such as lighting, air conditioning, and office work is driven by multiple factors including time patterns, weather conditions, and population density. On the other hand, the large-scale deployment of charging piles has made charging energy consumption a new source of uncertainty. The peak energy consumption at transportation hubs may surge rapidly in a short period due to the concentration of through traffic, or drop sharply due to low traffic volume at night, exhibiting significant time-varying and non-stationary characteristics. This problem is prevalent in typical transportation scenarios such as service areas, urban charging stations, and bus depots.
[0021] Accurate short-term energy consumption forecasting is a key support for the refined scheduling of energy management systems (EMS) at transportation nodes. Effective forecasts can be used to: (1) optimize the charging and discharging strategies of energy storage systems and reduce peak electricity price costs; (2) guide the orderly charging management of charging stations to avoid grid overload; and (3) provide feedforward scheduling basis for renewable energy consumption. However, transportation energy consumption forecasting, represented by service areas, faces the following core challenges: First, the behavioral differences among various energy consumption types are significant. Taking service areas as an example, lighting energy consumption is dominated by illumination and operating hours, air conditioning energy consumption is highly dependent on temperature and humidity, office energy consumption mainly varies with calendar and shift schedules, while charging energy consumption is closely related to traffic flow, user behavior, and the penetration rate of new energy vehicles. The different sensitivities of each sub-energy consumption to features make it difficult for a single model strategy to take all objectives into account. This complex energy consumption structure with multiple energy consumptions coexisting also appears in other transportation scenarios such as urban charging stations, bus depots, and highways.
[0022] Second, the fusion modeling of multiple driving factors is quite challenging. The influencing factors of traffic energy consumption involve multiple heterogeneous data sources, such as meteorological data, traffic flow data, holiday calendars, and charging pile operation records. These different data sources differ in terms of time resolution, sampling frequency, and missing rate, which places high demands on data alignment and feature fusion.
[0023] Third, the multi-scale characteristics of time series modeling. Energy consumption sequences simultaneously exhibit short-term fluctuations at the minute level (such as charging pile connection / disconnection), intraday patterns at the hour level (such as morning, noon and evening peak hours), and periodicity at the day level (such as differences between weekdays and weekends). LSTM at a single time scale is difficult to simultaneously characterize these multi-level patterns.
[0024] To address the aforementioned issues, this application proposes a Residual Multi-Scale LSTM (RM-LSTM) hierarchical prediction framework. Specifically, this framework includes: a multi-scale temporal modeling mechanism: a multi-scale module consisting of three parallel LSTM branches representing 6-hour, 24-hour, and complete sequences is designed. Through feature concatenation and fusion layers, collaborative representation at different time granularities is achieved, effectively covering the short-term fluctuations and long-term cyclical characteristics of traffic energy consumption. A deep architecture with residual enhancement: residual connections are introduced to directly add the input projection to the LSTM output. Combined with the residual superposition mechanism of multi-head temporal attention, this improves the gradient flow and expressive power of the model, alleviating the gradient vanishing problem in long sequence training. Feature attention driven by multi-source correlation: an enhanced feature attention (EFA) mechanism is proposed, fusing Pearson linear correlation, Spearman rank correlation, and mutual information metrics. Adaptive weights are assigned to feature dimensions in a learnable weighting manner, explicitly modeling nonlinear feature correlations. A seven-level traffic scenario feature system: A systematic feature engineering framework was designed for traffic energy consumption scenarios, encompassing time period encoding, calendar effects, meteorological derivative indicators, traffic flow aggregation, historical energy consumption statistics, charging behavior structural features, and multi-source cross-features. This system uses service areas as a typical design blueprint and can be transferred to other traffic node energy consumption prediction tasks. Hierarchical prediction strategy: A hierarchical structure of "total energy consumption prediction + sub-energy consumption ratio prediction" is adopted. First, total energy consumption is predicted, and then the energy consumption of lighting, air conditioning, office space, and charging piles is inferred through the proportion of each sub-energy consumption, balancing prediction accuracy and physical consistency constraints. Dynamic graph structure learning mechanism: A data-driven dynamic graph structure learning method is proposed, which does not rely on any prior topological knowledge and directly learns the dynamic relationships between nodes of each energy consumption subclass adaptively from historical time-series data. This mechanism generates a dynamic adjacency matrix that evolves in real time with external conditions (such as time, holidays, and temperature ranges) through a time-step dependent transformation matrix, and is jointly trained with a graph neural network (GNN) to achieve end-to-end collaborative optimization of graph topology and model parameters.
[0025] This application provides a dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios, such as... Figure 1 As shown, the dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios can include the following steps: Step 101: Obtain multi-source historical data of traffic scenarios; wherein, the multi-source historical data includes at least one of the following: electricity meter reading data, holiday calendar data, traffic flow data, charging pile operation record data, and weather data.
[0026] In the embodiments of this application, the electronic device can acquire multi-source historical data of traffic scenarios; wherein, the multi-source historical data includes at least one of electricity meter reading data, holiday calendar data, traffic flow data, charging pile operation record data, and weather data.
[0027] In the embodiments of this application, the specific scenarios of the traffic scenario are not limited. For example, the traffic scenario can be a traffic infrastructure energy consumption scenario represented by highway service areas, urban charging stations, bus stations, etc., which has the characteristics of strong diversity, complex driving factors, and significant differences in sub-energy consumption behavior.
[0028] In the embodiments of this application, multi-source historical data refers to historical records collected from multiple heterogeneous data sources, including electricity metering data (three-phase active power of each device), holiday calendar data (date type mapping), traffic flow data (vehicle flow entering and leaving the station), charging pile operation record data (charging session information), and weather data (temperature, humidity, precipitation, light intensity, etc.).
[0029] In some embodiments of this application, the electricity metering data is derived from the three-phase active power records of various devices in the traffic scenario (such as high-mast lights, ground source heat pumps, supermarkets, canteens, etc.), with a sampling frequency of, for example, 5 minutes. The holiday calendar data provides a date-status (weekday / holiday / workday adjustment) mapping with a resolution of days.
[0030] In some embodiments of this application, traffic flow data includes time-sharing statistics of total passing traffic and the number of vehicles entering and exiting the station, with a resolution of 15 minutes. Charging pile operation record data provides fields such as the start time, end time, charging amount (kWh), charging duration, and license plate number of the charging session, with a session-level resolution. Weather data includes temperature, humidity, wind speed, precipitation, and light intensity, with a raw resolution of 1 hour.
[0031] Step 102: Process the multi-source historical data to obtain the processed data.
[0032] In the embodiments of this application, the electronic device can acquire multi-source historical data of traffic scenarios, process the multi-source historical data, and obtain processed data.
[0033] In some embodiments of this application, when an electronic device processes multi-source historical data to obtain processed data, it can use the time range of the electricity meter readings as a benchmark to unify holiday calendar data, traffic flow data, charging pile operation record data, and weather data to a preset time granularity to obtain first processed data; classify the electricity meter readings into lighting energy consumption, air conditioning energy consumption, office energy consumption, and charging pile energy consumption to obtain four types of energy consumption components; linearly superimpose the four types of energy consumption components to obtain total energy consumption; and determine the processed data based on the first processed data, the four types of energy consumption components, and the total energy consumption.
[0034] In the embodiments of this application, the specific value of the preset time granularity is not limited, for example, it can be 15 minutes. When determining the first data to be processed, heterogeneous data sources with different time resolutions (such as electricity meters approximately 5 minutes, traffic flow 15 minutes, and weather 1 hour) can be unified to the same preset time granularity (such as 15 minutes) through resampling and nearest neighbor alignment, so that each data source can correspond one-to-one on the time axis.
[0035] For example, the electricity meter collects data in real time, without a fixed 15-minute rhythm, but samples approximately every 5 minutes. The time points may be 08:03, 08:08, 08:11, etc. However, the model requires the input to be a time series with a fixed 15-minute interval (preset time granularity). Therefore, it is necessary to "align" the data at irregular time points to the fixed 15-minute axis. Taking the 15-minute window of 08:00 to 08:15 as an example, assuming the original sampling points are 08:03 (10.2kW), 08:08 (10.5kW), 08:11 (10.3kW), and 08:14 (10.4kW), the average value of these four points (10.35kW) is taken as the power value at 08:15 by resampling the mean. For lighting equipment, such as the high-mast lights in the east area, the high-mast lights in the west area, and the high-mast lights in the square, each can be resampled and then added together to obtain the total power of the lighting equipment in the entire service area (traffic scene) at 08:15.
[0036] In the embodiments of this application, the energy consumption of the charging pile is obtained by allocating the charging pile operation record through time slots to ensure alignment with the electricity meter time index.
[0037] For example, the total power of a charging session can be distributed proportionally to the various 15-minute slots (time slots) it spans.
[0038] Step 103: Determine multi-level features based on the processed data; wherein, the multi-level features include at least one of time features, calendar features, weather features, traffic flow features, energy consumption history features, charging behavior features, and multi-source cross features.
[0039] In the embodiments of this application, the electronic device can perform data processing on multi-source historical data to obtain processed data, and then determine multi-level features based on the processed data; wherein, the multi-level features include at least one of time features, calendar features, weather features, traffic flow features, energy consumption history features, charging behavior features, and multi-source cross features.
[0040] In some embodiments of this application, time features are used to characterize time and the division of operating periods; calendar features are used to characterize the impact of date type and pre- and post-holiday effects on energy consumption; weather features are used to characterize the driving effects of temperature, humidity, precipitation, and sunlight on energy consumption; traffic flow features are used to characterize the impact of traffic volume, changing trends, and the balance of entry and exit from stations on energy consumption; historical energy consumption features are used to characterize the inertia, periodic changes in energy consumption, and intraday electricity consumption progress; charging behavior features are used to characterize charging load intensity, user charging patterns, and equipment utilization; and multi-source cross features are used to characterize the impact of the synergistic or competitive effects between different driving factors on energy consumption.
[0041] In some embodiments of this application, the time features may include periodic features, binary time period labels, and peak operation indicator variables; wherein, the periodic features are obtained by performing sine and cosine encoding on the time information in the processed data; the time information includes hours, intraday time slots, weekdays, and months; the binary time period labels include late night, breakfast, morning, lunch, afternoon, dinner, and night; the peak operation indicator variables are used to indicate whether it is in the three peak periods of morning, noon, and evening when there is a high density of people.
[0042] In some embodiments of this application, the calendar features may include a day type indicator variable, a season indicator variable, a pre-holiday effect indicator variable, and a post-holiday effect indicator variable; wherein, the day type indicator variable is used to indicate that the current date is one of a weekday, weekend, public holiday, or a workday adjusted by a work schedule; the season indicator variable is used to indicate the current season; the pre-holiday effect indicator variable is used to indicate whether the current date is the day before a statutory holiday; and the post-holiday effect indicator variable is used to indicate whether the current date is the day after a statutory holiday.
[0043] In some embodiments of this application, weather characteristics may include cooling degree day, heating degree day, perceived temperature, heat index, wind chill index, temperature deviation, quadratic term of temperature deviation, normalized value of natural light, logarithmic transformation value of precipitation intensity, first cumulative precipitation, second cumulative precipitation, first temperature change rate, and second temperature change rate; wherein, cooling degree day is a positive deviation where the temperature exceeds a first preset temperature threshold (e.g., 26°C); heating degree day is a negative deviation where the temperature is below a second preset temperature threshold (e.g., 18°C); temperature deviation is used to measure the difference between the current temperature and the temperature of the same period in history; quadratic term of temperature deviation is used to capture the nonlinear relationship between air conditioning energy consumption and temperature; first cumulative precipitation is the cumulative precipitation within a first preset duration (e.g., 1 hour); second cumulative precipitation is the cumulative precipitation within a second preset duration (e.g., 6 hours); first temperature change rate is the temperature change rate within a first preset duration (e.g., 1 hour); second temperature change rate is the temperature change rate within a second preset duration (e.g., 3 hours).
[0044] In some embodiments of this application, traffic flow characteristics may include a first moving average of traffic flow, a second moving average of traffic flow, traffic flow change, traffic flow change acceleration, inbound / outbound ratio, net flow, estimated number of stationary vehicles, and a traffic flow anomaly index; wherein, the first moving average of traffic flow is the moving average of traffic flow within a first preset time period (e.g., 1 hour); the second moving average of traffic flow is the moving average of traffic flow within a second preset time period (e.g., 3 hours); the inbound / outbound ratio is the ratio of the number of vehicles entering the station to the number of vehicles exiting the station; the net flow is the difference between the number of vehicles entering the station and the number of vehicles exiting the station; the estimated number of stationary vehicles is determined based on the cumulative net inflow within a preset time window (e.g., 2 hours); and the traffic flow anomaly index is the ratio of the current flow to the historical average for the same period.
[0045] In some embodiments of this application, the energy consumption history characteristics may include total energy consumption lag characteristics, total energy consumption rolling statistical characteristics, intraday cumulative energy consumption, energy consumption change rate, sub-energy consumption lag characteristics, and sub-energy consumption rolling statistical characteristics; wherein, the total energy consumption lag characteristics include lag energy consumption values of multiple preset step sizes (e.g., 1 step, 2 steps, 4 steps, 8 steps, 12 steps, 24 steps, 96 steps, 672 steps) to provide energy consumption inertia signals; the total energy consumption rolling statistical characteristics include the mean, standard deviation, and maximum value of energy consumption data within multiple preset time windows (e.g., 1 hour to 24 hours); intraday cumulative energy consumption is used to reflect the daily electricity consumption progress; the energy consumption change rate is used to capture signals of abrupt changes in energy consumption; the sub-energy consumption lag characteristics include sub-energy consumption values with daily cycle lag (e.g., 96 steps) and weekly cycle lag (e.g., 672 steps); the sub-energy consumption rolling statistical characteristics include the mean of sub-energy consumption data within a preset time window (e.g., 24 hours).
[0046] In some embodiments of this application, charging behavior characteristics may include the number of simultaneous charging sessions, the number of sessions at the start of a time period, the number of sessions at the end of a time period, the number of fast charging sessions, the number of slow charging sessions, the number of non-repeating users, the average power per session, the charging pile utilization rate, the historical charging power for the same period, the smoothed charging power, the standard deviation of charging power, the fast-slow charging ratio, the number of sessions per user, the cumulative charging amount, the power change rate, and the charging peak indicator variable; wherein, the number of fast charging sessions is the number of charging sessions with a charging duration of less than a third preset duration (e.g., 2 hours); the number of slow charging sessions is the number of charging sessions with a charging duration greater than or equal to the third preset duration; the historical charging power for the same period is the average historical charging power for the same period, calculated by week and hour; the smoothed charging power is used to characterize the trend signal of charging power; the fast-slow charging ratio is the ratio of the number of fast charging sessions to the number of slow charging sessions, used to indicate the charging behavior pattern; the number of sessions per user is the average number of charging sessions per user, used to reflect the user revisit rate; and the cumulative charging amount is the cumulative charging amount within the third preset duration (e.g., 3 hours).
[0047] In some embodiments of this application, the multi-source cross-features may include temperature and time period cross-features, traffic flow and charging session cross-features, operational status indicator variables, precipitation inhibition effect on charging behavior characteristics, and holidays and charging penetration rate cross-features; wherein, temperature and time period cross-features are used to characterize the cooling superposition effect in high-temperature ranges; traffic flow and charging session cross-features are used to quantify the charging demand generated per unit of traffic flow; operational status indicator variables are used to determine whether it is an operational period by combining calendar and time period; precipitation inhibition effect on charging behavior characteristics are used to characterize the inhibitory effect of precipitation on charging demand; and holidays and charging penetration rate cross-features are used to capture the amplification effect of charging demand under high traffic flow of electric vehicles during holidays.
[0048] In some embodiments of this application, the electronic device determines multi-level features based on the processed data, that is, it can perform corresponding calculations and statistics based on different types of data in the processed data to obtain the above seven types of features.
[0049] Step 104: Determine the total energy consumption prediction value of the traffic scenario in future time periods based on the trained residual multi-scale LSTM model and multi-level features.
[0050] In embodiments of this application, the electronic device can determine the total energy consumption prediction value of the traffic scenario in future time periods based on the trained residual multi-scale LSTM model and the multi-level features after determining the multi-level features according to the processed data.
[0051] In the embodiments of this application, the trained residual multiscale LSTM model refers to a neural network model trained on historical data for extracting temporal features and predicting total energy consumption.
[0052] In the embodiments of this application, the trained residual multi-scale LSTM model includes an enhanced feature attention layer, a short-term LSTM branch, a medium-term LSTM branch, a long-term LSTM branch, a first residual connection layer, a multi-head temporal attention layer, a global average pooling layer, a second residual connection layer, and a first fully connected layer.
[0053] In some embodiments of this application, when an electronic device determines the total energy consumption prediction value of a traffic scenario in a future time period based on a trained residual multi-scale LSTM model and multi-level features, it can determine the adaptive weights of each feature in the multi-level features by enhancing the feature attention layer, and weight the multi-level features according to the adaptive weights to obtain weighted features; extract the sequence of the weighted features within a first preset duration through a short-term LSTM branch to obtain a first temporal feature; extract the sequence of the weighted features within a second preset duration through a medium-term LSTM branch to obtain a second temporal feature; wherein the second preset duration is longer than the first preset duration; extract the complete sequence of the weighted features through a long-term LSTM branch to obtain a third temporal feature; and concatenate and fuse the first temporal feature, the second temporal feature, and the third temporal feature through a fully connected fusion layer to obtain multi-scale features; and determine the energy consumption prediction value based on the multi-scale features.
[0054] In some embodiments of this application, the number of hidden units u=64 for each branch of the short-term LSTM branch, the mid-term LSTM branch, and the long-term LSTM branch, and all branches have a Dropout ratio of 0.2. The outputs of the three branches are concatenated and then fused through a fully connected layer to obtain multi-scale features, which can be expressed as the following formula: (1); in, For multi-scale features, The output of the short-run LSTM branch, For the output of the intermediate LSTM branch, For the output of the long-term LSTM branch, This means concatenating the outputs of the short-term, medium-term, and long-term branches along the channel dimension; This represents the weight matrix of the fully connected fusion layer, which is used to perform linear transformations and dimension mappings on the concatenated features. This represents the bias vector of the fully connected fusion layer, which, together with the weight matrix, performs a linear transformation. This is the activation function.
[0055] In some embodiments of this application, the specific values of the first preset duration and the second preset duration are not limited in this application; the first preset duration can be 6 hours and the second preset duration can be 24 hours.
[0056] In the embodiments of this application, multi-scale features refer to high-dimensional feature representations obtained by splicing and fusing time-series features extracted from three parallel LSTM branches (short-term 6-hour, medium-term 24-hour, and long-term full sequence), which simultaneously include short-term fluctuations, intraday cycles, and cross-day trend information.
[0057] In the embodiments of this application, the enhanced feature attention layer is located at the front end of the trained residual multi-scale LSTM model. For the input multi-level features, this layer calculates the correlation measures (including Pearson correlation coefficient, Spearman rank correlation coefficient, and mutual information) between each feature and the prediction target. It then fuses these three correlation measures into a comprehensive correlation score using learnable fusion weights, and obtains the adaptive weights for each feature after Softmax normalization. These adaptive weights are then multiplied element-wise with the original features to obtain the weighted features. This operation makes the model focus more on high-value features and suppress irrelevant features.
[0058] For example, the composite relevance score can be expressed as the following formula: (2); in, This represents the overall relevance score of the i-th feature. This represents the Pearson correlation coefficient for the i-th feature. This represents the Spearman rank correlation coefficient of the i-th feature. Represents the mutual information of the i-th feature; , , For learnable fusion weights.
[0059] In some embodiments of this application, when an electronic device determines the predicted energy consumption based on multi-scale features, it can obtain a first fused feature by adding the result of linear projection of the last time step of the weighted features to the multi-scale features through a first residual connection layer; perform scaling dot product attention processing on the first fused feature through a multi-head temporal attention layer to obtain the attention weights for each historical moment; perform weighted aggregation on the first fused feature according to the attention weights to obtain temporal attention features; perform average pooling on the temporal attention features in the time dimension through a global average pooling layer to obtain pooled features; add the result of linear projection of the first fused feature to the pooled features through a second residual connection layer to obtain a second fused feature; and perform mapping processing on the second fused feature through a first fully connected layer to obtain the predicted total energy consumption.
[0060] In some embodiments of this application, the multi-head temporal attention layer employs a standard scaled dot product attention structure with a model dimension of 64, 4 attention heads, and each head having a dimension of 16. This layer generates a query matrix (Q), a key matrix (K), and a value matrix (V) through linear mapping, calculates the scaled dot product attention weights, and performs weighted aggregation on the value matrix based on these weights to obtain the temporal attention features. This operation allows the model to flexibly focus on the historical moment most informative for the current prediction in the temporal dimension.
[0061] For example, the characteristics of temporal attention can be expressed as the following formula: (3); in, For time attention features, , , These are the query matrix, key matrix, and value matrix obtained by projecting the first fusion feature through different linear mapping matrices, respectively. Scaling factor For attention weights.
[0062] In some embodiments of this application, the operation of the first residual connection layer can be expressed as the following formula: (4); (5); in, This represents the input sequence, i.e., the weighted features; This represents the feature at the last time step of the weighted feature calculation; This represents the linear projection weight matrix of the first residual connection layer; This represents the result after linear projection of the last time step of the weighted features. Representing multi-scale features, This represents the first fusion feature.
[0063] Furthermore, the operation for determining the second fusion feature can be expressed as the following formula: (6); (7); in, Indicates pooling characteristics; Indicates a global average pooling layer; This represents a multi-head temporal attention layer. This represents the first fusion feature.
[0064] In some embodiments of this application, the global average pooling layer performs average pooling on the temporal attention features along the temporal dimension to obtain pooled features of fixed length, thereby compressing the variable time series information into a fixed-dimensional vector.
[0065] In some embodiments of this application, a first fusion feature is obtained through a first residual connection layer, so that even if gradient degradation occurs in a deep LSTM, the input information can still be propagated to subsequent layers through shortcut connections; a second fusion feature is obtained through a second residual connection layer, which can further ensure gradient flow and information transmission.
[0066] In some embodiments of this application, the first fully connected layer includes a first sub-fully connected layer and a second sub-fully connected layer connected sequentially. The first sub-fully connected layer has an input dimension of 64 and an output dimension of 32, uses ReLU activation, and is followed by a dropout regularization with a ratio of 0.3. The second sub-fully connected layer is a linear output layer with an input dimension of 32 and an output dimension of 1, and is followed by a dropout regularization with a ratio of 0.2.
[0067] Step 105: Determine the predicted proportion of sub-energy consumption based on the trained graph neural network and multi-level features; wherein, sub-energy consumption includes at least one of lighting energy consumption, air conditioning energy consumption, office energy consumption and charging pile energy consumption.
[0068] In embodiments of this application, the electronic device can determine the predicted proportion of sub-energy consumption based on the trained graph neural network and the multi-level features after determining the multi-level features according to the processed data; wherein, the sub-energy consumption includes at least one of lighting energy consumption, air conditioning energy consumption, office energy consumption and charging pile energy consumption.
[0069] In some embodiments of this application, sub-energy consumption refers to the energy consumption components of various terminal electrical devices in a traffic scenario, which may include lighting energy consumption, air conditioning energy consumption, office energy consumption and charging pile energy consumption; wherein, "office energy consumption" can cover the regular operating electricity consumption of supermarkets, canteens, office areas, etc. in the traffic scenario, excluding lighting and air conditioning.
[0070] In the embodiments of this application, the trained graph neural network refers to a graph neural network model trained on historical data for jointly predicting the proportion of each sub-energy consumption. The trained graph neural network includes a projection layer, a dynamic graph structure learning module, a message passing layer, and a second fully connected layer.
[0071] In some embodiments of this application, when an electronic device determines the predicted proportion of sub-energy consumption based on a trained graph neural network and multi-level features, it can project the multi-level features to each sub-energy consumption node through a projection layer to obtain the initial features of the sub-energy consumption node; determine the dynamic adjacency matrix between each sub-energy consumption node through a dynamic graph structure learning module and the context features of the current time step; wherein, the context features include at least one of time information, weekday information, holiday type information, temperature range information, and traffic flow level information; perform multiple rounds of message passing on the initial features of the sub-energy consumption node through a message passing layer and the dynamic adjacency matrix to obtain the updated features of the sub-energy consumption node; determine the predicted score of the sub-energy consumption node through a second fully connected layer and the updated features of the sub-energy consumption node; and normalize the predicted score of the sub-energy consumption node to obtain the predicted proportion of sub-energy consumption.
[0072] In the embodiments of this application, the dynamic adjacency matrix is a matrix describing the correlation strength between each sub-energy-consuming node, and the matrix elements represent the degree of correlation between two nodes under the current context conditions. This matrix is generated in real time by the dynamic graph structure learning module based on the context features of the current time step (time, day of the week, holidays, temperature, traffic flow, etc.) and changes dynamically with the time step.
[0073] In the embodiments of this application, the initial feature dimension of the energy-consuming node is 64; the dynamic adjacency matrix can be a 4×4 square matrix, and the matrix elements represent the association strength between two nodes under the current context conditions.
[0074] In the embodiments of this application, the message passing layer performs 2 to 3 rounds of message passing on the graph structure defined by the dynamic adjacency matrix. In each round of message passing, each node (sub-energy consumption node) aggregates the features of its neighboring nodes and transforms and activates them through a learnable dynamic adjacency matrix to update its own node representation. After multiple rounds of message passing, the representations of each node incorporate the information of its neighboring nodes, reflecting the coupling relationship between sub-energy consumption nodes.
[0075] For example, each round of updates can be represented by the following formula: (8); in, This represents a node in the (l+1)th round of message passing. The updated feature representation; Represents a node The set of neighboring nodes; Represents a node The neighbor node index, This represents the neighbor nodes in the l-th round of message passing. Feature representation; This represents an aggregate function that stores nodes. Features of all neighboring nodes Aggregate into a single vector; The weight matrix represents the message passing in the l-th round; Represents the bias vector for the l-th round of message passing; This represents the ReLU activation function.
[0076] It should be noted that the adjacency matrix in this application is dynamically generated, rather than a predefined static graph. Specifically, the message passing layer uses a weighted summation method to aggregate neighbor features: for nodes... Its neighboring nodes The contribution is determined by the dynamic adjacency matrix. The corresponding weights Control. Node In the The update characteristics of the wheel are: (9); in, For dynamic adjacency matrix A defined set of neighboring nodes Let be the learnable weight matrix of the k-th layer (k-th round of message passing) GNN; Neighboring nodes in the k-th layer eigenvectors.
[0077] In the embodiments of this application, the update features of each sub-energy consumption node are input into the second fully connected layer and mapped to four scalar values, which serve as the prediction scores of the sub-energy consumption nodes of each sub-energy consumption node.
[0078] In the embodiments of this application, the prediction scores of the four sub-energy consumption nodes are subjected to Softmax normalization so that the sum of the prediction ratios of each sub-energy consumption node is 1.
[0079] In some embodiments of this application, when an electronic device determines the dynamic adjacency matrix between each sub-energy consumption node through a dynamic graph structure learning module and the context features of the current time step, it can obtain the learnable embedding vector of each sub-energy consumption node through the dynamic graph structure learning module; encode the context features through the context encoder in the dynamic graph structure learning module to obtain the context vector; determine the transformation matrix of the current time step based on the context vector; determine the association strength score between each sub-energy consumption node based on the learnable embedding vector and the transformation matrix; and normalize the association strength score to obtain the dynamic adjacency matrix.
[0080] In the embodiments of this application, the operation of determining the dynamic adjacency matrix between each sub-energy consumption node is completed by a dynamic graph structure learning module.
[0081] In the embodiments of this application, learnable embedding vectors are defined for four sub-energy consumption nodes: lighting, air conditioning, office, and charging piles, with an embedding dimension of 16. The embedding vectors of all nodes constitute an embedding matrix, which is optimized end-to-end during model training.
[0082] In the embodiments of this application, the context encoder is a two-layer fully connected network that encodes the context features of the current time step (including time, day of the week, holiday type, temperature range, traffic flow level, etc.) into a context vector with a dimension of 64.
[0083] In the embodiments of this application, the transformation matrix can be used to dynamically adjust the association strength between nodes.
[0084] In some embodiments of this application, the transformation matrix for determining the current time step based on the context vector can be expressed as the following formula: (10); in, Represents the context vector. This represents the mapping of the multilayer perceptron to the context vector, which is the context vector. A nonlinear transformation is performed using a multilayer perceptron, with an output dimension of... The square formation, This indicates a reshaping operation, which will... Output dimensional vector reshaping to The square formation, This represents the transformation matrix at the current time step. Indicates the dimension of the embedding vector.
[0085] Based on the learnable embedding vectors and transformation matrices, the correlation strength score between each sub-energy consumption node can be expressed as the following formula: (11); in, The embedding matrix is composed of the stacked learnable embedding vectors of each sub-energy consumption node. Each row in the vector corresponds to the embedding vector of a node; For the transpose of the embedding matrix, , is the correlation strength score matrix at the current time step.
[0086] The dynamic adjacency matrix can be expressed by the following formula: (12); in, Represents the correlation strength score matrix The ReLU activation function is applied, setting negative values to zero to filter out negative associations and retain only the strength of positive associations. This means performing Softmax normalization row by row on the ReLU-processed matrix so that the sum of the elements in each row is 1. , is the dynamic adjacency matrix at the current time step.
[0087] In some embodiments of this application, when determining the association strength score between each sub-energy consumption node based on the learnable embedding vector and the transformation matrix, the score can be obtained by calculating the inner product of the embedding vectors of every two sub-energy consumption nodes after mapping with the transformation matrix.
[0088] In some embodiments of this application, the association strength scores are Softmax normalized row by row so that the sum of each row is 1, forming a probabilistic dynamic adjacency matrix.
[0089] Step 106: Determine the predicted value of sub-energy consumption based on the predicted value of total energy consumption and the predicted ratio.
[0090] In embodiments of this application, the electronic device can determine the predicted value of sub-energy consumption based on the total energy consumption prediction value and the prediction ratio after determining the predicted ratio of sub-energy consumption based on the trained graph neural network and multi-level features.
[0091] In some embodiments of this application, the total energy consumption prediction value is multiplied by the prediction ratio of each sub-energy consumption to obtain the absolute power prediction value of each sub-energy consumption.
[0092] In some embodiments of this application, lighting energy consumption = total energy consumption × lighting ratio; air conditioning energy consumption = total energy consumption × air conditioning ratio; office energy consumption = total energy consumption × office ratio; charging pile energy consumption = total energy consumption × charging pile ratio. This operation ensures the physical consistency that the sum of each sub-energy consumption equals the total energy consumption.
[0093] For example, the predicted value of sub-energy consumption can be expressed as the following formula: (13); in, This represents the predicted total energy consumption at time t. This represents an energy consumption category index, which indicates a specific sub-category of energy consumption, with values ranging from lighting, air conditioning, office supplies, or charging stations. Represents the time t at time t. The predicted score of subclass energy consumption, output by the graph neural network, represents the relative size of the subclass energy consumption in the total energy consumption (raw score without normalization). This represents the traversal index of the sub-energy consumption category. Iterates through all sub-energy consumption categories (lighting, air conditioning, office, charging pile) for summation. This represents the sum of the predicted scores for all sub-energy consumptions at time t; This indicates that the predicted proportion of the energy consumption of the cat-th sub-category at time t is obtained after normalization. After this normalization, the sum of the proportions of all sub-energy consumptions is 1, ensuring physical consistency. This represents the predicted energy consumption of the cat-th subclass at time t.
[0094] Step 107: Determine the total energy consumption prediction value and the sub-energy consumption prediction value as the energy consumption prediction result of the traffic scenario in the future time period.
[0095] In embodiments of this application, after determining the predicted value of sub-energy consumption based on the predicted value of total energy consumption and the predicted ratio, the electronic device can determine the predicted value of total energy consumption and the predicted value of sub-energy consumption as the energy consumption prediction result of the traffic scenario in the future time period.
[0096] In the embodiments of this application, the final output can include the total energy consumption prediction value for the next time period (the next 15 minutes) and the prediction values of four sub-energy consumptions: lighting, air conditioning, office, and charging piles. These can be used by the energy management system corresponding to the traffic scenario for energy storage scheduling, orderly charging management, and peak shaving and valley filling decisions.
[0097] Furthermore, when determining the trained residual multi-scale LSTM model and the trained graph neural network, historical training data can be obtained. This historical training data includes historical multi-source data and corresponding historical total energy consumption labels and individual sub-energy consumption labels. Historical multi-level features are constructed based on the historical multi-source data. These features are then input into the residual multi-scale LSTM model to be trained to obtain the predicted total energy consumption value. The historical multi-level features are also input into the graph neural network to be trained to obtain the predicted proportions of each sub-energy consumption. The total energy consumption loss is determined based on the difference between the predicted total energy consumption value and the historical total energy consumption label. The sub-energy consumption proportion loss is determined based on the difference between the predicted proportions of each sub-energy consumption and the sub-energy consumption labels. The parameters of the residual multi-scale LSTM model and the graph neural network to be trained are updated based on the weighted sum of the total energy consumption loss and the sub-energy consumption proportion loss until the convergence condition is met, resulting in the trained residual multi-scale LSTM model and the trained graph neural network.
[0098] In the embodiments of this application, historical multi-level features are seven types of features extracted from historical multi-source data.
[0099] In the embodiments of this application, the total energy consumption loss adopts the Huber loss function (delta=1.0), which is determined based on the difference between the predicted total energy consumption value and the historical total energy consumption label, and is more robust to outliers than mean squared error. The sub-energy consumption ratio loss can be determined based on the difference between the predicted ratio of each sub-energy consumption and the label of each sub-energy consumption.
[0100] Based on the weighted sum of total energy loss and sub-energy loss (balance coefficient) =0.5), and all learnable parameters of the residual multi-scale LSTM model and the graph neural network to be trained are updated through backpropagation until the convergence condition is met, thus obtaining the trained residual multi-scale LSTM model and graph neural network. The optimizer uses Adam (initial learning rate 0.001), combined with learning rate decay and early stopping strategies.
[0101] For example, the Huber loss function can be expressed as the following formula: (14); in, This represents the true value, i.e., the actual energy consumption value in the labeled data: for total energy loss, It can be used to label the total historical energy consumption; for the percentage loss of sub-energy consumption, It can label the energy consumption ratio of each sub-sub in history. This represents the predicted value, i.e., the predicted result output by the model: for total energy loss, This can be the total energy consumption prediction value output by the residual multi-scale LSTM model; for the sub-energy consumption ratio loss... It can predict the proportion of each sub-energy consumption output by the graph neural network. This is the threshold parameter for Huber loss. This represents Huber's loss value.
[0102] The weighted sum of total energy loss and sub-energy loss can be expressed by the following formula: (15); in, This is the total loss value, which is the weighted sum of total energy loss and sub-energy loss. Huber's loss is the total energy consumption, where, This represents the true value of the historical total energy consumption label. This represents the total energy consumption prediction output by the residual multi-scale LSTM model. It is a set of sub-energy consumption nodes, including four sub-energy consumption nodes: lighting, air conditioning, office, and charging piles; Index the child energy consumption nodes and traverse them. Each sub-energy consumption node in; For the first The true proportion of energy consumption per unit For the first Predicted proportion of individual energy consumption; This is the sum of Huber losses for all sub-energy consumption, i.e., the sum of Huber losses for the prediction error of each sub-energy consumption ratio; This is the balance coefficient (which can be 0.5).
[0103] Based on the above embodiments, in another embodiment of this application; considering the following problems existing in the current related technologies: short-term energy consumption prediction methods (such as ARIMA / SARIMA) and exponential smoothing methods are essentially linear models, making it difficult to capture the nonlinear relationships in energy consumption sequences; deep learning methods face the problems of overfitting and excessively high computational costs in specific traffic scenarios with relatively limited data; although LSTM series models have good practical value, existing LSTM-based methods are mostly single-scale modeling and have not been specifically designed for the multi-scale temporal characteristics of multiple types of energy consumption in traffic scenarios; research on multi-scale LSTM for multi-scale modeling of multiple types of energy consumption in traffic scenarios is still lacking. This application proposes an RM-LSTM hierarchical prediction framework, such as... Figure 2 As shown, the overall process mainly includes four modules: multi-source data loading and alignment; seven-level feature engineering; residual multi-scale LSTM modeling; and hierarchical prediction and evaluation. The system uses a 15-minute sampling granularity, integrating electricity meter readings, holiday calendars, traffic flow data, and charging pile operation records. Through feature engineering, a high-dimensional input sequence is constructed, driving a residual multi-scale LSTM to jointly predict total energy consumption and the proportion of each sub-energy consumption. Finally, the absolute power prediction value for each type of energy consumption is obtained through proportional restoration.
[0104] The system's data sources include four categories: electricity meter data, which includes three-phase active power records from multiple meters such as high-mast lights (lighting), ground source heat pumps (HVAC), supermarkets, and canteens (offices) in the eastern area, with a sampling frequency of approximately 5 minutes; holiday calendar data, providing date-status (weekday / holiday / workday adjustment) mapping; traffic flow data, including time-sharing statistics of total traffic flow through stations and the number of vehicles entering and exiting stations; and charging pile record data, providing fields such as the start time, end time, charging amount (kWh), charging duration, and license plate number of the charging session.
[0105] The data preprocessing process includes: using the time range of lighting meter data as the baseline index, unifying each data source to a 15-minute hourly time axis through resampling and nearest neighbor alignment; using forward padding (up to 4 consecutive steps) to handle missing data caused by equipment disconnection for energy consumption data; filling missing traffic data with zeros; using linear time series interpolation for weather data; mapping holidays to days, with unmarked days defaulting to working days.
[0106] Energy consumption classification and total energy consumption calculation: Meter data for each device is mapped and merged into four energy consumption components: lighting, air conditioning (HVAC), office, and charging. The sum of three-phase active power is used as the instantaneous power of a single meter, and after 15 minutes of resampling and averaging, it is combined with similar devices. Total energy consumption is obtained by linearly superimposing the four components. Charging pile energy consumption is obtained from charging pile operation records allocated via time slots to ensure alignment with the meter time index.
[0107] Feature engineering is one of the core modules of this application, involving the design of seven levels of features, ultimately forming a high-dimensional feature matrix that is input into the model. This feature system uses service areas as a typical design blueprint, and its methodology can be transferred to other traffic node energy consumption prediction tasks.
[0108] Layer 1, Time Features: The core design principle of time features is to eliminate the abrupt changes at the beginning and end of integer time variables through sine / cosine encoding, ensuring the periodic continuity of time. Specifically, this includes: sin / cosine dual-component encoding for hours, intraday time slots, days of the week, and months, totaling 8 periodic features. In addition, based on the operational patterns of traffic nodes, 7 additional binary time period labels (late night, breakfast, morning, lunch, afternoon, dinner, and night) and 1 peak operation indicator variable are designed to cover the three peak periods of morning, noon, and evening when traffic is dense.
[0109] Layer 2, Calendar Features: Calendar features capture the impact of holidays on various energy consumption patterns at traffic nodes: weekday office energy consumption is higher (staff are on duty), while holidays see large through traffic flows and high charging demand. Specific features include: whether it is a weekend, whether it is a holiday, whether it is a weekday, the four-state day type (weekday / regular weekend / statutory holiday / adjusted workday), seasonal labels, and indicator variables for pre-holiday and post-holiday effects.
[0110] Layer 3, Weather Features: Weather features primarily serve for air conditioning energy consumption prediction (most sensitive) and lighting energy consumption prediction (moderately sensitive). Core weather-derived features include: cooling degree days (positive deviation for temperatures exceeding 26°C), heating degree days (negative deviation for temperatures below 18°C), perceived temperature, heat index, wind chill index, temperature deviation and its quadratic term (capturing the nonlinear relationship between air conditioning energy consumption and temperature), normalized natural light, logarithmic transformation of precipitation intensity, 1-hour and 6-hour cumulative precipitation, and 1-hour and 3-hour temperature change rates (capturing trigger signals for air conditioning start-up and shutdown). When measured weather data is lacking, the system automatically constructs temperature proxy variables based on month and time.
[0111] Layer 4, Traffic Flow Characteristics: There is a strong positive correlation between vehicle flow and charging energy consumption, and a weak positive correlation with office and lighting energy consumption. Flow characteristics include: 1-hour and 3-hour moving averages, 1-hour change and acceleration of change; inbound / outbound ratio and net flow; estimated number of stationary vehicles based on the net inflow accumulated over a 2-hour window; and the ratio of current flow to the historical average for the same period, used to measure the degree of flow anomalies.
[0112] Layer 5, Historical Energy Consumption Features: Historical energy consumption features utilize the strong autocorrelation of sequences to provide a direct signal for the model to learn energy consumption inertia. Total energy consumption lag features cover short-term (1, 2, 4, 8, 12, 24 steps), daily (96 steps, i.e., 24 hours ago), and weekly (672 steps, i.e., 7 days ago) periods. Rolling statistical features cover the mean, standard deviation, and maximum value for a 1-hour to 24-hour window. Daily cumulative energy consumption reflects the daily electricity consumption progress. Energy consumption change rate captures signals of rapid changes. Sub-energy consumption historical features only retain daily / weekly periodic lags and 24-hour rolling averages to avoid information leakage caused by short-term sub-energy consumption lags.
[0113] Layer 6, Charging Behavior Characteristics: Charging behavior characteristics are a significant extension of traditional energy consumption prediction methods in this application, extracted directly from charging pile operation records. Original charging behavior characteristics include: number of simultaneous charging sessions, sessions starting / ending during the current time period, number of fast charging sessions (duration less than 2 hours), number of slow charging sessions, number of unique users, average power per session, pile utilization rate, and historical charging power for the same period (weekday × hourly average), etc. Derived characteristics include: 1-hour smoothed charging power (trend signal), 1-hour power standard deviation (volatility), fast / slow charging ratio (behavioral pattern indicator), number of sessions per user (revisit rate), 3-hour cumulative charging amount, power change rate, and charging peak indicator variables.
[0114] Layer 7, Multi-Source Cross Features: Cross features capture the synergistic or competitive effects between multiple driving factors through product or conditional combination, and are an indispensable feature category in multi-driven traffic scenarios. The main design ideas include: temperature × time period air conditioning demand intensity characteristics, characterizing the cooling superposition effect during hot midday; traffic flow × charging session charging conversion efficiency characteristics, quantifying the charging demand generated per unit of traffic flow; operational status indicator variables, comprehensively considering calendar and time period to determine whether it is an operational period; the inhibitory effect of precipitation on charging behavior; and the interaction characteristics of holidays and charging penetration rate, capturing the amplified charging demand effect under high electric vehicle traffic during holidays.
[0115] For residual multi-scale LSTM models, the multi-scale LSTM block is the core component. Let the input sequence be X (shape T×d, where T is the sequence length, defaulting to 96 steps corresponding to 24 hours of history, and d is the feature dimension). The multi-scale block internally designs three parallel LSTM branches: (a) Short-term branch: Take the last min(24,T) steps (about 6 hours) of the sequence, extract the recent rapid fluctuation features, and output hs; (b) Mid-term branch: Take the last min(96,T) steps (approximately 24 hours) of the sequence to capture the complete intraday cycle features and output hm; (c) Long-term branch: Using the complete input sequence T steps, model the cross-day cycle and trend characteristics, and output hl.
[0116] Each branch has 64 hidden units u, and all branches have a Dropout ratio of 0.2. The outputs of the three branches are concatenated and then fused through a fully connected layer to obtain a multi-scale representation, as shown in the aforementioned formula (1).
[0117] Residual connection mechanism: To alleviate the gradient vanishing problem in deep networks, the model introduces two layers of residual connections. The first layer adds the last time step of the input sequence after linear projection to the multi-scale LSTM output, as shown in the aforementioned formulas (4) and (5).
[0118] The second layer passes the projected input sequence through multi-head temporal attention (MHTA) and then global average pooling, followed by residual connection, as shown in the aforementioned formulas (6) and (7).
[0119] The dual residual structure ensures that even if gradient degradation occurs in deep LSTM, information can still be propagated to the output layer through shortcut connections.
[0120] The Enhanced Feature Attention (EFA) layer is located at the front of the model and applies adaptive weights to the feature dimensions of the input sequence. Given a training set input matrix... Given a shape of N×d and a target vector y, calculate three correlation metrics respectively: Pearson correlation coefficient This measures the strength of the linear correlation between features and targets. Spearman rank correlation coefficient It is robust to monotonic nonlinear relationships; Mutual Information It captures statistical dependencies of any form and normalizes them to the interval [0, 1].
[0121] The three metrics are fused together using learnable weights. Weighted fusion is performed to obtain a comprehensive relevance score, as shown in the aforementioned formula (2).
[0122] The feature attention weight vector is obtained after Softmax normalization. Element-wise multiplication is applied to the feature dimensions of each time step of the input sequence.
[0123] Multi-Head Temporal Attention (MHTA) employs a standard scaled dot product attention structure, with a model dimension of [missing information]. Attention head count h=4, dimension per head Let the input be the sequence after projection layer transformation. (shape T×) The Q, K, and V matrices are obtained through linear mapping, and the scaling attention is calculated as shown in the aforementioned formula (3).
[0124] After multi-head output splicing, it is projected onto the fully connected layer. The dimension is then reduced to a fixed-length vector through global average pooling, which participates in the residual stacking. MHTA allows the model to flexibly focus on the historical moment that is most informative for the current prediction in the time dimension.
[0125] The output layer consists of two fully connected layers (64→32, ReLU activation function) and a linear output unit, with Dropout regularization at ratios of 0.3 and 0.2 respectively. The loss function is Huber loss (delta=1.0), which is more robust to outliers than MSE, as shown in the aforementioned formula (14).
[0126] The optimizer uses Adam (initial learning rate lr=0.001), combined with ReduceLROnPlateau learning rate decay (learning rate × 0.5 when the loss stagnates for 5 epochs, minimum learning rate 1e-6) and EarlyStopping (patience=10) early stopping strategy.
[0127] For the sub-energy consumption ratio prediction task, this application introduces a graph neural network module in the output layer. Let the set of four types of sub-energy consumption nodes be V = {lighting, air conditioning, office, charging pile}. The edge connections between nodes are adaptively generated by a dynamic graph structure learning mechanism, without relying on prior domain knowledge. Initial node features The depth features extracted by the residual multi-scale LSTM are obtained by projection. The GNN module performs K-layer message passing (K=2 or 3), and the update formula for each layer is as shown in the aforementioned formula (8).
[0128] The AGG function is an adaptive hierarchical graph attention aggregation. Finally, the predicted energy consumption ratios of each sub-sub ... and apply Constraints.
[0129] The joint loss function is shown in the aforementioned formula (15).
[0130] This application adopts a hierarchical prediction strategy of "total energy consumption + sub-energy consumption ratio". The total energy consumption prediction (total_load) is independently completed by a residual multi-scale LSTM model; the sub-energy consumption ratio predictions (lighting_ratio, hvac_ratio, office_ratio, charging_ratio) are jointly modeled using a GNN, eliminating the need for separate training of four independent ratio models. Specifically, each energy consumption subclass is treated as a node in a graph structure (lighting, air conditioning, office, and charging pile). The edge connections between nodes are adaptively generated by a dynamic graph structure learning mechanism, without relying on prior domain knowledge. This mechanism can dynamically adjust the coupling strength between nodes based on the contextual features of the current time step (such as time, holiday type, temperature range, etc.). The deep features extracted by the residual multi-scale LSTM are used as the initial features of each node and input into the GNN module. This module uses an adaptive hierarchical graph attention network to update the representation of each node through multiple rounds of message passing, finally outputting the predicted ratio values of each sub-energy consumption through a fully connected layer. This GNN module shares the underlying residual multi-scale LSTM parameters with the total energy consumption model, achieving end-to-end joint training. During training, the sub-energy consumption ratio label is obtained by dividing the sub-energy consumption power at each time step by the total energy consumption power (value range [0, 1]). During prediction, the outputs of the four ratio models are clipped to [0, 1] and normalized so that the sum of each ratio is 1. Then, the sum of the ratios is multiplied by the total energy consumption prediction value to restore the absolute power of each sub-energy consumption, as shown in the aforementioned formula (13). This normalization operation imposes a physical constraint at the prediction level that "the sum of each sub-energy consumption equals the total energy consumption", avoiding systematic deviations between the sum of the sub-energy consumption prediction values and the total energy consumption prediction value. This strategy is verified using the hierarchical structure of "total energy consumption, lighting / air conditioning / office / charging" in the service area as an example. Its methodology can be extended to other traffic energy consumption scenarios with similar hierarchical structures.
[0131] During training and evaluation, the dataset is divided into training (70%), validation (15%), and test (15%) sets in chronological order, prohibiting random shuffling of the chronological order to prevent future information leakage. Feature standardization (Standard Scaler) is applied only to the training set; the validation and test sets are transformed using the mean and standard deviation of the training set. Each target variable is standardized independently to ensure a balanced contribution of loss to targets of different magnitudes during multi-task training. Sequence construction uses a sliding window with a step size of 1, and the input sequence length is... (Based on 24 hours of historical data), the prediction step size is 1 (i.e., predicting the energy consumption value for the next 15 minutes). Evaluation metrics include mean absolute error (MAE), root mean square error (RMSE), mean absolute percentage error (MAPE), and coefficient of determination (R²). In the future prediction phase, a historical contemporaneous pattern matching strategy is used instead of incremental rolling prediction, effectively avoiding the accumulation of errors over time.
[0132] Traditional graph neural network methods typically rely on domain expert knowledge to predefine graph structures or use fixed, learnable adjacency matrices. However, the coupling relationships between different energy consumption subclasses in traffic scenarios are not static or invariant—for example, the correlation between charging stations and total energy consumption is significantly stronger during holidays, while different correlation patterns emerge on weekdays; the coupling relationship between air conditioning energy consumption and temperature is much stronger in summer than in winter. Predefined static graph structures struggle to capture these dynamically evolving correlation characteristics that change with external conditions.
[0133] To address the aforementioned issues, this application proposes a data-driven dynamic graph structure learning method that adaptively learns dynamic relationships between nodes directly from historical time-series data without relying on any prior topological knowledge. The specific design is as follows: Node embedding learning: Define a learnable embedding vector for each energy-consuming subclass node. , ( For embedded dimensions, , (This represents the number of sub-energy consumption categories). The embedding vectors of all nodes constitute the embedding matrix. End-to-end optimization is performed during model training.
[0134] Context-aware graph generation: The strength of associations between nodes varies significantly under different external conditions. To address this, this application designs a context encoder to incorporate the contextual features of the current time step. (Including time of day, day of the week, holiday type, temperature range, traffic flow level, etc.) are encoded as a context vector. ,in, It is a two-layer fully connected network. Based on the context vector, the time-step dependent transformation matrix is dynamically generated, as shown in the aforementioned formula (10).
[0135] The adjacency relationship of the current time step is calculated by node embedding and context-aware transformation matrix, as shown in the aforementioned formula (11).
[0136] After row-by-row normalization by Softmax, the dynamic adjacency matrix is obtained, as shown in the aforementioned formula (12).
[0137] The ReLU activation function is used to filter negative associations, and Softmax ensures that the sum of each row of the adjacency matrix is 1, forming a probabilistic graph structure.
[0138] Prior graph-guided joint optimization: To avoid the graph structure learned in a purely data-driven mode from overfitting to noise, this application introduces a sparse regularization constraint to encourage the sparsity of the adjacency matrix and prevent computational redundancy and overfitting risks caused by fully connected graphs. At the same time, the GNN message passing process is redefined as shown in the aforementioned formula (9).
[0139] End-to-end joint training: The dynamic graph structure learning module, residual multi-scale LSTM, and GNN proportional prediction modules are jointly trained end-to-end under the same loss function. This mechanism enables the evolution of graph topology and the updating of model parameters to mutually promote each other and jointly adapt to the current prediction task.
[0140] Compared with traditional static graph methods, the dynamic graph structure learning mechanism proposed in this application has the following advantages: No prior knowledge required: It does not rely on graph structures predefined by domain experts and has good scene generalization ability; Context adaptation: The graph structure evolves dynamically with external conditions, and can capture the dynamic coupling relationship between energy consumption subclasses as they change with seasons, holidays, weather, etc.; End-to-end optimization: The graph structure and model parameters are jointly trained under a unified framework, avoiding suboptimal solutions from staged optimization; Cross-scene transfer: When extended to other transportation scenarios such as bus depots and urban charging stations, the graph structure can automatically adapt to new data distributions without manual redefinition.
[0141] Furthermore, to verify the effectiveness of the method proposed in this application, relevant experiments were designed. The experimental data came from the actual operation records of a highway service area (as a typical example of a traffic scenario), covering a complete annual cycle (including seasonal climate changes and multiple statutory holidays), with a sampling granularity of 15 minutes. The dataset structure is shown in Table 1: ; After data alignment and cleaning, the basic statistical characteristics of the four types of energy consumption are shown in Table 2. The mean and peak values of charging pile energy consumption show significant time-varying differences, reflecting its high randomness; air conditioning energy consumption shows obvious peaks in summer and winter, consistent with temperature-driven cooling / heating demand; lighting energy consumption remains relatively stable during nighttime operation; office energy consumption remains at a high level during weekdays.
[0142] The main hyperparameters of the model are set as follows: input sequence length T=96, batch size=32, maximum training epochs=100, number of LSTM hidden units u=64, number of attention heads h=4, and dropout ratios of 0.3 and 0.2, respectively. The feature dimension generated by feature engineering is approximately 120~150. All models are trained in the same hardware environment.
[0143] Table 3 shows the prediction performance of the RM-LSTM in this application on four types of sub-energy consumption:
[0144] As shown in Table 3, the determination coefficients for all energy consumption sub-categories, except for charging piles, exceed 0.87, indicating that the hierarchical prediction strategy can effectively infer the changing patterns of various types of energy consumption. Lighting energy consumption achieved the highest determination coefficient (0.8829), attributed to its highly regular intraday pattern, which provides strong prior information due to its temporal characteristics. Office energy consumption had a determination coefficient of 0.8722, with its error primarily stemming from unexpected events and shift changes. These events have a low frequency of occurrence in historical data, making it difficult for the model to learn sufficiently.
[0145] The root mean square error (RMSE) of air conditioning energy consumption is relatively high (1.2411 kW), with a coefficient of determination of only 0.3616. This result does not indicate insufficient predictive ability of the model, but rather reflects the large fluctuation range of actual air conditioning energy consumption. The absolute value of air conditioning energy consumption is typically in the tens of kilowatts range, therefore the absolute error of 1.24 kW is relatively small (mean absolute percentage error is 9.70%). The low coefficient of determination is due to the large variance of air conditioning energy consumption, and the fact that the predicted value does not fully follow its extreme fluctuations, especially during periods of drastic temperature changes at seasonal transitions. The model's utilization of temperature-derived characteristics (such as cooling and heating degree-days) has shown some effectiveness, but there is still room for improvement under abrupt weather changes.
[0146] Predicting charging pile energy consumption is the most difficult aspect, with a coefficient of determination close to zero (-0.0053), indicating that the model can hardly explain the variance of charging energy consumption. However, its mean absolute percentage error is only 0.4758%, which seems contradictory. The explanation is as follows: the baseline value of charging pile energy consumption is very low (power is zero or close to zero for a large number of periods), so even if the absolute error is small (0.0304kW), the relative error may be large. The negative coefficient of determination indicates that the model's predictive performance is not as good as directly using historical averages. The high randomness of charging energy consumption stems from the significant impact of a single high-power charging event on the average power over the period. Although traffic flow characteristics and charging behavior characteristics are introduced, these features are still insufficient to fully capture the random arrival process of instantaneous charging events at a 15-minute granularity. This is the main limitation of the current method.
[0147] The average absolute percentage error of the total energy consumption prediction was 5.13%, and the coefficient of determination was 0.7919, indicating good overall performance. Since total energy consumption is a superposition of four sub-energy consumption categories, its randomness is smoothed out, making it easier to predict than the energy consumption of charging piles.
[0148] Furthermore, the system predicts the next 24 hours (96 15-minute time steps) and uses a historical pattern matching strategy to obtain input features. For example... Figure 3The figure shows a comparison between the predicted and actual total energy consumption for a typical day. The solid line represents the actual energy consumption, and the dashed line represents the model's predicted value. It can be observed that the system can correctly identify the three peak energy consumption periods of the following day: morning, noon, and evening. Near the morning peak (approximately 8:00-9:00) and noon peak (approximately 12:00-13:00), the predicted curve and the actual curve generally match, with the error at the peak time controlled within 15 minutes. The prediction for the evening peak (approximately 17:00-18:00) is slightly delayed, which may be related to the random fluctuations in the actual traffic arrival time on that day. During the low-energy consumption period at night (22:00 to 6:00 the next day), both the predicted and actual values remain at low levels with consistent fluctuations, indicating that the model has effectively learned the stable nighttime pattern of lighting energy consumption. This prediction model can be extended to other traffic nodes with similar energy consumption characteristics.
[0149] like Figure 4 As shown, the distribution of prediction errors approximates a normal distribution with a mean of zero, indicating that the model has no systematic bias. Most errors are concentrated in the range of -2kW to +2kW, with extreme errors (absolute values exceeding 5kW) occurring relatively infrequently. These extreme errors mainly correspond to sudden high-power charging events at charging stations and the non-stationary response of air conditioners under extreme weather conditions. The tail of the error distribution is slightly thicker than that of a normal distribution, reflecting the presence of anomalous events in the energy consumption sequence.
[0150] Overall, future predictive analysis shows that the proposed model can provide reliable 24-hour forward forecasts under normal conditions. The main performance bottleneck of the model lies in its response to extreme random events (such as a single high-power charging). The sum of the sub-energy consumption forecasts and the total energy consumption forecast are kept consistent through a proportional normalization mechanism, which reflects the advantage of the hierarchical prediction framework in terms of physical constraints. This validation is based on actual operational data of the service area, and its methodology can be extended to other transportation energy consumption prediction scenarios (such as bus depots, urban charging stations, etc.).
[0151] In summary, this application addresses the dynamic energy consumption prediction problem in traffic scenarios, using highway service areas as a typical verification scenario, and proposes a hierarchical prediction framework based on residual multi-scale LSTM (RM-LSTM). The main work and contributions are summarized below: First, a multi-scale LSTM block was designed, which models the temporal dependencies at different time granularities through three parallel branches: short-term (6 hours), medium-term (24 hours), and long-term (full sequence). The collaborative representation of multi-scale information is achieved through feature splicing and fusion, which effectively covers the multi-level periodic characteristics of traffic energy consumption. Second, an enhanced feature attention mechanism was constructed that integrates Pearson, Spearman correlation coefficients and mutual information. The three correlation measures are adaptively integrated with learnable weights, and high-dimensional features are weighted significantly at the model input, which improves the model's ability to perceive nonlinear driving factors. Third, the introduction of residual connections directly superimposes the input projection with the LSTM output. Combined with the residual supplementation of multi-head temporal attention, this alleviates the gradient vanishing problem in deep sequence models and improves the training stability and generalization performance of the model. Fourth, for traffic energy consumption scenarios, a seven-level feature system covering time, calendar, weather, traffic flow, energy consumption history, charging behavior and multi-source cross-effects was constructed. The system integrates multiple heterogeneous data sources, providing rich contextual information for the model. Fifth, a hierarchical prediction strategy of "total energy consumption + sub-energy consumption ratio" is adopted. The physical consistency of the prediction results is ensured by the ratio normalization constraint, and the collaborative and accurate prediction of various energy consumption sub-categories of traffic nodes is realized (this experiment verified five categories: total energy consumption, lighting, air conditioning, office and charging piles). Sixth, a dynamic graph structure learning mechanism is proposed. This mechanism achieves adaptive learning of the relationships between different energy consumption subclasses through a context-aware graph generation method, without relying on prior topological knowledge. This mechanism enables the graph topology to evolve dynamically with external conditions and is jointly optimized end-to-end with residual multi-scale LSTM and GNN modules, enhancing the model's generalization ability when transferring between different scenarios.
[0152] Experimental results show that RM-LSTM performs excellently in all four indicators of total energy consumption prediction: MAE, RMSE, MAPE, and R², validating the effectiveness of the hierarchical framework. Validation results based on actual operational data from service areas demonstrate that this method can effectively address the differences in various energy consumption types and the coupling of multiple driving factors, providing reliable technical support for the refined scheduling of energy management systems at transportation nodes. Using service areas as a typical validation scenario, the above method's model framework and feature engineering methodology exhibit good transferability and can be extended to other transportation scenarios with similar energy consumption hierarchical structures, such as urban charging stations, bus depots, and highways.
[0153] Based on the above embodiments, another embodiment of this application provides an electronic device. For example... Figure 5 As shown, the electronic device 1 proposed in this application embodiment may include a processor 11 and a memory 12 storing instructions executable by the processor 11; further, the electronic device 1 may also include a communication interface 13 and a bus 14 for connecting the processor 11, the memory 12 and the communication interface 13.
[0154] In the embodiments of this application, the processor 11 can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and this application embodiment does not specifically limit it. The memory 12 can be connected to the processor 11, wherein the memory 12 is used to store executable program code, which includes computer operation instructions. The memory 12 may include high-speed RAM memory, and may also include non-volatile memory, such as at least two disk drives.
[0155] In embodiments of this application, bus 14 is used to connect communication interface 13, processor 11 and memory 12 to enable communication between these devices.
[0156] In embodiments of this application, memory 12 is used to store instructions and data.
[0157] In practical applications, the aforementioned memory 12 can be volatile memory, such as random-access memory (RAM), or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 11.
[0158] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0159] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment.
[0160] Specifically, in this embodiment, the program instructions corresponding to the dynamic energy consumption prediction method based on residual multi-scale LSTM in a traffic scenario can be stored on storage media such as optical discs or hard disks. When the program instructions corresponding to the dynamic energy consumption prediction method based on residual multi-scale LSTM in a traffic scenario in the storage media are read or executed by an electronic device, the following steps are included: Acquire multi-source historical data of traffic scenarios; among which, multi-source historical data includes at least one of the following: electricity meter reading data, holiday calendar data, traffic flow data, charging pile operation record data, and weather data; Data processing is performed on multi-source historical data to obtain processed data; Multi-level features are determined based on the processed data; among them, multi-level features include at least one of time features, calendar features, weather features, traffic flow features, energy consumption history features, charging behavior features, and multi-source cross features; The total energy consumption prediction value of the traffic scenario in the future time period is determined based on the trained residual multi-scale LSTM model and multi-level features. The predicted proportion of sub-energy consumption is determined based on the trained graph neural network and multi-level features; wherein, sub-energy consumption includes at least one of lighting energy consumption, air conditioning energy consumption, office energy consumption and charging pile energy consumption. The predicted values for sub-energy consumption are determined based on the total energy consumption prediction value and the prediction ratio. The total energy consumption forecast and the sub-energy consumption forecast are determined as the energy consumption forecast results for the traffic scenario in the future time period.
[0161] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0162] This application is described with reference to schematic and / or block diagrams of implementations of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each step and / or block in the schematic and / or block diagrams, as well as combinations thereof, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more steps of the schematic and / or one or more blocks of the block diagrams.
[0163] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the implementation flow diagram. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0164] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0165] The above embodiments are merely preferred embodiments provided to fully illustrate this application, and the scope of protection of this application is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on this application are all within the scope of protection of this application.
Claims
1. A dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios, characterized in that, The method includes: Acquire multi-source historical data of traffic scenarios; wherein, the multi-source historical data includes at least one of electricity meter reading data, holiday calendar data, traffic flow data, charging pile operation record data, and weather data; The multi-source historical data is processed to obtain the processed data; Multi-level features are determined based on the processed data; wherein, the multi-level features include at least one of time features, calendar features, weather features, traffic flow features, energy consumption history features, charging behavior features, and multi-source cross features; The total energy consumption prediction value of the traffic scenario in future time periods is determined based on the trained residual multi-scale LSTM model and the multi-level features. The predicted proportion of sub-energy consumption is determined based on the trained graph neural network and the multi-level features; wherein, the sub-energy consumption includes at least one of lighting energy consumption, air conditioning energy consumption, office energy consumption, and charging pile energy consumption; The predicted value of the sub-energy consumption is determined based on the predicted total energy consumption and the predicted ratio; The total energy consumption prediction value and the sub-energy consumption prediction value are determined as the energy consumption prediction results of the traffic scenario in the future time period.
2. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to claim 1, characterized in that, The trained residual multiscale LSTM model includes an enhanced feature attention layer, a short-term LSTM branch, a medium-term LSTM branch, a long-term LSTM branch, and a fully connected fusion layer. The method for determining the total energy consumption prediction of the traffic scenario in future time periods based on the trained residual multi-scale LSTM model and the multi-level features includes: The adaptive weights of each feature in the multi-level features are determined by the enhanced feature attention layer, and the multi-level features are weighted according to the adaptive weights to obtain weighted features. The first temporal feature is obtained by extracting the sequence of the weighted features within a first preset time period through the short-term LSTM branch. The second temporal feature is obtained by extracting the sequence of the weighted feature within a second preset duration through the intermediate LSTM branch; wherein the second preset duration is longer than the first preset duration. The third temporal feature is obtained by extracting the complete sequence of the weighted features through the long-term LSTM branch; The first temporal feature, the second temporal feature, and the third temporal feature are spliced and fused through the fully connected fusion layer to obtain multi-scale features; The predicted energy consumption value is determined based on the multi-scale features.
3. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to claim 2, characterized in that, The trained residual multiscale LSTM model further includes a first residual connection layer, a multi-head temporal attention layer, a global average pooling layer, a second residual connection layer, and a first fully connected layer. Determining the predicted energy consumption value based on the multi-scale features includes: The first fused feature is obtained by adding the result of the linear projection of the last time step of the weighted feature through the first residual connection layer to the multi-scale feature. The first fused feature is subjected to scaled dot product attention processing through the multi-head temporal attention layer to obtain the attention weights for each historical moment. The first fusion feature is weighted and aggregated according to the attention weight to obtain the temporal attention feature; The time attention features are averaged in the time dimension by the global average pooling layer to obtain pooled features. The result of linear projection of the first fused feature is added to the pooling feature through the second residual connection layer to obtain the second fused feature; The total energy consumption prediction value is obtained by mapping the second fused feature through the first fully connected layer.
4. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to any one of claims 1 to 3, characterized in that, The trained graph neural network includes a projection layer, a dynamic graph structure learning module, a message passing layer, and a second fully connected layer. The determination of the predicted proportion of sub-energy consumption based on the trained graph neural network and the multi-level features includes: The multi-level features are projected onto each sub-energy consumption node through the projection layer to obtain the initial features of the sub-energy consumption node. The dynamic adjacency matrix between each sub-energy consumption node is determined by the dynamic graph structure learning module and the context features of the current time step; wherein, the context features include at least one of time information, weekday information, holiday type information, temperature range information, and traffic flow level information. Through the message passing layer and the dynamic adjacency matrix, the initial features of the sub-energy consumption nodes are passed through multiple rounds of message passing to obtain the updated features of the sub-energy consumption nodes. The prediction score of the sub-energy consumption node is determined by the update features of the second fully connected layer and the sub-energy consumption node. The prediction scores of the sub-energy consumption nodes are normalized to obtain the prediction ratio of the sub-energy consumption.
5. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to claim 4, characterized in that, The step of determining the dynamic adjacency matrix between each sub-energy consumption node through the dynamic graph structure learning module and the context features of the current time step includes: The learnable embedding vectors of each sub-energy consumption node are obtained through the dynamic graph structure learning module. The context features are encoded by the context encoder in the dynamic graph structure learning module to obtain a context vector; The transformation matrix for the current time step is determined based on the context vector; Based on the learnable embedding vector and the transformation matrix, the correlation strength score between each sub-energy consumption node is determined; The association strength score is normalized to obtain the dynamic adjacency matrix.
6. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to claim 1, characterized in that, The time feature is used to characterize time and the division of operating periods; The calendar features are used to characterize the impact of date type and pre- and post-holiday effects on energy consumption; The weather features are used to characterize the driving effect of temperature, humidity, precipitation and sunlight on energy consumption; The traffic flow characteristics are used to characterize the impact of traffic volume, its changing trend, and the balance between inbound and outbound traffic on energy consumption. The energy consumption history characteristics are used to characterize the inertia and periodic changes in energy consumption and the daily electricity consumption progress. The charging behavior characteristics are used to characterize charging load intensity, user charging mode, and equipment utilization. The multi-source crossover feature is used to characterize the impact of synergistic or competitive effects between different driving factors on energy consumption.
7. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to claim 1, characterized in that, The method further includes: Acquire historical training data; wherein, the historical training data includes historical multi-source data and corresponding historical total energy consumption labels and each sub-energy consumption label; Construct historical multi-level features based on the aforementioned historical multi-source data; The historical multi-level features are input into the residual multi-scale LSTM model to be trained to obtain the predicted total energy consumption value. The historical multi-level features are input into the graph neural network to be trained to obtain the predicted proportions of each sub-energy consumption. The total energy loss is determined based on the difference between the predicted total energy consumption value and the historical total energy consumption label; The sub-energy consumption ratio loss is determined based on the difference between the predicted ratio of each sub-energy consumption and the sub-energy consumption label. Based on the weighted sum of the total energy loss and the sub-energy loss ratio, the parameters of the residual multi-scale LSTM model to be trained and the graph neural network to be trained are updated until the convergence condition is met, thus obtaining the trained residual multi-scale LSTM model and the trained graph neural network.
8. The dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios according to claim 1, characterized in that, The process of processing the multi-source historical data to obtain processed data includes: Based on the time range of the electricity meter data, the holiday calendar data, the traffic flow data, the charging pile operation record data, and the weather data are unified to a preset time granularity to obtain the first processed data. Electricity meter data is categorized into four energy consumption categories: lighting energy consumption, air conditioning energy consumption, office energy consumption, and charging pile energy consumption. The total energy consumption is obtained by linearly superimposing the four types of energy consumption components. The processed data is determined based on the first processed data, the four types of energy consumption components, and the total energy consumption.
9. An electronic device, characterized in that, The electronic device includes a processor and a memory storing processor-executable instructions; when the instructions are executed by the processor, the dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the dynamic energy consumption prediction method based on residual multi-scale LSTM in traffic scenarios as described in any one of claims 1 to 8.