Charging station load prediction method and system based on hybrid expert model
By adopting a hybrid expert model in charging station load prediction, combining multiple spatial modeling methods and dynamic routing mechanisms, the problems of poor prediction effect and high computational complexity in the processing of complex load data are solved, and more efficient load prediction and more stable model performance are achieved.
Patent Information
- Application Number
- CN202411792758.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-07
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-07
AI Technical Summary
The prior art is difficult to capture complex nonlinear changes, long-term and short-term dependencies and diversity when processing charging station load data, resulting in poor prediction results, high model calculation complexity, long training time, and large resource consumption.
The charging station load prediction method based on the hybrid expert model is adopted, and the timing embedding layer, expert processing layer, memory query layer and selection expert layer are combined with a variety of spatial modeling methods and dynamic routing mechanisms to optimize the joint loss function to improve the adaptability and prediction effect of the model.
The modeling ability and prediction effect of the model to spatial dependence are improved, the model's adaptability under different data distributions is enhanced, the model's stability and generalization ability are improved, and the consumption of computing resources is reduced.
Smart Images

Figure CN119760339A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power load forecasting, and mainly to a charging station load forecasting method and system based on a hybrid expert model. Background Art
[0002] As an important part of the field of intelligent transportation and new energy management, the current status of the technology development of charging station load spatiotemporal prediction technology is mainly focused on the combination and optimization of time series prediction and graph-based prediction methods. As the core foundation of this field, time series prediction technology has made significant progress in recent years. Traditional time series prediction methods are mainly based on statistics and classical machine learning models, capturing the regularity in time series through linear assumptions and fixed time windows. However, due to the complexity and diversity of charging station load data, including nonlinear changes, long-term and short-term dependencies, and periodic and non-periodic mixed patterns, these traditional methods show obvious limitations when processing high-dimensional, multivariate, and dynamically changing time series data, and are difficult to cope with complex scenarios in actual charging station networks.
[0003] With the rapid development of deep learning, time series prediction technology has gradually shifted from traditional statistical methods to methods based on deep neural networks, which have shown significant advantages over traditional methods in processing nonlinear and complex time series data. However, due to the sequential computing characteristics of recurrent networks, they are prone to gradient vanishing or gradient exploding problems when processing long-span data, and their computational efficiency is low.
[0004] For example, the Chinese invention patent with the publication number "CN118114798A" discloses "A method and device for predicting the load of a charging pile", which specifically discloses "a method and device for predicting the load of a charging pile. 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 in the historical time period, the influencing factors in the historical time period and the influencing factors in the predicted time period, and the output is the charging pile load in the predicted time period, and the parameters of the improved LSTM neural network prediction model are optimized by an optimization algorithm; the improved LSTM neural network prediction model is trained using a training set; the input data required for predicting the charging pile load in the predicted time period using the trained improved LSTM neural network prediction model is obtained, and the input data is input into the model to obtain the charging pile load in the predicted time period", but the method relies on the improved LSTM neural network for prediction. This single model structure may be difficult to capture all relevant features and patterns when facing complex and changeable charging pile load data; in addition, the LSTM neural network of the method has a complex internal structure, which leads to a high computational complexity of the model during training and prediction, a long training time, and limited parallel computing capabilities; a large amount of computing resources and memory space are also required during the training and prediction process. Summary of the invention
[0005] In order to solve the above problems existing in the prior art, the present 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, the present invention proposes a charging station load prediction method based on a hybrid expert model, the method comprising:
[0008] Obtain historical charging load data and perform data cleaning; construct a historical charging load data set based on the cleaned historical charging load data, and divide the historical charging load data set into a training set and a test set according to a preset ratio;
[0009] Constructing a hybrid expert prediction model, the hybrid expert prediction model includes a time series embedding layer, an expert processing layer, a memory query layer and a selection expert layer; wherein the expert processing layer includes a time series attention layer, a hybrid modeling layer, a time enhanced attention layer and a feedforward neural layer, and the hybrid modeling layer sets different spatial modeling methods corresponding to different experts to capture the relationship between charging stations;
[0010] The expert layer is selected to perform expert routing calculation to obtain expert routing probability, and the expert output with the highest expert routing probability is selected as the final prediction result; the parameters of the hybrid expert prediction model are optimized using a joint loss function, and the joint loss function includes a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and evaluated based on the test set and a preset performance evaluation index to obtain a trained hybrid expert prediction model;
[0011] 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 the corresponding prediction value of the charging load data in the time period to be predicted.
[0012] Preferably, 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, wherein:
[0013] The time feature embedding is specifically to convert the time series of historical charging load data into a time embedding vector using the Time2Vec method, which is expressed as follows:
[0014]
[0015] Where, TIM(τ)[z] represents the time embedding vector value of the z-th dimension; τ represents the time information in the historical charging load data; ω represents the weight matrix; φ represents the nonlinear change parameter; h represents the dimension; F represents the periodic activatable function; z represents the index value of the z-th dimension;
[0016] The feature merging is specifically to connect the time embedding vector with the historical charging load data except the time information, and use linear projection mapping to reduce the dimension, which can be expressed as:
[0017]
[0018] In the formula, t represents the time; represents the embedding feature at time t; X' (t) Represents the historical charging load data except time information; TIM(τ (t) ) represents the time embedding vector at time t; W proj Represents the preset linear projection matrix; Concat represents the connection function.
[0019] Preferably, the expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporal enhanced attention layer and a feedforward neural layer. The temporal attention layer obtains the embedded features, uses a self-attention mechanism to calculate enhanced features, and performs layer normalization and skip connections, which can be expressed as follows:
[0020]
[0021] Where s represents the time step; s1 represents the start time of the time step; s2 represents the end time of the time step; represents the enhanced features within the time step; Q s K is the query vector representing the embedded features within a time step; s V represents the key of the embedded features within a time step; s represents the value of the embedded feature within the time step; W Q Represents the linear change matrix of the query vector; W K Represents the linear change matrix of the bond; W V Represents the linear change matrix of the value; Attention represents the attention mechanism.
[0022] Preferably, the hybrid modeling layer includes three spatial modeling methods, namely expert model 1, expert model 2 and expert model 1, wherein:
[0023] The expert model 1 does not consider the spatial relationship between charging stations, uses the unit matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connection, which can be expressed as:
[0024]
[0025] In the formula, H EX1 represents the output features of expert model 1; I represents the unit matrix;
[0026] The expert model 2 is specifically a graph convolutional neural network (GNN) convolutional layer, which uses a learnable adjacency matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connections, which can be expressed as:
[0027]
[0028] In the formula, H EX2 represents the output features of expert model 2; represents a learnable adjacency matrix; softmax represents a normalization function; relu() represents an activation function; g() represents an embedding function; θ represents a learnable parameter; ZT represents a transposition operation; W GNN () represents the weight matrix of the graph convolutional layer;
[0029] The expert model 3 uses a multi-head attention mechanism to reflect the spatial relationship between charging stations. The expert model 3 includes d k Layer attention layer and linear layer, and perform layer normalization and skip connection, expressed in formula;
[0030]
[0031] In the formula, H EX3 represents the output features of expert model three; represents the attention weight of the i-th charging station to the j-th charging station in the k-th attention layer; represents the query vector of the i-th charging station in the k-th attention layer; represents the key vector of the jth charging station in the kth attention layer; Represents the query vector matrix of the k-th attention layer; represents the key matrix of the kth attention layer; d k represents the dimension of the preset attention layer; i represents the index value of the i-th charging station; j represents the index value of the j-th charging station; N represents the number of charging stations; exp represents the exponential function; k represents the index value of the k-th attention layer; represents the value of the jth charging station in the kth attention layer; W EX3 Represents the weight matrix of the Linear layer.
[0032] Preferably, the output features of the hybrid modeling layer are sequentially passed through the time-enhanced attention layer and the feedforward neural layer to obtain the output features of the expert processing layer, specifically:
[0033] The temporal enhanced attention layer obtains the output features of the hybrid modeling layer, calculates the temporal enhanced features, and performs layer normalization and skip connections, which can be expressed as:
[0034]
[0035] In the formula, β is represents the enhanced attention weight of the i-th charging station in the time step; represents the output vector of the nth expert model in the time step; T represents the time range; TW K represents the preset learnable linear transformation matrix; TIM(τ(s)) represents the time embedding vector value within the time step; H time (s) represents the time-enhanced feature within a time step; TW V The linear transformation matrix representing the temporal augmented attention layer value vector;
[0036] The feedforward neural layer uses two layers of linear transformation and a nonlinear activation function to perform nonlinear transformation on the normalized time enhancement features, and performs layer normalization and skip connection, which can be expressed as:
[0037] H FFN1 =H time (s)W1+b1;
[0038] H relu =relu(H FFN1 );
[0039] H FFN =H relu W2+b2;
[0040] In the formula, H FFN represents the output features of the feedforward neural layer, that is, the output features of the expert processing layer; H FFN1 represents the output features of the first layer of linear transformation; W1 represents the weight matrix of the first layer of linear transformation; b1 represents the bias of the first layer of linear transformation; H relu represents the output of the nonlinear transformation activation function; W2 represents the weight matrix of the second-layer linear transformation; b2 represents the bias of the second-layer linear transformation.
[0041] Preferably, the memory query layer obtains the output features of the expert processing layer and calculates the query vector of the output features, which can be expressed as:
[0042]
[0043] In the formula, represents the query vector of the i-th charging pile in the time step; Wu q b represents the linear transformation matrix of the query vector;q represents the bias of the query vector;
[0044]
[0045] In the formula, μ r Represents the weight value of the rth memory item; represents the memory feature of the i-th charging station in the time step; M[r] represents the r-th memory item in the memory bank; m represents the number of memory items in the memory bank; r represents the index value of the r-th memory item;
[0046] The memory features are input into the expert selection layer, and the routing probability of each expert is calculated, which is expressed as:
[0047]
[0048] In the formula, H e represents the output of the e-th expert; g() represents the similarity function; E represents the number of experts; e represents the index value of the e-th expert; p e represents the routing probability of the e-th expert;
[0049] According to the expert routing probability results, the expert output with the highest expert routing probability is selected as the final prediction result, which is expressed as:
[0050]
[0051] In the formula, e * represents the index value of the expert with the highest routing summary; argmax represents the function of obtaining the maximum routing probability; It represents the load forecast of the i-th charging pile in the time step, which is the final forecast result.
[0052] Preferably, the parameters of the hybrid expert prediction model are optimized using a joint loss function, wherein the joint loss function is specifically a combination of a prediction error loss function and an expert routing loss function to obtain an optimal parameter group, wherein:
[0053] The joint loss function is expressed as follows:
[0054] L=L forecast +L route ;
[0055] Where, L forecast represents the prediction error loss; L route represents the best routing loss;
[0056] The prediction error loss function specifically measures the difference between the predicted value and the true value, and is expressed as follows:
[0057]
[0058] In the formula, represents the predicted value; Y represents the true value; C represents the number of charging pile input features; c represents the index value of the number of the c-th charging pile input features;
[0059] The optimal route selection loss function is specifically to select an expert whose prediction error is within a preset range, and is expressed as:
[0060]
[0061] In the formula, l e represents the label of the e-th expert; log represents the logarithmic function;
[0062] The calculation process of expert labels is as follows:
[0063]
[0064] Where Y i (s) Indicates the true value of the load data of the i-th charging pile in the time step; Q 1-q Represents the quantile at 1-q; q represents a random integer in the interval [0, 1].
[0065] On the other hand, the present invention also proposes a charging station load prediction system based on a hybrid expert model, the system comprising a data acquisition module, a prediction model module and a result output module, wherein:
[0066] The data acquisition module is used to acquire historical charging load data and perform data cleaning; construct a historical charging load data set based on the cleaned historical charging load data, and divide the historical charging load data set into a training set and a test set according to a preset ratio; and transmit the historical charging load data set to the prediction model module;
[0067] The prediction model module has a built-in trained hybrid expert prediction model, which includes a time series embedding layer, an expert processing layer, a memory query layer, and a selection expert layer; wherein the expert processing layer includes a time series attention layer, a hybrid modeling layer, a time enhanced attention layer, and a feedforward neural layer, and the hybrid modeling layer sets different spatial modeling methods corresponding to different experts to capture the relationship between charging stations;
[0068] The expert layer is selected to perform expert routing calculation to obtain expert routing probability, and the expert output with the highest expert routing probability is selected as the final prediction result; the parameters of the hybrid expert prediction model are optimized using a joint loss function, and the joint loss function includes a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and evaluated based on the test set and a preset performance evaluation index to obtain a trained hybrid expert prediction model;
[0069] Acquire charging load data within a current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain a prediction value corresponding to the charging load data within the time period to be predicted;
[0070] The result output module is used to output the predicted value of the charging load data.
[0071] On the other hand, 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 when the processor executes the program, a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention is implemented.
[0072] On the other hand, the present invention further proposes a computer-readable storage medium having a computer program stored 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.
[0073] Compared with the prior art, the present invention has the following beneficial effects:
[0074] 1) The present invention provides a charging station load forecasting method and system based on a hybrid expert model. By performing a hysteresis operation and designing a variety of parallel spatial modeling methods, including unit matrix modeling, learnable adjacency matrix modeling, and modeling based on a multi-head attention mechanism, the adaptability of the model is enhanced, and the modeling ability and prediction effect of the model for spatial dependence are improved;
[0075] 2) The present invention provides a charging station load forecasting method and system based on a hybrid expert model. The expert layer selects the most suitable expert for forecasting according to the characteristics of the input data through a dynamic routing mechanism, thereby enhancing the adaptability of the model under different data distributions; in addition, the dynamic update strategy of the memory library is combined to improve the stability and generalization ability of the model;
[0076] 3) The present 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 and the expert routing loss are combined, which improves the matching degree of expert selection, improves the selection ability of the expert system, and enhances the stability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 is a method flow chart of an embodiment of the present invention;
[0078] Figure 2 is a model structure diagram of a hybrid expert prediction model according to an embodiment of the present invention;
[0079] Figure 3 3 is a result comparison diagram of the hybrid expert prediction model in an embodiment of the present invention. DETAILED DESCRIPTION
[0080] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0081] The present invention provides the following technical solution: a charging station load prediction method and system based on a hybrid expert model.
[0082] Example 1
[0083] See Figure 1 This embodiment provides a charging station load prediction method based on a hybrid expert model, and the specific steps include:
[0084] S1. Obtain historical charging load data and perform data cleaning; construct a historical charging load data set based on the cleaned historical charging load data, and divide the historical charging load data set into a training set and a test set according to a preset ratio;
[0085] S2. Build a hybrid expert prediction model, see 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;
[0086] S21, the time series embedding layer performs data processing on the historical charging load data, wherein the data processing includes time feature embedding and feature merging;
[0087] S211, the time feature embedding is specifically to convert the time series of historical charging load data into a time embedding vector using the Time2Vec method, which is expressed as:
[0088]
[0089] Where, TIM(τ)[z] represents the time embedding vector value of the z-th dimension; τ represents the time information in the historical charging load data; ω represents the weight matrix; φ represents the nonlinear change parameter; h represents the dimension; F represents the periodic activatable function; z represents the index value of the z-th dimension;
[0090] S212, the feature merging is specifically to connect the time embedding vector with the historical charging load data except the time information, and use linear projection mapping to reduce the dimension, which is expressed as:
[0091]
[0092] In the formula, t represents the time; represents the embedding feature at time t; X' (t) Represents the historical charging load data except time information; TIM(τ (t) ) represents the time embedding vector at time t; W proj Represents the preset linear projection matrix; Concat represents the connection function.
[0093] S22, the expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporal enhanced attention layer and a feedforward neural layer, and the hybrid modeling layer corresponds to different experts setting different spatial modeling methods to capture the relationship between charging stations;
[0094] S221, the temporal attention layer obtains the embedded features, uses the self-attention mechanism to calculate the enhanced features, and performs layer normalization and skip connection, which can be expressed as:
[0095]
[0096] Where s represents the time step; s1 represents the start time of the time step; s2 represents the end time of the time step; represents the enhanced features within the time step; Q s K is the query vector representing the embedded features within a time step; s V represents the key of the embedded features within a time step; s represents the value of the embedded feature within the time step; W Q Represents the linear change matrix of the query vector; W K Represents the linear change matrix of the bond; W V Represents the linear change matrix of the value; Attention represents the attention mechanism;
[0097] S2211, the layer normalization is specifically to normalize the output of each attention step, which is expressed as:
[0098]
[0099] In the formula, represents the normalized enhanced feature; μ represents the mean of the enhanced feature; σ represents the standard deviation of the enhanced feature; ε represents a preset constant;
[0100] S2212, the jump connection is expressed as:
[0101]
[0102] In the formula, Represents the enhanced features of the final temporal attention layer output;
[0103] S222, the hybrid modeling layer includes three spatial modeling methods, namely expert model 1, expert model 2 and expert model 1, wherein:
[0104] The expert model 1 does not consider the spatial relationship between charging stations, uses the unit matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connection, which can be expressed as:
[0105]
[0106] In the formula, H EX1 represents the output features of expert model 1; I represents the unit matrix;
[0107] The expert model 2 is specifically a graph convolutional neural network (GNN) convolutional layer, which uses a learnable adjacency matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connections, which can be expressed as:
[0108]
[0109] In the formula, H EX2 represents the output features of expert model 2; represents a learnable adjacency matrix; softmax represents a normalization function; relu() represents an activation function; g() represents an embedding function; θ represents a learnable parameter; ZT represents a transposition operation; W GNN () represents the weight matrix of the graph convolutional layer;
[0110] The expert model 3 uses a multi-head attention mechanism to reflect the spatial relationship between charging stations. The expert model 3 includes d k Layer attention layer and linear layer, and perform layer normalization and skip connection, expressed in formula;
[0111]
[0112] In the formula, H EX3 represents the output features of expert model three; represents the attention weight of the i-th charging station to the j-th charging station in the k-th attention layer; represents the query vector of the i-th charging station in the k-th attention layer; represents the key vector of the jth charging station in the kth attention layer; Represents the query vector matrix of the k-th attention layer; represents the key matrix of the kth attention layer; d k represents the dimension of the preset attention layer; i represents the index value of the i-th charging station; j represents the index value of the j-th charging station; N represents the number of charging stations; exp represents the exponential function; k represents the index value of the k-th attention layer; represents the value of the jth charging station in the kth attention layer; W EX3 represents the weight matrix of the linear layer;
[0113] S223, the time-enhanced attention layer obtains the output features of the hybrid modeling layer, calculates the time-enhanced features, and performs layer normalization and skip connection, which can be expressed as:
[0114]
[0115] In the formula, β is represents the enhanced attention weight of the i-th charging station in the time step; represents the output vector of the nth expert model in the time step; T represents the time range; TW K represents the preset learnable linear transformation matrix; TIM(τ(s)) represents the time embedding vector value within the time step; H time (s) represents the time-enhanced feature within a time step; TW V The linear transformation matrix representing the temporal augmented attention layer value vector;
[0116] S224, the feedforward neural layer uses two layers of linear transformation and a nonlinear activation function to perform nonlinear transformation on the normalized time enhancement features, and performs layer normalization and skip connection, which can be expressed as:
[0117] H FFN1 =H time (s)W1+b1;
[0118] H relu =relu(H FFN1 );
[0119] H FFN =H relu W2+b2;
[0120] In the formula, H FFNrepresents the output features of the feedforward neural layer, that is, the output features of the expert processing layer; H FFN1 represents the output features of the first layer of linear transformation; W1 represents the weight matrix of the first layer of linear transformation; b1 represents the bias of the first layer of linear transformation; H relu represents the output of the nonlinear transformation activation function; W2 represents the weight matrix of the second-layer linear transformation; b2 represents the bias of the second-layer linear transformation;
[0121] S23, the memory query layer obtains the output features of the expert processing layer, and calculates the query vector of the output features, which is expressed as:
[0122]
[0123] In the formula, represents the query vector of the i-th charging pile in the time step; Wu q b represents the linear transformation matrix of the query vector; q represents the bias of the query vector;
[0124]
[0125] In the formula, μ r Represents the weight value of the rth memory item; represents the memory feature of the i-th charging station in the time step; M[r] represents the r-th memory item in the memory bank; m represents the number of memory items in the memory bank; r represents the index value of the r-th memory item;
[0126] S231, the memory bank is specifically a matrix including m memory items, wherein each memory bank is specifically an e-dimensional vector; in each time step, the input signal is input into the gating network to interact with the memory bank, the similarity between the input signal and the memory item is calculated, and the memory item whose similarity difference with the current query vector is within a preset range is selected; the gating network determines the weight of each memory item according to the calculated similarity, iteratively trains the memory bank, and updates the memory item and its corresponding weight;
[0127] A memory library query is implemented using a hypernetwork, wherein the hypernetwork generates a query vector according to the current signal, calculates the similarity between the query vector and the memory item, selects the memory item whose similarity difference is within a preset range, and generates a memory feature;
[0128] S24, the expert selection layer obtains the memory feature and inputs it into the expert selection layer, and calculates the routing probability of each expert, which is expressed as:
[0129]
[0130] In the formula, H erepresents the output of the e-th expert; g() represents the similarity function; E represents the number of experts; e represents the index value of the e-th expert; p e represents the routing probability of the e-th expert;
[0131] According to the expert routing probability results, the expert output with the highest expert routing probability is selected as the final prediction result, which is expressed as:
[0132]
[0133] In the formula, e * represents the index value of the expert with the highest routing summary; argmax represents the function of obtaining the maximum routing probability; represents the load forecast of the i-th charging pile in the time step, which is the final forecast result;
[0134] S3. Optimize the parameters of the hybrid expert prediction model using a joint loss function, where the joint loss function is specifically a combination of a prediction error loss function and an expert routing loss function to obtain an optimal parameter group, wherein:
[0135] The joint loss function is expressed as follows:
[0136] L=L forecast +L route ;
[0137] Where, L forecast represents the prediction error loss; L route represents the best routing loss;
[0138] The prediction error loss function specifically measures the difference between the predicted value and the true value, and is expressed as follows:
[0139]
[0140] In the formula, represents the predicted value; Y represents the true value; C represents the number of charging pile input features; c represents the index value of the number of the c-th charging pile input features;
[0141] The optimal route selection loss function is specifically to select an expert whose prediction error is within a preset range, and is expressed as:
[0142]
[0143] In the formula, l e represents the label of the e-th expert; log represents the logarithmic function;
[0144] The calculation process of expert labels is as follows:
[0145]
[0146] Where Y i (s) Indicates the true value of the load data of the i-th charging pile in the time step; Q 1-q represents the quantile at 1-q; q represents a random integer in the interval [0, 1];
[0147] S4, iteratively training the hybrid expert prediction model with the optimal parameter group using the training set, and evaluating based on the test set and the preset performance evaluation index to obtain a trained hybrid expert prediction model;
[0148] The preset performance evaluation indicators are specifically mean absolute error MAE, mean absolute percentage error MAPE and root mean square error RMSE, which are expressed as follows:
[0149]
[0150] See also Figure 3 , the model error comparison results of the hybrid expert prediction model and the gradient boosting tree GDBT model, the geometric mean square error time series prediction GMEST model and the convolutional long short-term memory time series prediction CNN-LSTM model.
[0151] S5. Obtain charging load data within a current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain a prediction value corresponding to the charging load data within the time period to be predicted.
[0152] Example 2
[0153] This embodiment provides 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:
[0154] The data acquisition module is used to acquire historical charging load data and perform data cleaning; construct a historical charging load data set based on the cleaned historical charging load data, and divide the historical charging load data set into a training set and a test set according to a preset ratio; and transmit the historical charging load data set to the prediction model module;
[0155] The prediction model module has a built-in trained hybrid expert prediction model, which includes a time series embedding layer, an expert processing layer, a memory query layer, and a selection expert layer; wherein the expert processing layer includes a time series attention layer, a hybrid modeling layer, a time enhanced attention layer, and a feedforward neural layer, and the hybrid modeling layer sets different spatial modeling methods corresponding to different experts to capture the relationship between charging stations;
[0156] The expert layer is selected to perform expert routing calculation to obtain expert routing probability, and the expert output with the highest expert routing probability is selected as the final prediction result; the parameters of the hybrid expert prediction model are optimized using a joint loss function, and the joint loss function includes a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and evaluated based on the test set and a preset performance evaluation index to obtain a trained hybrid expert prediction model;
[0157] Acquire charging load data within a current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain a prediction value corresponding to the charging load data within the time period to be predicted;
[0158] The result output module is used to output the predicted value of the charging load data.
[0159] Example 3
[0160] 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, a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention is implemented.
[0161] Example 4
[0162] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, a charging station load prediction method based on a hybrid expert model as described in any embodiment of the present invention is implemented.
[0163] It is worth noting that the system, electronic device and computer-readable storage medium described in the present invention are based on the same principles as the method described in Example 1, and will not be described in detail here.
[0164] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A charging station load forecasting method based on a hybrid expert model, characterized in that: The method comprises: Obtain historical charging load data and perform data cleaning; construct a historical charging load data set based on the cleaned historical charging load data, and divide the historical charging load data set into a training set and a test set according to a preset ratio; Constructing a hybrid expert prediction model, the hybrid expert prediction model includes a time series embedding layer, an expert processing layer, a memory query layer and a selection expert layer; wherein the expert processing layer includes a time series attention layer, a hybrid modeling layer, a time enhanced attention layer and a feedforward neural layer, and the hybrid modeling layer sets different spatial modeling methods corresponding to different experts to capture the relationship between charging stations; The expert layer is selected to perform expert routing calculation to obtain expert routing probability, and the expert output with the highest expert routing probability is selected as the final prediction result; the parameters of the hybrid expert prediction model are optimized using a joint loss function, and the joint loss function includes a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and 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 the corresponding prediction value of the charging load data in the time period to be predicted.
2. A charging station load prediction method based on a hybrid expert model according to claim 1, characterized in that: 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, wherein: The time feature embedding is specifically to convert the time series of historical charging load data into a time embedding vector using the Time2Vec method, which is expressed as follows: Where, TIM(τ)[z] represents the time embedding vector value of the z-th dimension; τ represents the time information in the historical charging load data; ω represents the weight matrix; φ represents the nonlinear change parameter; h represents the dimension; F represents the periodic activatable function; z represents the index value of the z-th dimension; The feature merging is specifically to connect the time embedding vector with the historical charging load data except the time information, and use linear projection mapping to reduce the dimension, which can be expressed as: In the formula, t represents the time; represents the embedding feature at time t; X' (t) Represents the historical charging load data except time information; TIM(τ (t) ) represents the time embedding vector at time t; W proj Represents the preset linear projection matrix; Concat represents the connection function.
3. A charging station load forecasting method based on a hybrid expert model according to claim 2, characterized in that: The expert processing layer includes a temporal attention layer, a hybrid modeling layer, a temporal enhanced attention layer and a feedforward neural layer. The temporal attention layer obtains the embedded features, uses the self-attention mechanism to calculate enhanced features, and performs layer normalization and skip connections, which can be expressed as follows: Where s represents the time step; s1 represents the start time of the time step; s2 represents the end time of the time step; represents the enhanced features within the time step; Q s K is the query vector representing the embedded features within a time step; s V represents the key of the embedded features within a time step; s represents the value of the embedded feature within the time step; W Q Represents the linear change matrix of the query vector; W K Represents the linear change matrix of the bond; W V Represents the linear change matrix of the value; Attention represents the attention mechanism.
4. The method for predicting charging station load based on a hybrid expert model according to claim 3, characterized in that: The hybrid modeling layer is provided with three spatial modeling methods, namely, expert model 1, expert model 2 and expert model 1, wherein: The expert model 1 does not consider the spatial relationship between charging stations, uses the unit matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connection, which can be expressed as: In the formula, H EX1 represents the output features of expert model 1; I represents the unit matrix; The expert model 2 is specifically a graph convolutional neural network (GNN) convolutional layer, which uses a learnable adjacency matrix to represent the spatial relationship between charging stations, and performs layer normalization and skip connections, which can be expressed as: In the formula, H EX2 represents the output features of expert model 2; represents a learnable adjacency matrix; softmax represents a normalization function; relu() represents an activation function; g() represents an embedding function; θ represents a learnable parameter; ZT represents a transposition operation; W GNN () represents the weight matrix of the graph convolutional layer; The expert model 3 uses a multi-head attention mechanism to reflect the spatial relationship between charging stations. The expert model 3 includes d k Layer attention layer and linear layer, and perform layer normalization and skip connection, expressed in formula; In the formula, H EX3 represents the output features of expert model three; represents the attention weight of the i-th charging station to the j-th charging station in the k-th attention layer; represents the query vector of the i-th charging station in the k-th attention layer; represents the key vector of the jth charging station in the kth attention layer; Represents the query vector matrix of the k-th attention layer; represents the key matrix of the kth attention layer; d k represents the dimension of the preset attention layer; i represents the index value of the i-th charging station; j represents the index value of the j-th charging station; N represents the number of charging stations; exp represents the exponential function; k represents the index value of the k-th attention layer; represents the value of the jth charging station in the kth attention layer; W EX3 Represents the weight matrix of the Linear layer.
5. The method for predicting charging station load based on a hybrid expert model according to claim 4, characterized in that: The output features of the hybrid modeling layer are sequentially passed through the time-enhanced attention layer and the feedforward neural layer to obtain the output features of the expert processing layer, specifically: The temporal enhanced attention layer obtains the output features of the hybrid modeling layer, calculates the temporal enhanced features, and performs layer normalization and skip connections, which can be expressed as: In the formula, β is represents the enhanced attention weight of the i-th charging station in the time step; represents the output vector of the nth expert model in the time step; T represents the time range; TW K represents the preset learnable linear transformation matrix; TIM(τ(s)) represents the time embedding vector value within the time step; H time (s) represents the temporal enhancement feature within a time step; TW V The linear transformation matrix representing the temporal augmented attention layer value vector; The feedforward neural layer uses two layers of linear transformation and a nonlinear activation function to perform nonlinear transformation on the normalized time enhancement features, and performs layer normalization and skip connection, which can be expressed as follows: H FFN1 =H time (s)W1+b1; A relu =relu(H FFN1 ); H FFN =H relu W2+b2; In the formula, H FFN represents the output features of the feedforward neural layer, that is, the output features of the expert processing layer; H FFN1 represents the output features of the first layer of linear transformation; W1 represents the weight matrix of the first layer of linear transformation; b1 represents the bias of the first layer of linear transformation; H relu represents the output of the nonlinear transformation activation function; W2 represents the weight matrix of the second-layer linear transformation; b2 represents the bias of the second-layer linear transformation.
6. A charging station load prediction method based on a hybrid expert model according to claim 5, characterized in that: The memory query layer obtains the output features of the expert processing layer and calculates the query vector of the output features, which can be expressed as: In the formula, represents the query vector of the i-th charging pile in the time step; Wu q b represents the linear transformation matrix of the query vector; q represents the bias of the query vector; In the formula, μ r Represents the weight value of the rth memory item; represents the memory characteristics of the i-th charging station in the time step; M[r] represents the rth memory item in the memory bank; m represents the number of memory items in the memory bank; r represents the index value of the rth memory item; The memory features are input into the expert selection layer, and the routing probability of each expert is calculated, which is expressed as: In the formula, H e represents the output of the e-th expert; g() represents the similarity function; E represents the number of experts; e represents the index value of the e-th expert; p e represents the routing probability of the e-th expert; According to the expert routing probability results, the expert output with the highest expert routing probability is selected as the final prediction result, which is expressed as: In the formula, e * represents the index value of the expert with the highest routing summary; argmax represents the function of obtaining the maximum routing probability; It represents the load forecast of the i-th charging pile in the time step, which is the final forecast result.
7. A charging station load forecasting method based on a hybrid expert model according to claim 6, characterized in that: The parameters of the hybrid expert prediction model are optimized using a joint loss function, where the joint loss function is specifically a combination of a prediction error loss function and an expert routing loss function to obtain an optimal parameter group, where: The joint loss function is expressed as follows: L=L forecast +L route ; Where, L forecast represents the prediction error loss; L route represents the best routing loss; The prediction error loss function specifically measures the difference between the predicted value and the true value, and is expressed as follows: In the formula, represents the predicted value; Y represents the true value; C represents the number of charging pile input features; c represents the index value of the number of the c-th charging pile input features; The optimal route selection loss function is specifically to select an expert whose prediction error is within a preset range, and is expressed as: In the formula, l e represents the label of the e-th expert; log represents the logarithmic function; The calculation process of expert labels is as follows: In the formula, Indicates the true value of the load data of the i-th charging pile in the time step; Q 1-q Represents the quantile at 1-q; q represents a random integer in the interval [0, 1].
8. A charging station load forecasting system based on a hybrid expert model, 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; construct a historical charging load data set based on the cleaned historical charging load data, and divide the historical charging load data set into a training set and a test set according to a preset ratio; and transmit the historical charging load data set to the prediction model module; The prediction model module has a built-in trained hybrid expert prediction model, which includes a time series embedding layer, an expert processing layer, a memory query layer, and a selection expert layer; wherein the expert processing layer includes a time series attention layer, a hybrid modeling layer, a time enhanced attention layer, and a feedforward neural layer, and the hybrid modeling layer sets different spatial modeling methods corresponding to different experts to capture the relationship between charging stations; The expert layer is selected to perform expert routing calculation to obtain expert routing probability, and the expert output with the highest expert routing probability is selected as the final prediction result; the parameters of the hybrid expert prediction model are optimized using a joint loss function, and the joint loss function includes a prediction error loss function and an expert routing loss function; the hybrid expert prediction model is iteratively trained using the training set, and evaluated based on the test set and a preset performance evaluation index to obtain a trained hybrid expert prediction model; Acquire charging load data within a current preset time period, input the charging load data into the trained hybrid expert prediction model, and obtain a prediction value corresponding to the charging load data within the time period to be predicted; The result output module is used to output the predicted value of the charging load data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the charging station load prediction method based on a hybrid expert model as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a charging station load prediction method based on a hybrid expert model as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Charging pile load prediction method and device
CN118114798A
Knowledge and data collaboratively driven unbalanced clinical data classification system
CN116502129A
Electric energy prediction method and system based on hybrid expert system and time sequence
CN116742618A
Model reasoning method and device based on mixed experts
CN118657218A
Heterogeneous multi-mode hybrid expert adapter
CN118708381A
Cited By
AAO process optimization control method and system based on Transform multi-head self-attention mechanism
CN120370857A
Self-adaptive building load prediction method based on load drift perception
CN120410267A
Charging demand prediction method for highway new energy vehicle charging station
CN120952421A
Multi-scene electric quantity load prediction method and system based on hybrid expert model
CN121172755A
A multi-scene power load prediction method and system based on a hybrid expert model
CN121172755B