A method and system for predicting charging station load based on a hybrid expert model

By combining the temporal embedding of hybrid expert models and multiple spatial modeling methods, along with dynamic routing mechanisms and joint loss functions, the problems of high model complexity and large computational resource consumption in charging station load forecasting are solved, achieving more efficient and stable forecasting results.

CN119760339BActive Publication Date: 2026-03-13FUJIAN ELECTRIC POWER CO LTD XIAMEN ELECTRIC POWER SUPPLY CO +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-07
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies for charging station load forecasting suffer from problems such as high model computational complexity, long training time, high computational resource consumption, and difficulty in capturing complex and variable data features. In particular, when dealing with long-term data, gradient vanishing or gradient explosion is prone to occur, and traditional methods perform poorly in processing multivariate dynamically changing data.

Method used

A hybrid expert model is adopted, including a temporal embedding layer, an expert processing layer, a memory query layer, and a selection expert layer. By combining a temporal attention layer, a hybrid modeling layer, a temporally enhanced attention layer, and a feedforward neural layer, and by optimizing model parameters with a joint loss function, a variety of parallel spatial modeling methods and dynamic routing mechanisms are designed to enhance the model's adaptability and stability.

Benefits of technology

It improves the model's ability to model spatial dependencies and predict performance, enhances the model's adaptability and stability under different data distributions, improves the accuracy and efficiency of prediction, and reduces computational complexity and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760339B_ABST
    Figure CN119760339B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for predicting charging station load based on a hybrid expert model. It acquires historical charging load data to construct a historical charging load dataset. The hybrid expert prediction model comprises a temporal attention layer, a hybrid expert layer, a time-enhanced attention layer, a feedforward neural layer, a memory query layer, and an expert routing layer. Spatial modeling is performed based on the hybrid expert layer: expert model one uses an identity matrix to represent spatial relationships; expert model two uses a learnable adjacency matrix to represent spatial relationships; and expert model three uses a multi-head attention mechanism to reflect spatial relationships. Iterative training and evaluation are conducted to obtain a trained hybrid expert prediction model. The charging load data is input into the trained hybrid expert prediction model to obtain the predicted values ​​corresponding to the charging load data within the predicted time period. This invention strengthens the role of time information, enabling more accurate capture of the impact of dynamic time changes on the load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power load forecasting, and mainly to a method and system for forecasting charging station load based on a hybrid expert model. Background Technology

[0002] As a crucial component of intelligent transportation and new energy management, the current state of charging station load spatiotemporal prediction technology primarily focuses on the combination and optimization of time series forecasting and graph-based forecasting methods. Time series forecasting, as the core foundation of this field, has seen significant development in recent years. Traditional time series forecasting methods are mainly based on statistics and classical machine learning models, capturing regularities in time series through linear assumptions and fixed time windows. However, due to the complexity and diversity of charging station load data, including nonlinear variations, long-term and short-term dependencies, and mixed periodic and aperiodic patterns, these traditional methods exhibit significant limitations when processing high-dimensional, multivariate, and dynamically changing time series data, making it difficult to cope with the complex scenarios in real-world charging station networks.

[0003] With the rapid development of deep learning, time series forecasting techniques are gradually shifting from traditional statistical methods to methods based on deep neural networks, showing significant advantages over traditional methods in handling nonlinear and complex time series data. However, due to the sequential computational characteristics of recurrent networks, they are prone to gradient vanishing or gradient exploding problems when processing data with long time spans, and their computational efficiency is relatively low.

[0004] For example, Chinese invention patent CN118114798A discloses "A Method and Device for Predicting Charging Pile Load," which specifically discloses "A method and device for predicting charging pile load. First, an improved LSTM neural network prediction model is constructed. The input of the improved LSTM neural network prediction model is the charging pile load during a historical time period, the influencing factors during the historical time period, and the influencing factors during the predicted time period. The output is the charging pile load during the predicted time period. The parameters of the improved LSTM neural network prediction model are obtained through optimization algorithms. The improved LSTM neural network prediction model is trained using a training set. The input data required for predicting the charging pile load during the predicted time period using the trained improved LSTM neural network prediction model is obtained and input into the model to obtain the charging pile load during the predicted time period." However, this method relies on an improved LSTM neural network for prediction. This single model structure may be difficult to capture all relevant features and patterns when facing complex and variable charging pile load data. In addition, the LSTM neural network of this method has a complex internal structure, resulting in high computational complexity during training and prediction, long training time, and limited parallel computing capabilities. It also requires a large amount of computing resources and memory space during training and prediction. Summary of the Invention

[0005] To address the aforementioned problems in the existing technology, this application provides a charging station load prediction method and system based on a hybrid expert model.

[0006] The technical solution of this application is as follows:

[0007] On the one hand, this invention proposes a charging station load prediction method based on a hybrid expert model, the method comprising:

[0008] Acquire historical charging load data and perform data cleaning; construct a historical charging load dataset based on the cleaned historical charging load data, and divide the historical charging load dataset into a training set and a test set according to a preset ratio;

[0009] A hybrid expert prediction model is constructed, comprising a temporal embedding layer, an expert processing layer, a memory query layer, and a selected expert layer; wherein, the expert processing layer comprises a temporal attention layer, a hybrid modeling layer, a temporally enhanced attention layer, and a feedforward neural layer, and the hybrid modeling layer corresponds to different spatial modeling methods set for different experts to capture the relationships between charging stations;

[0010] The process involves selecting an expert layer to perform expert route calculations to obtain expert route probabilities, and selecting the expert output with the highest expert route probability as the final prediction result. The parameters of the hybrid expert prediction model are optimized using a joint loss function, which includes a prediction error loss function and an expert route loss function. The hybrid expert prediction model is iteratively trained using the training set and evaluated based on the test set and preset performance evaluation metrics to obtain the trained hybrid expert prediction model.

[0011] Obtain the charging load data within the current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain the predicted value corresponding to the charging load data within the time period to be predicted.

[0012] Preferably, the time-series embedding layer performs data processing on the historical charging load data, the data processing including time feature embedding and feature merging, wherein:

[0013] The aforementioned time feature embedding specifically involves using the Time2Vec method to convert the time series of historical charging load data into a time embedding vector, expressed by the formula:

[0014] ;

[0015] In the formula, Indicates the first Each dimension of the time embedding vector value; This indicates the time information in historical charging load data; Represents the weight matrix; Indicates the first Nonlinear variation parameters in each dimension; Indicates dimension; Represents a periodic activatable function; Indicates the first Index values ​​for each dimension;

[0016] The feature merging specifically involves concatenating the time embedding vector with historical charging load data excluding time information, and using linear projection mapping for dimensionality reduction, expressed by the formula:

[0017] ;

[0018] In the formula, Indicates time; express Embedding features at time points; This represents historical charging load data excluding time information. express The temporal embedding vector at any given time; Represents the preset linear projection matrix; This represents the join function.

[0019] Preferably, the expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporal enhancement attention layer, and a feedforward neural layer. The temporal attention layer acquires the embedded features, calculates the enhanced features using a self-attention mechanism, and performs layer normalization and skip connections, as expressed by the formula:

[0020] ;

[0021] ;

[0022] ;

[0023] ;

[0024] In the formula, Indicates a time step; Indicates the start time of the time step; Indicates the end time of the time step; Indicates the enhanced features within a time step; A query vector representing the embedded features within a time step; The key representing the embedded feature within a time step; This represents the value of the embedded feature within a time step; The linear transformation matrix representing the query vector; The linear transformation matrix representing the bond; The matrix representing the linear change of values; This represents the attention mechanism.

[0025] Preferably, the hybrid modeling layer includes three spatial modeling methods: expert model one, expert model two, and expert model three, wherein:

[0026] The first expert model does not consider the spatial relationships between charging stations. It uses an identity matrix to represent the spatial relationships between charging stations and performs layer normalization and skip connections, expressed by the following formula:

[0027] ;

[0028] In the formula, This represents the output features of expert model one; Represents the identity matrix;

[0029] The second expert model is specifically a graph convolutional neural network (GNN) convolutional layer. It uses a learnable adjacency matrix to represent the spatial relationships between charging stations and performs layer normalization and skip connections, as expressed by the formula:

[0030] ;

[0031] ;

[0032] In the formula, This represents the output features of expert model two; Represents a learnable adjacency matrix; Represents the normalization function; Indicates the activation function; Indicates an embedded function; Indicates learnable parameters; Indicates the transpose operation; This represents the weight matrix of the graph convolutional layer;

[0033] The third expert model utilizes a multi-head attention mechanism to reflect the spatial relationships between charging stations. The third expert model includes... The layer consists of attention layers and linear layers, with layer normalization and skip connections, as expressed in the formula;

[0034] , , ;

[0035] ;

[0036] ;

[0037] ;

[0038] ;

[0039] In the formula, This represents the output features of expert model three; Indicates the first In the attention layer, the first The charging station for the first Attention weight of each charging station; Indicates the first In the attention layer, the first The query vector for each charging station; Indicates the first In the attention layer, the first The key vector of each charging station; Indicates the first The query vector matrix of the attention layer; Indicates the first The key matrix of the attention layer; This indicates the dimension of the preset attention layer; Indicates the first The index value of each charging station; Indicates the first The index value of each charging station; Indicates the number of charging stations; Represents an exponential function; Indicates the first The index value of the attention layer; Indicates the first In the attention layer, the first The value of a charging station; This represents the weight matrix of the linear layer.

[0040] Preferably, the output features of the hybrid modeling layer are sequentially passed through a temporal enhancement attention layer and a feedforward neural layer to obtain the output features of the expert processing layer, specifically as follows:

[0041] The temporal enhancement attention layer acquires the output features of the hybrid modeling layer, calculates the temporal enhancement features, and performs layer normalization and skip connections, as expressed by the formula:

[0042] , ;

[0043] ;

[0044] In the formula, Indicates the first The increased attention weight of each charging station within a time step; Indicates the first time step within the time step The output vector of an expert model; Indicates a time range; Represents a predefined, learnable linear transformation matrix; This represents the temporal embedding vector value within a time step; This represents the temporal enhancement features within a time step; The linear transformation matrix representing the value vector of the time-enhanced attention layer;

[0045] The feedforward neural layer utilizes two linear transformations and a nonlinear activation function to perform a nonlinear transformation on the normalized time-enhanced features, followed by layer normalization and skip connections, as expressed by the formula:

[0046] ;

[0047] ;

[0048] ;

[0049] In the formula, This represents the output characteristics of the feedforward neural layer, which is also the output characteristics of the expert processing layer. This represents the output characteristics of the first-level linear transformation; This represents the weight matrix of the first-level linear transformation; This represents the bias of the first-level linear transformation; This represents the output of the nonlinear transformation activation function; This represents the weight matrix of the second-level linear transformation; This represents the bias of the second-level linear transformation.

[0050] Preferably, the memory query layer obtains the output features of the expert processing layer and calculates the query vector of the output features, expressed by the formula:

[0051] ;

[0052] In the formula, Indicates the first step within the time interval The query vector for each charging station; The linear transformation matrix representing the query vector; Indicates the bias of the query vector;

[0053] ;

[0054] ;

[0055] In the formula, Indicates the first The weight value of each memory item; Indicates the first step within the time interval The memory characteristics of a charging station; Represents the first in the memory bank One memory item; Indicates the number of memory items in the memory bank; Indicates the first The index value of each memory item;

[0056] The memory features are input into the expert selection layer to calculate the routing probability of each expert, expressed by the formula:

[0057] ;

[0058] ;

[0059] ;

[0060] In the formula, Indicates the first The output of an expert; Represents the similarity function; Indicates the number of experts; Indicates the first The index value of each expert; Indicates the first The routing probability of an expert;

[0061] Based on the expert routing probability results, the expert output with the highest expert routing probability is selected as the final prediction result, expressed by the formula:

[0062] ;

[0063] ;

[0064] In the formula, The index value representing the expert with the highest route generalization; This represents the function that yields the maximum probability of a route. Indicates the first step within the time interval The load forecast for each charging station is the final forecast result.

[0065] Preferably, the parameters of the hybrid expert prediction model are optimized using a joint loss function, specifically a combination of the prediction error loss function and the expert routing loss function, to obtain the optimal parameter set, wherein:

[0066] The joint loss function is expressed by the formula:

[0067] ;

[0068] In the formula, This represents the loss due to prediction error; This represents the loss from the best route selection;

[0069] The prediction error loss function specifically measures the difference between the predicted value and the true value, expressed by the formula:

[0070] ;

[0071] In the formula, Indicates the predicted value; Represents the actual value; Indicates the number of input features of the charging pile; Indicates the first The index value of the number of input features of each charging pile;

[0072] The optimal route selection loss function specifically selects experts whose prediction errors are within a preset range, expressed by the formula:

[0073] ;

[0074] In the formula, Indicates the first A label for an expert; Represents a logarithmic function;

[0075] The calculation process for expert tags is as follows:

[0076] ;

[0077] In the formula, Indicates the first step within the time interval The actual value of the load data for each charging pile; express quantiles at; It represents a random integer in the interval [0, 1].

[0078] On the other hand, the present invention also proposes a charging station load prediction system based on a hybrid expert model. The system includes a data acquisition module, a prediction model module, and a result output module, wherein:

[0079] The data acquisition module is used to acquire historical charging load data and perform data cleaning; based on the cleaned historical charging load data, a historical charging load dataset is constructed, and the historical charging load dataset is divided into a training set and a test set according to a preset ratio; the historical charging load dataset is then transmitted to the prediction model module.

[0080] The prediction model module has a built-in trained hybrid expert prediction model, which includes a temporal embedding layer, an expert processing layer, a memory query layer, and a selected expert layer. The expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporally enhanced attention layer, and a feedforward neural layer. The hybrid modeling layer sets different spatial modeling methods for different experts to capture the relationships between charging stations.

[0081] The process involves selecting an expert layer to perform expert route calculations to obtain expert route probabilities, and selecting the expert output with the highest expert route probability as the final prediction result. The parameters of the hybrid expert prediction model are optimized using a joint loss function, which includes a prediction error loss function and an expert route loss function. The hybrid expert prediction model is iteratively trained using the training set and evaluated based on the test set and preset performance evaluation metrics to obtain the trained hybrid expert prediction model.

[0082] Obtain the charging load data within the current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain the predicted value corresponding to the charging load data within the time period to be predicted;

[0083] The result output module is used to output the predicted value of the charging load data.

[0084] In another aspect, the present invention also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention.

[0085] In another aspect, the present invention also proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention.

[0086] Compared with the prior art, the beneficial effects of the present invention are:

[0087] 1. This invention provides a charging station load prediction method and system based on a hybrid expert model. By performing lag operations and designing multiple parallel spatial modeling methods, including identity matrix modeling, learnable adjacency matrix modeling, and modeling based on multi-head attention mechanism, the adaptability of the model is enhanced, and the model's ability to model spatial dependencies and its prediction effect are improved.

[0088] 2. This invention provides a charging station load prediction method and system based on a hybrid expert model. The expert layer is selected through a dynamic routing mechanism, which selects the most suitable expert for prediction based on the characteristics of the input data, thereby enhancing the model's adaptability under different data distributions. In addition, the dynamic update strategy of the memory bank is combined to improve the model's stability and generalization ability.

[0089] 3. This invention provides a charging station load prediction method and system based on a hybrid expert model. By designing a joint loss function, the prediction error loss is combined with the expert routing loss, which improves the matching degree of expert selection, enhances the selection ability of the expert system, and strengthens the stability of the model. Attached Figure Description

[0090] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;

[0091] Figure 2 This is a model structure diagram of the hybrid expert prediction model according to an embodiment of the present invention;

[0092] Figure 3 This is a comparison chart of the results of the hybrid expert prediction model in the embodiments of the present invention. Detailed Implementation

[0093] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0094] The present invention provides the following technical solution: a method and system for predicting the load of charging stations based on a hybrid expert model.

[0095] Example 1

[0096] See details Figure 1 This embodiment provides a charging station load prediction method based on a hybrid expert model, the specific steps of which include:

[0097] S1. Obtain historical charging load data and perform data cleaning; construct a historical charging load dataset based on the cleaned historical charging load data, and divide the historical charging load dataset into a training set and a test set according to a preset ratio;

[0098] S2. Construct a hybrid expert prediction model. Please refer to [link / reference]. Figure 2 The hybrid expert prediction model includes a time-series embedding layer, an expert processing layer, a memory query layer, and an expert selection layer.

[0099] S21. The time-series embedding layer performs data processing on the historical charging load data, and the data processing includes time feature embedding and feature merging.

[0100] S211. The time feature embedding specifically involves using the Time2Vec method to convert the time series of historical charging load data into a time embedding vector, expressed by the formula:

[0101] ;

[0102] In the formula, Indicates the first Each dimension of the time embedding vector value; This indicates the time information in historical charging load data; Represents the weight matrix; Indicates the first Nonlinear variation parameters in each dimension; Indicates dimension; Represents a periodic activatable function; Indicates the first Index values ​​for each dimension;

[0103] S212. The feature merging specifically involves concatenating the time embedding vector with historical charging load data excluding time information, and using linear projection mapping for dimensionality reduction, expressed by the formula:

[0104] ;

[0105] In the formula, Indicates time; express Embedding features at time points; This represents historical charging load data excluding time information. express The temporal embedding vector at any given time; Represents the preset linear projection matrix; Indicates the join function;

[0106] S22. The expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporally enhanced attention layer, and a feedforward neural layer. The hybrid modeling layer corresponds to different spatial modeling methods set by different experts to capture the relationship between charging stations.

[0107] S221. The temporal attention layer acquires the embedded features, calculates enhanced features using a self-attention mechanism, and performs layer normalization and skip connections, as expressed by the formula:

[0108] ;

[0109] ;

[0110] ;

[0111] ;

[0112] In the formula, Indicates a time step; Indicates the start time of the time step; Indicates the end time of the time step; Indicates the enhanced features within a time step; A query vector representing the embedded features within a time step; The key representing the embedded feature within a time step; This represents the value of the embedded feature within a time step; The linear transformation matrix representing the query vector; The linear transformation matrix representing the bond; The matrix representing the linear change of values; This represents the attention mechanism;

[0113] S2211, The layer normalization specifically involves standardizing the output of each attention step, expressed by the formula:

[0114] ;

[0115] In the formula, This represents the enhanced features after normalization; This represents the mean of the enhanced features; The standard deviation represents the enhanced feature; This represents a preset constant;

[0116] S2212, The skip connection is expressed by the formula:

[0117] ;

[0118] In the formula, This represents the enhanced features output by the final temporal attention layer;

[0119] S222, The hybrid modeling layer includes three spatial modeling methods: Expert Model 1, Expert Model 2, and Expert Model 3, wherein:

[0120] The first expert model does not consider the spatial relationships between charging stations. It uses an identity matrix to represent the spatial relationships between charging stations and performs layer normalization and skip connections, expressed by the following formula:

[0121] ;

[0122] In the formula, This represents the output features of expert model one; Represents the identity matrix;

[0123] The second expert model is specifically a graph convolutional neural network (GNN) convolutional layer. It uses a learnable adjacency matrix to represent the spatial relationships between charging stations and performs layer normalization and skip connections, as expressed by the formula:

[0124] ;

[0125] ;

[0126] In the formula, This represents the output features of expert model two; Represents a learnable adjacency matrix; Represents the normalization function; Indicates the activation function; Indicates an embedded function; Indicates learnable parameters; Indicates the transpose operation; This represents the weight matrix of the graph convolutional layer;

[0127] The third expert model utilizes a multi-head attention mechanism to reflect the spatial relationships between charging stations. The third expert model includes... The layer consists of attention layers and linear layers, with layer normalization and skip connections, as expressed in the formula;

[0128] , , ;

[0129] ;

[0130] ;

[0131] ;

[0132] ;

[0133] In the formula, This represents the output features of expert model three; Indicates the first In the attention layer, the first The charging station for the first Attention weight of each charging station; Indicates the first In the attention layer, the first The query vector for each charging station; Indicates the first In the attention layer, the first The key vector of each charging station; Indicates the first The query vector matrix of the attention layer; Indicates the first The key matrix of the attention layer; This indicates the dimension of the preset attention layer; Indicates the first The index value of each charging station; Indicates the first The index value of each charging station; Indicates the number of charging stations; Represents an exponential function; Indicates the first The index value of the attention layer; Indicates the first In the attention layer, the first The value of a charging station; This represents the weight matrix of the linear layer;

[0134] S223. The temporal enhancement attention layer acquires the output features of the hybrid modeling layer, calculates the temporal enhancement features, and performs layer normalization and skip connections, as expressed by the formula:

[0135] , ;

[0136] ;

[0137] In the formula, Indicates the first The increased attention weight of each charging station within a time step; Indicates the first time step within the time step The output vector of an expert model; Indicates a time range; Represents a predefined, learnable linear transformation matrix; This represents the temporal embedding vector value within a time step; This represents the temporal enhancement features within a time step; The linear transformation matrix representing the value vector of the time-enhanced attention layer;

[0138] S224. The feedforward neural layer utilizes two linear transformations and a nonlinear activation function to perform a nonlinear transformation on the normalized time-enhanced features, and then performs layer normalization and skip connections, as expressed by the formula:

[0139] ;

[0140] ;

[0141] ;

[0142] In the formula, This represents the output characteristics of the feedforward neural layer, which is also the output characteristics of the expert processing layer. This represents the output characteristics of the first-level linear transformation; This represents the weight matrix of the first-level linear transformation; This represents the bias of the first-level linear transformation; This represents the output of the nonlinear transformation activation function; This represents the weight matrix of the second-level linear transformation; This represents the bias of the second-level linear transformation;

[0143] S23. The memory query layer obtains the output features of the expert processing layer and calculates the query vector of the output features, expressed by the formula:

[0144] ;

[0145] In the formula, Indicates the first step within the time interval The query vector for each charging station; The linear transformation matrix representing the query vector; Indicates the bias of the query vector;

[0146] ;

[0147] ;

[0148] In the formula, Indicates the first The weight value of each memory item; Indicates the first step within the time interval The memory characteristics of a charging station; Represents the first in the memory bank One memory item; Indicates the number of memory items in the memory bank; Indicates the first The index value of each memory item;

[0149] S231, the memory bank specifically includes A matrix of memory entries, where each memory bank is specifically a... The input signal is a dimensional vector; at each time step, the input signal is fed into the gating network and interacts with the memory bank to calculate the similarity between the input signal and the memory items, and selects the memory items whose similarity difference with the current query vector is within a preset range; the gating network determines the weight of each memory item based on the calculated similarity, iteratively trains the memory bank, and updates the memory items and their corresponding weights;

[0150] A hypernetwork is used to query the memory bank. The hypernetwork generates a query vector based on the current signal, calculates the similarity between the query vector and the memory item, selects memory items whose similarity difference is within a preset range, and generates memory features.

[0151] S24. The expert selection layer obtains the memory features and inputs them into the expert selection layer, calculating the routing probability of each expert, expressed by the formula:

[0152] ;

[0153] ;

[0154] ;

[0155] In the formula, Indicates the first The output of an expert; Represents the similarity function; Indicates the number of experts; Indicates the first The index value of each expert; Indicates the first The routing probability of an expert;

[0156] Based on the expert routing probability results, the expert output with the highest expert routing probability is selected as the final prediction result, expressed by the formula:

[0157] ;

[0158] ;

[0159] In the formula, The index value representing the expert with the highest route generalization; This represents the function that yields the maximum probability of a route. Indicates the first step within the time interval The load forecast for each charging pile is the final forecast result.

[0160] S3. Optimize the parameters of the hybrid expert prediction model using a joint loss function, specifically a combination of the prediction error loss function and the expert routing loss function, to obtain the optimal parameter set, wherein:

[0161] The joint loss function is expressed by the formula:

[0162] ;

[0163] In the formula, This represents the loss due to prediction error; This represents the loss from the best route selection;

[0164] The prediction error loss function specifically measures the difference between the predicted value and the true value, expressed by the formula:

[0165] ;

[0166] In the formula, Indicates the predicted value; Represents the actual value; Indicates the number of input features of the charging pile; Indicates the first The index value of the number of input features of each charging pile;

[0167] The optimal route selection loss function specifically selects experts whose prediction errors are within a preset range, expressed by the formula:

[0168] ;

[0169] In the formula, Indicates the first A label for an expert; Represents a logarithmic function;

[0170] The calculation process for expert tags is as follows:

[0171] ;

[0172] In the formula, Indicates the first step within the time interval The actual value of the load data for each charging pile; express quantiles at; Represents a random integer within the interval [0, 1].

[0173] S4. Iteratively train the hybrid expert prediction model with the optimal parameter group using the training set, and evaluate it based on the test set and preset performance evaluation index to obtain the trained hybrid expert prediction model.

[0174] The preset performance evaluation index is specifically the mean absolute error. Mean absolute percentage error and root mean square error This can be expressed as a formula:

[0175] ;

[0176] ;

[0177] ;

[0178] Please see Figure 3 Comparison of model errors between the hybrid expert prediction model and the gradient boosting tree (GDBT) model, the geometric mean square error time prediction (GMEST) model, and the convolutional long short-term memory (CNN-LSTM) model.

[0179] S5. Obtain the charging load data within the current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain the predicted value corresponding to the charging load data within the time period to be predicted.

[0180] Example 2

[0181] This embodiment provides a charging station load forecasting system based on a hybrid expert model. The system includes a data acquisition module, a prediction model module, and a result output module, wherein:

[0182] The data acquisition module is used to acquire historical charging load data and perform data cleaning; based on the cleaned historical charging load data, a historical charging load dataset is constructed, and the historical charging load dataset is divided into a training set and a test set according to a preset ratio; the historical charging load dataset is then transmitted to the prediction model module.

[0183] The prediction model module has a built-in trained hybrid expert prediction model, which includes a temporal embedding layer, an expert processing layer, a memory query layer, and a selected expert layer. The expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporally enhanced attention layer, and a feedforward neural layer. The hybrid modeling layer sets different spatial modeling methods for different experts to capture the relationships between charging stations.

[0184] The process involves selecting an expert layer to perform expert route calculations to obtain expert route probabilities, and selecting the expert output with the highest expert route probability as the final prediction result. The parameters of the hybrid expert prediction model are optimized using a joint loss function, which includes a prediction error loss function and an expert route loss function. The hybrid expert prediction model is iteratively trained using the training set and evaluated based on the test set and preset performance evaluation metrics to obtain the trained hybrid expert prediction model.

[0185] Obtain the charging load data within the current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain the predicted value corresponding to the charging load data within the time period to be predicted;

[0186] The result output module is used to output the predicted value of the charging load data.

[0187] Example 3

[0188] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention.

[0189] Example 4

[0190] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention.

[0191] It is worth noting that the system, electronic device, and computer-readable storage medium described in this invention are all based on the same principle as the method described in Embodiment 1, and will not be repeated here.

[0192] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for load forecasting of a charging station based on a hybrid expert model, characterized in that, The method comprises: obtaining historical charging load data and performing data cleaning; constructing a historical charging load dataset according to the cleaned historical charging load data, and dividing the historical charging load dataset into a training set and a test set according to a preset proportion; constructing a hybrid expert prediction model, the hybrid expert prediction model comprising a time sequence embedding layer, an expert processing layer, a memory query layer and a selection expert layer; wherein the expert processing layer comprises a time sequence attention layer, a hybrid modeling layer, a time enhancement attention layer and a feedforward neural layer, the hybrid modeling layer being provided with three kinds of spatial modeling methods, namely expert model one, expert model two and expert model three, wherein the expert model one does not consider the spatial relationship between charging stations, uses a unit matrix to represent the spatial relationship between charging stations, the expert model two is a graph convolutional neural network (GNN) convolution layer, and uses a learnable adjacency matrix to represent the spatial relationship between charging stations, and the expert model three uses a multi-head attention mechanism to reflect the spatial relationship between charging stations; the selection expert layer performs expert routing calculation to obtain expert routing probabilities, and outputs the expert with the highest expert routing probability as the final prediction result; a joint loss function is used to optimize the parameters of the hybrid expert prediction model, the joint loss function comprising a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and is evaluated based on the test set and a preset performance evaluation index to obtain a trained hybrid expert prediction model; obtaining charging load data in a preset time period, inputting the charging load data into the trained hybrid expert prediction model, and obtaining a predicted value corresponding to the charging load data in the to-be-predicted period. 2.The charging station load forecasting method based on hybrid expert model according to claim 1, characterized in that, The time sequence embedding layer processes the historical charging load data, and the data processing comprises time feature embedding and feature merging, wherein: The time feature embedding is specifically converting the time sequence of the historical charging load data into a time embedding vector using a Time2Vec method, and is expressed by the following formula: ; In the formula, represents a time embedding vector value of the first dimension; represents time information in historical charging load data; represents a weight matrix; represents a nonlinear change parameter of the first dimension; represents a dimension; represents a periodic activatable function; represents an index value of the first dimension; The feature merging is specifically connecting the time embedding vector with the historical charging load data excluding time information, performing dimension reduction using linear projection mapping, and is expressed by the following formula: ; In the formula, denotes the time; denotes the embedding feature of the time; denotes the historical charging load data other than the time information; denotes the time embedding vector of the time; denotes the preset linear projection matrix; denotes the connection function. 3.The charging station load forecasting method based on hybrid expert model according to claim 2, characterized in that, The expert processing layer comprises a time sequence attention layer, a hybrid modeling layer, a time enhancement attention layer and a feedforward neural layer, the time sequence attention layer obtains the embedding features, uses a self-attention mechanism to calculate and enhance the features, and performs layer normalization and skip connection, and is expressed by the following formula: ; ; ; ; wherein denotes a time step; denotes a start time of a time step; denotes an end time of a time step; denotes an enhanced feature within a time step; denotes a query vector of an embedded feature within a time step; denotes a key of an embedded feature within a time step; denotes a value of an embedded feature within a time step; denotes a linear transformation matrix of a query vector; denotes a linear transformation matrix of a key; denotes a linear transformation matrix of a value; denotes an attention mechanism.

4. The method of claim 3, wherein the method further comprises: The hybrid modeling layer is provided with three kinds of spatial modeling methods, namely expert model one, expert model two and expert model three, wherein: The expert model one does not consider the spatial relationship between charging stations, uses a unit matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connection, and is expressed by the following formula: ; wherein represents the output features of the expert model one; represents the identity matrix; The expert model two is specifically a graph convolutional neural network (GNN) convolutional layer, which utilizes a learnable adjacency matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connection, and is expressed by a formula as follows: ; ; wherein denotes the output features of the expert model two; denotes the learnable adjacency matrix; denotes the normalization function; denotes the activation function; denotes the embedding function; denotes the learnable parameters; denotes the transpose operation; denotes the weight matrix of the graph convolution layer; The third expert model reflects the spatial relationship between the charging stations by using a multi-head attention mechanism, and the third expert model comprises a layer attention layer and a linear layer, and performs layer normalization and skip connection, and is expressed by a formula; , , ; ; ; ; ; In the formula, This represents the output features of expert model three; Indicates the first In the attention layer, the first The charging station for the first Attention weight of each charging station; Indicates the first In the attention layer, the first The query vector for each charging station; Indicates the first In the attention layer, the first The key vector of each charging station; Indicates the first The query vector matrix of the attention layer; Indicates the first The key matrix of the attention layer; This indicates the dimension of the preset attention layer; Indicates the first The index value of each charging station; Indicates the first The index value of each charging station; Indicates the number of charging stations; Represents an exponential function; Indicates the first The index value of the attention layer; Indicates the first In the attention layer, the first The value of a charging station; This represents the weight matrix of the linear layer.

5. The method of claim 4, wherein the method further comprises: The output features of the mixed modeling layer are sequentially input into a time-enhanced attention layer and a feedforward neural layer to obtain output features of an expert processing layer, which are specifically expressed by a formula as follows: The time-enhanced attention layer obtains the output features of the mixed modeling layer, calculates time-enhanced features, and performs layer normalization and skip connection, and is expressed by a formula as follows: , ; ; In the formula, denotes the enhanced attention weight of the th charging station in the time step; denotes the output vector of the th expert model in the time step; denotes the time range; denotes a preset learnable linear transformation matrix; denotes the time embedding vector value in the time step; denotes the time-enhanced feature in the time step; denotes the linear transformation matrix of the time-enhanced attention layer value vector; The feedforward neural layer utilizes two linear transformations and a nonlinear activation function to perform nonlinear transformation on the normalized time-enhanced features, and performs layer normalization and skip connection, and is expressed by a formula as follows: ; ; ; wherein, represents the output feature of the feed-forward neural layer, i.e., the output feature of the expert processing layer; represents the output feature of the first layer linear transformation; represents the weight matrix of the first layer linear transformation; represents the bias of the first layer linear transformation; represents the output of the non-linear transformation activation function; represents the weight matrix of the second layer linear transformation; represents the bias of the second layer linear transformation.

6. The method of claim 5, wherein the method further comprises: The memory query layer obtains the output features of the expert processing layer, calculates a query vector of the output features, and is expressed by a formula as follows: ; wherein denotes a query vector for the i-th charging pile in the time step; denotes a query vector for the i-th charging pile in the time step; denotes a linear transformation matrix for the query vector; denotes a bias for the query vector; ; ; wherein represents a weight value of the th memory item; represents a memory feature of the th charging station in the time step; represents the th memory item in the memory bank; represents the number of memory items in the memory bank; represents an index value of the th memory item; The memory features are input into an expert selection layer to calculate routing probabilities of each expert, and are expressed by a formula as follows: ; ; ; wherein, represents the output of the expert; represents a similarity function; represents the number of experts; represents the index value of the expert; represents the routing probability of the expert; According to the expert routing probability results, an expert with the highest expert routing probability is selected as the final prediction result, and is expressed by a formula as follows: ; ; In the formula, The index value representing the expert with the highest route generalization; This represents the function that yields the maximum probability of a route. Indicates the first step within the time interval The load forecast for each charging station is the final forecast result.

7. The method of claim 6, wherein the method further comprises: The joint loss function is specifically a combination of a prediction error loss function and an expert routing loss function, and optimal parameters are obtained, wherein: The joint loss function is expressed by a formula as follows: ; In the formula, denotes a prediction error loss; denotes an optimal routing loss; The prediction error loss function is specifically a difference between a predicted value and an actual value, and is expressed by a formula as follows: ; In the formula, represents a predicted value; represents a true value; represents the number of charging pile input features; represents the index value of the number of the charging pile input features; represents the index value of the charging station; represents the number of charging stations; represents the time range; represents the time step; The best routing selection loss function is specifically to select an expert with a prediction error within a preset range, and is expressed by a formula as follows: ; wherein represents a label for the expert; represents a logarithmic function; The calculation process of the expert label is specifically as follows: ; wherein denotes the true value of the i-th charging pile load data in the time step; denotes the true value of the i-th charging pile load data in the time step; denotes the quantile at denotes the quantile at denotes a random integer in the interval [0, 1].

8. A hybrid expert model based charging station load forecasting system, characterized in that, The system includes a data acquisition module, a prediction model module, and a result output module, wherein: The data acquisition module is used to acquire historical charging load data and perform data cleaning; a historical charging load dataset is constructed according to the cleaned historical charging load data, the historical charging load dataset is divided into a training set and a test set according to a preset proportion, and the historical charging load dataset is transmitted to the prediction model module; The prediction model module is internally provided with a trained mixed expert prediction model, and the mixed expert prediction model includes a time sequence embedding layer, an expert processing layer, a memory query layer, and a selection expert layer; wherein the expert processing layer includes a time sequence attention layer, a mixed modeling layer, a time-enhanced attention layer, and a feedforward neural layer, the mixed modeling layer sets different spatial modeling methods to capture the relationship between charging stations according to different experts, the mixed modeling layer sets three spatial modeling methods, which are specifically an expert model one, an expert model two, and an expert model three, the expert model one does not consider the spatial relationship between charging stations, and utilizes a unit matrix to represent the spatial relationship between charging stations, the expert model two is specifically a GNN convolutional layer, which utilizes a learnable adjacency matrix to represent the spatial relationship between charging stations, and the expert model three utilizes a multi-head attention mechanism to reflect the spatial relationship between charging stations. The selection expert layer performs expert routing calculation to obtain an expert routing probability, and selects an expert with the highest expert routing probability as the final prediction result; a joint loss function is used to optimize parameters of the hybrid expert prediction model, the joint loss function including a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and is evaluated based on the test set and a preset performance evaluation index to obtain a trained hybrid expert prediction model; The charging load data in the current preset time period is obtained, and the charging load data is input into the trained hybrid expert prediction model to obtain a predicted value corresponding to the charging load data in a to-be-predicted time period; The result output module is configured to output the predicted value of the charging load data.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the method in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Charging pile load prediction method and device

    CN118114798A

  • Model reasoning method and device based on mixed experts

    CN118657218A

  • Heterogeneous multi-mode hybrid expert adapter

    CN118708381A