Charging power distribution method and system
By combining the LSTM-Transformer hybrid architecture and transfer learning technology with multi-objective optimization, the problems of vehicle model differences and grid fluctuations in charging power allocation are solved, realizing intelligent dynamic charging power allocation in data-scarce scenarios, thereby improving grid stability and user satisfaction.
Patent Information
- Application Number
- CN202511464783.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-02-24
AI Technical Summary
In different scenarios, traditional charging power allocation methods cannot fully take into account vehicle differences and grid fluctuations, resulting in decreased grid stability, reduced user satisfaction, and shortened equipment lifespan. Furthermore, optimization algorithms are difficult to deploy effectively in scenarios with scarce data.
A deep learning model with an LSTM-Transformer hybrid architecture is adopted, which combines transfer learning and multi-objective optimization techniques. By transferring the parameters and features of the pre-trained model and combining them with the particle swarm optimization algorithm, a charging power allocation system is constructed for intelligent dynamic allocation of charging power.
It enables intelligent dynamic charging power allocation in data-scarce scenarios, improving grid stability, user satisfaction, and equipment lifespan, reducing the initial training data requirements, and enhancing the model's adaptability and prediction accuracy.
Smart Images

Figure CN121559847A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of transfer learning technology, and specifically to a charging power allocation method and system. Background Technology
[0002] With the increasing popularity of electric vehicles, the demand for charging stations is growing daily. In different scenarios, such as urban fast-charging stations and charging stations in low-temperature environments, charging stations face complex and ever-changing charging needs. When allocating charging power to multiple electric vehicles, traditional power allocation methods often rely on fixed rules, such as allocating power according to the order of plugging in or evenly distributing power. These methods often fail to fully consider the characteristics of different scenarios, such as vehicle model differences and grid fluctuations, leading to problems such as decreased grid stability, reduced user satisfaction, and shortened equipment lifespan.
[0003] Dynamic allocation based on optimization algorithms such as genetic algorithms and particle swarm optimization requires a large amount of historical data for training, which is difficult to deploy effectively in new stations or special scenarios such as mines and highway service areas due to data scarcity. Since charging data varies significantly across different scenarios—for example, the power grid characteristics and user behavior differ significantly between the low temperatures of winter in the north and the high load of summer in the south—directly applying a model suitable for one specific scenario to other scenarios will result in a significant decrease in the model's prediction accuracy and decision-making performance.
[0004] Therefore, how to intelligently and dynamically allocate charging power in scenarios where data is scarce is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a charging power allocation method and system that can intelligently and dynamically allocate charging power in scenarios where data is scarce, and has advantages in terms of efficiency, safety, and rationality.
[0006] The technical solution adopted in this invention is as follows:
[0007] A charging power allocation method includes the following steps: acquiring charging data in a source domain and charging data in a target domain; constructing a deep learning model; pre-training the deep learning model with the charging data in the source domain to obtain a pre-trained model; training the deep learning model with the charging data in the target domain by transferring the parameters and features of the pre-trained model to obtain a transfer learning model; processing the data of the charging piles to be allocated in the target domain using the transfer learning model to obtain power association data of the charging piles to be allocated; and performing multi-objective optimization using the power association data of the charging piles to be allocated to obtain a charging power allocation scheme for the charging piles to be allocated.
[0008] The deep learning model is an LSTM-Transformer hybrid architecture.
[0009] When training and applying the transfer learning model, the loss function used is the total loss that fuses the differences in data distribution between the source and target domains based on the base loss.
[0010] Multi-objective optimization is performed using the power correlation data of the charging piles to be allocated. Specifically, this includes: constructing an objective function by taking multiple power correlation parameters of the charging piles to be allocated as objectives and combining the weights of each objective, wherein the multiple power correlation parameters are obtained through real-time monitoring or migration, and the weights are obtained through migration; obtaining constraints through migration; obtaining an initial solution of the particle swarm optimization algorithm through migration; and solving the objective function using the particle swarm optimization algorithm to obtain the charging power allocation scheme for the charging piles to be allocated.
[0011] The charging power allocation method further includes: modifying the transfer knowledge according to the actual charging power allocation scheme in the target domain, and iteratively training the transfer learning model.
[0012] A charging power allocation system includes: a data acquisition module for acquiring charging data in a source domain and charging data in a target domain; a model building module for building a deep learning model; a pre-training module for pre-training the deep learning model using the charging data in the source domain to obtain a pre-trained model; and a transfer learning module for training the deep learning model using the charging data in the target domain by transferring the parameters and features of the pre-trained model to obtain a transfer learning model.
[0013] The model application module is used to process the data of the charging piles to be allocated in the target domain through the transfer learning model to obtain the power association data of the charging piles to be allocated; the power allocation module is used to perform multi-objective optimization based on the power association data of the charging piles to be allocated to obtain the charging power allocation scheme of the charging piles to be allocated.
[0014] The deep learning model is an LSTM-Transformer hybrid architecture.
[0015] When training and applying the transfer learning model, the loss function used is the total loss that fuses the differences in data distribution between the source and target domains based on the base loss.
[0016] The power allocation module is specifically used to: construct an objective function by taking multiple power-related parameters of the charging pile to be allocated as targets and combining the weights of each target, wherein the multiple power-related parameters are obtained through real-time monitoring or migration, and the weights are obtained through migration; obtain constraint conditions through migration; obtain an initial solution of the particle swarm optimization algorithm through migration; and solve the objective function using the particle swarm optimization algorithm to obtain the charging power allocation scheme of the charging pile to be allocated.
[0017] The charging power allocation system further includes an iterative training module, which is used to correct the transfer knowledge according to the actual charging power allocation scheme in the target domain and to iteratively train the transfer learning model.
[0018] The beneficial effects of this invention are:
[0019] This invention utilizes transfer learning and multi-objective optimization techniques to intelligently and dynamically allocate charging power in data-scarce scenarios, offering advantages in efficiency, safety, and rationality. Attached Figure Description
[0020] Figure 1 This is a flowchart of the charging power allocation method according to an embodiment of the present invention;
[0021] Figure 2 This is a block diagram of a charging power distribution system according to an embodiment of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] like Figure 1 As shown, the charging power allocation method of this embodiment includes the following steps:
[0024] S1, acquire charging data from the source domain and charging data from the target domain.
[0025] In one embodiment of the present invention, the charging data in the source domain can be charging data in some mature scenarios, such as charging data of urban fast charging stations, which is relatively abundant; the charging data in the target domain can be charging data in some new sites or special scenarios, such as charging data of charging stations in low-temperature environments, which is relatively scarce.
[0026] Charging data can include scenario-based charging data and related supporting data, which can be obtained from charging pile operators, vehicle manufacturers, and power grid companies. Scenario-based charging data may include, but is not limited to, single-pile voltage V (unit: V), current I (unit: A), charging time T (unit: min), user rating S, connected vehicle battery capacity C, and current remaining charge SOC, among other battery parameters. Related supporting data may include, but is not limited to, real-time grid load L (unit: kW), voltage fluctuation ΔV (unit: V), frequency deviation Δf (unit: Hz), vehicle navigation information N (such as estimated arrival time, emergency charging indicator), and environmental data such as ambient temperature Tamb. In the following description, the subscript s represents data from the source domain, and the subscript t represents data from the target domain.
[0027] After obtaining the charging data from the source and target domains, the data can be cleaned and labeled. For example, a data cleaning example is as follows: the 3σ criterion can be used to remove outliers from numerical data such as voltage and current; that is, for data point x, if... If it is an outlier, it will be treated as an outlier and removed, where is The data represents the mean, and σ represents the standard deviation. Examples of missing value imputation are as follows: For missing SOC, ambient temperature, and other data, linear interpolation is used to impute missing values (e.g., fitting missing values based on SOC data from five adjacent time stamps). Examples of contextualized annotation are as follows: Data is labeled according to dimensions such as scenario C, geographical location G, and vehicle type M to provide high-quality data for subsequent transfer learning. For example, data on urban fast charging stations is labeled as C1 (scenario: urban fast charging), G1 (geographical location: XX city XX district), and M1 (vehicle type: BYD).
[0028] Then, the data can be partitioned. Let the source domain be... ,in It is the input sample from the source domain. These are the corresponding tags. The number of samples in the source domain; the target domain is... ,in These are input samples from the target domain. It's a tag. This refers to the number of samples in the target domain. It is assumed that the input feature spaces of the source and target domains are the same, i.e. However, the data distribution is different. The data is divided as follows: source domain data is divided into a pre-training set (for model initialization) and a validation set (for source model tuning) in a 7:3 ratio, and target domain data is divided into a fine-tuning set (for transfer learning fine-tuning) and a test set (for model performance validation) in an 8:2 ratio.
[0029] S2, build a deep learning model.
[0030] Considering that charging demand, such as charging time and power requirements, is dynamically affected by multiple factors, it often presents two core modes. The first is the time-dependent mode, where the charging process is a continuous time series (e.g., a vehicle's current gradually decreases from 80A to 50A, corresponding to a SOC increase from 20% to 80%), requiring the capture of the "correlation between the current state and historical states" (e.g., voltage fluctuations in the first 10 minutes affect subsequent charging speed). The second is the long-distance correlation mode, where charging demand is related to non-adjacent time / space information (e.g., the charging peak at 8 AM every Monday, the mutual influence of load distribution among three charging piles in the same area), requiring the capture of the "global correlation of non-continuous data points." Since LSTM excels at capturing the former (time-dependent) and Transformer excels at capturing the latter (long-distance correlation), the deep learning model in this embodiment adopts an LSTM-Transformer hybrid architecture, enabling joint modeling of "local temporal details + global correlation patterns," improving prediction accuracy in a single scenario.
[0031] The deep learning model in this embodiment of the invention can be a charging demand prediction model, which can predict charging demand values such as charging time based on the above-mentioned charging data other than charging demand.
[0032] The LSTM part of a deep learning model is used to capture long-term dependencies in time series data, and its hidden layer state update formula is as follows:
[0033]
[0034]
[0035]
[0036]
[0037]
[0038] in, , , These are the input gate, forget gate, and output gate, used to control the inflow, retention, and outflow of information. τ in the subscript represents time; σ is the sigmoid activation function, which maps the input to the (0, 1) interval to represent the degree of gate opening; each subscripted W is an element in the weight matrix W, used to perform weighted transformations on the input data and hidden layer states; each subscripted b is a bias vector, used to increase the expressive power of the model. This indicates element-wise multiplication; This refers to the state of memory cells, used to store long-term information; This is the hidden layer state, which is used as the output at the current moment and passed to the next moment.
[0039] The Transformer part of a deep learning model is used to handle long-range dependencies and feature interactions in sequences. This is achieved through a multi-head attention mechanism, and its computation process is as follows:
[0040]
[0041]
[0042] in, , , The input matrix is used to calculate attention weights, retrieve information, and acquire information, respectively. The key dimension is used to scale the attention score and prevent the gradient of the softmax function from vanishing due to an excessively large dot product. The number of heads is used to compute attention in parallel for different representation subspaces, enhancing the model's ability to capture complex relationships; The weight matrix is used to perform a linear transformation on the input; the softmax function is used to normalize the attention scores into a probability distribution; Concat represents the concatenation operation, combining multiple heads. i The outputs are concatenated and then linearly transformed to obtain the final multi-head attention output MultiHead(Q,K,V).
[0043] In the prediction output layer, the temporal features of the LSTM are concatenated with the global features of the Transformer, and the predicted charging time and other charging demand values are output through a two-layer fully connected network. The loss function is the mean squared error.
[0044]
[0045] Where MES represents the mean squared error, and N is the sample size. This represents the actual charging time. This is the predicted charging time.
[0046] S3 uses charging data from the source domain to pre-train the deep learning model, resulting in a pre-trained model.
[0047] S4, by transferring the parameters and features of the pre-trained model, trains the deep learning model with charging data from the target domain to obtain the transfer learning model.
[0048] It should be understood that there are significant differences in the distribution of charging data in different scenarios. For example, in the source scenario (urban fast charging station): the ambient temperature is 15~25℃, the voltage is stable at 370~390V, and the average charging time is 30~60 minutes; in the target scenario (low temperature charging station): the ambient temperature is -10~5℃, the voltage fluctuates at 350~380V, and the average charging time is 45~80 minutes. However, there is common knowledge in both scenarios, such as the basic rule that "the higher the voltage and the greater the current, the shorter the charging time".
[0049] The purpose of using transfer learning in this embodiment of the invention is twofold: first, to reuse the common knowledge of the source scenario (with sufficient data), such as the basic association of "voltage-current-duration" learned by LSTM and the association of "time period-demand" learned by Transformer, so as to avoid training the model from scratch in the target scenario (with scarce data); second, to reduce the scene differences through feature alignment, such as the MMD algorithm, so that the knowledge of the source scenario can be adapted to the special rules of the target scenario, such as "the current decays faster as the SOC increases" at low temperatures, and finally achieve high-precision prediction of the target scenario.
[0050] The embodiments of the present invention employ a strategy that combines parameter transfer and feature transfer.
[0051] Specifically, the parameters of the LSTM-Transformer model pre-trained in the source domain (urban fast charging stations) can be... As initial parameters of the target domain model Only the parameters of the Transformer multi-head attention layer and output layer are fine-tuned, and the parameters are updated with the following optimization objectives:
[0052]
[0053] in, Losses in the target area =0.01 is the regularization coefficient, which balances the target domain loss and parameter bias.
[0054] During the training process of a transfer learning model, a feature mapping function is learned. This maps samples from the source and target domains to a common feature space. This aims to make the data distributions of the source and target domains as similar as possible within the common feature space. In the common feature space, the difference between the data distributions of the source and target domains is minimized, and the maximum mean discrepancy (MMD) is used to measure the distribution difference.
[0055]
[0056] in, This represents the norm in the reproducing kernel Hilbert space (RKHS). The feature mapping function is optimized. , minimize This can make the distribution of the source domain and the target domain in the common feature space more similar.
[0057] Therefore, the total loss is:
[0058]
[0059] Where TotalLoss is the total loss, and α is the weight of the maximum average difference, which can be used to ensure the alignment of feature distributions across scenes. In a specific embodiment, α can be 0.05.
[0060] The mean squared error (MES) originally used in deep learning models is called the base loss, while the maximum mean difference (MMD) is the difference in data distribution between the source domain and the target domain. In other words, in the embodiments of this invention, when training and applying the transfer learning model, the loss function used is the total loss that combines the base loss with the difference in data distribution between the source domain and the target domain, which is the aforementioned TotalLoss.
[0061] During the model validation phase, mean absolute error (MAE) and prediction accuracy (Acc) can be used as evaluation metrics, and their formulas are as follows:
[0062]
[0063]
[0064] Furthermore, the original Maximum Mean Difference (MMD) formula applies equal weighting to all samples in both the source and target domains. Considering the significant differences in scenario representativeness among samples in charging pile scenarios—for example, in low-temperature scenarios, samples at -10℃ are more scenario-specific than those at 5℃—in one embodiment of this invention, dynamic weights can be assigned to samples to enhance the role of key scenario samples in distribution alignment. Specifically, historical data can be weighted based on similarity according to factors such as geographical location and vehicle model distribution. The weighting parameters can be adjusted through cross-validation to improve the prediction accuracy of new charging stations. The specific formula for the weighted maximum mean difference is as follows:
[0065]
[0066] in, and The sample weights are calculated as follows:
[0067] ,
[0068] in, For typical scenarios in the power source field (such as 25℃+380V in urban fast charging stations). The scene features (temperature + voltage) of the source domain sample k. Centered on typical scenarios in the target domain, The scene features of the target domain sample m; For Euclidean distance, This is a bandwidth parameter used to control the rate of weight decay.
[0069] S5 processes the data of the charging piles to be assigned in the target domain through a transfer learning model to obtain the power correlation data of the charging piles to be assigned.
[0070] The model can input charging data (excluding charging demand) of unassigned charging piles in the target area into a transfer learning model, outputting predicted charging demand values, including predicted charging time per pile (e.g., vehicle A requires 40 minutes, vehicle B requires 60 minutes) and group demand trends (e.g., an estimated 5 new charging vehicles are expected to be added in the next hour, with a total demand of approximately 300 kWh). Then, power correlation data for the unassigned charging piles is selected from all the data, including grid stability data, user satisfaction data, and equipment lifespan data.
[0071] S6. Perform multi-objective optimization using the power correlation data of the charging piles to be allocated to obtain the charging power allocation scheme for the charging piles to be allocated.
[0072] Specifically, multiple power-related parameters of the charging piles to be allocated can be used as objectives, and an objective function can be constructed by combining the weights of each objective. The multiple power-related parameters are obtained through real-time monitoring or migration, and the weights are obtained through migration. The constraints are obtained through migration. Then, the initial solution of the particle swarm optimization algorithm is obtained through migration. The objective function is solved by the particle swarm optimization algorithm (PSO) to obtain the charging power allocation scheme of the charging piles to be allocated.
[0073] For example, the power correlation data for the charging piles to be allocated includes grid stability data, user satisfaction data, and equipment lifespan data. Grid stability is measured by voltage fluctuation ΔV and frequency deviation Δf, and charging waiting time T is used as the basis for calculation. wait Charging efficiency η measures user satisfaction, and the loss rate of key components λ represents equipment lifespan. Therefore, the constructed objective function is:
[0074]
[0075] Among them, V rated For the rated voltage, f ratedThe rated frequency is α, with a numerical subscript indicating the weight of each target.
[0076] Weight transfer refers to retrieving the K scenes from historical data in the source domain that are most similar to the current scene features in the target domain, extracting the optimal weights of these K scenes, and obtaining the initial weight α of the target domain by weighted averaging (the higher the similarity, the larger the preset weight). j j ranges from 1 to 5.
[0077] For example, when migrating constraints, if the source domain has a power limit constraint, "the power limit of the same type of charging pile at 25℃ is 60kW", it will be corrected by the "temperature-power decay curve" learned from the source domain when migrating to the target domain (-45℃). For grid load constraints, if the source domain has a "total power must be ≤0.7 when the load rate is 80%", it will be corrected by the mapping relationship between "grid vulnerability and constraint coefficient" in the source domain after migrating to the target domain, taking into account the vulnerability of the target grid (such as an old grid).
[0078] For the migration of the initial solution of the particle swarm optimization algorithm, for example, it can be selected from the historical best solutions of similar scenarios in the source domain and fine-tuned according to the characteristics of the target domain (such as modifying the "50kW+30kW" scheme in the source domain to "45kW+28kW" at low temperature) to avoid the low optimization efficiency caused by insufficient data in the target domain.
[0079] By solving the problem using the particle swarm optimization algorithm, the optimal power allocation scheme for the charging piles to be allocated can be obtained, and the charging power can be allocated to each vehicle plugged in using the optimal power allocation scheme.
[0080] Furthermore, in one embodiment of the present invention, the transfer knowledge can be modified according to the actual charging power allocation scheme in the target domain, and the transfer learning model can be iteratively trained.
[0081] Specifically, the deviation between the actual optimal weights in the target domain and the initial weights during transfer can be calculated, updating the "scene feature-weight" mapping relationship. If a constraint (such as a 51kW power limit) causes the charging time to exceed the user's tolerance range, the "temperature-power decay curve" is corrected based on feedback data, and adjusted to 53kW in the next transfer round. Finally, the feedback data is added to the target domain dataset, and the LSTM-Transformer prediction model and the scene matching algorithm of transfer learning are fine-tuned, forming a closed loop of "transfer-optimization-feedback-correction". This allows for continuous model optimization, further improving the effectiveness of charging power allocation in the target domain.
[0082] The charging power allocation method according to embodiments of the present invention, through transfer learning and multi-objective optimization techniques, can intelligently and dynamically allocate charging power in data-scarce scenarios, and has advantages in terms of efficiency, safety, and rationality.
[0083] Specifically, transfer learning can reduce the initial training data requirements of the target domain, improve power allocation efficiency, and reduce the risk of grid overload. By combining parameter transfer and feature transfer, when there are significant differences between the target domain and the source domain, fine-tuning can be used to adapt to changes in new scenarios, thereby improving model accuracy. Through multi-objective collaborative optimization, when balancing multiple objectives such as grid stability, user satisfaction, and equipment lifespan, transfer learning can draw on optimization experience from other energy fields or similar scenarios, adjust the weights of each objective, and achieve multi-objective balance. Intelligent dynamic allocation of charging power can quickly and accurately adjust the power allocation scheme based on real-time data and predictive analysis, playing a key role in ensuring stable grid operation, improving user satisfaction, and extending equipment lifespan, further enhancing the overall performance and intelligence level of the charging pile system.
[0084] Corresponding to the charging power allocation method in the above embodiments, the present invention also proposes a charging power allocation system.
[0085] like Figure 2 As shown, the charging power allocation system of this embodiment includes a data acquisition module 10, a model building module 20, a pre-training module 30, a transfer training module 40, a model application module 50, and a power allocation module 60. Specifically, the data acquisition module 10 acquires charging data from the source domain and charging data from the target domain; the model building module 20 constructs a deep learning model; the pre-training module 30 pre-trains the deep learning model using the charging data from the source domain to obtain a pre-trained model; the transfer training module 40 trains the deep learning model using the charging data from the target domain by transferring the parameters and features of the pre-trained model to obtain a transfer learning model; the model application module 50 processes the data of the charging piles to be allocated in the target domain using the transfer learning model to obtain power association data of the charging piles to be allocated; and the power allocation module 60 performs multi-objective optimization using the power association data of the charging piles to be allocated to obtain a charging power allocation scheme for the charging piles to be allocated.
[0086] In one embodiment of the present invention, the charging data in the source domain can be charging data in some mature scenarios, such as charging data of urban fast charging stations, which is relatively abundant; the charging data in the target domain can be charging data in some new sites or special scenarios, such as charging data of charging stations in low-temperature environments, which is relatively scarce.
[0087] Charging data can include scenario-based charging data and related supporting data, which can be obtained from charging pile operators, vehicle manufacturers, and power grid companies. Scenario-based charging data may include, but is not limited to, single-pile voltage V (unit: V), current I (unit: A), charging time T (unit: min), user rating S, connected vehicle battery capacity C, and current remaining charge SOC, among other battery parameters. Related supporting data may include, but is not limited to, real-time grid load L (unit: kW), voltage fluctuation ΔV (unit: V), frequency deviation Δf (unit: Hz), vehicle navigation information N (such as estimated arrival time, emergency charging indicator), and environmental data such as ambient temperature Tamb. In the following description, the subscript s represents data from the source domain, and the subscript t represents data from the target domain.
[0088] After obtaining the charging data from the source and target domains, the data can be cleaned and labeled. For example, a data cleaning example is as follows: the 3σ criterion can be used to remove outliers from numerical data such as voltage and current; that is, for data point x, if... If it is an outlier, it will be treated as an outlier and removed, where is The data represents the mean, and σ represents the standard deviation. Examples of missing value imputation are as follows: For missing SOC, ambient temperature, and other data, linear interpolation is used to impute missing values (e.g., fitting missing values based on SOC data from five adjacent time stamps). Examples of contextualized annotation are as follows: Data is labeled according to dimensions such as scenario C, geographical location G, and vehicle type M to provide high-quality data for subsequent transfer learning. For example, data on urban fast charging stations is labeled as C1 (scenario: urban fast charging), G1 (geographical location: XX city XX district), and M1 (vehicle type: BYD).
[0089] Then, the data can be partitioned. Let the source domain be... ,in It is the input sample from the source domain. These are the corresponding tags. The number of samples in the source domain; the target domain is... ,in These are input samples from the target domain. It's a tag. This refers to the number of samples in the target domain. It is assumed that the input feature spaces of the source and target domains are the same, i.e. However, the data distribution is different. The data is divided as follows: source domain data is divided into a pre-training set (for model initialization) and a validation set (for source model tuning) in a 7:3 ratio, and target domain data is divided into a fine-tuning set (for transfer learning fine-tuning) and a test set (for model performance validation) in an 8:2 ratio.
[0090] Considering that charging demand, such as charging time and power requirements, is dynamically affected by multiple factors, it often presents two core modes. The first is the time-dependent mode, where the charging process is a continuous time series (e.g., a vehicle's current gradually decreases from 80A to 50A, corresponding to a SOC increase from 20% to 80%), requiring the capture of the "correlation between the current state and historical states" (e.g., voltage fluctuations in the first 10 minutes affect subsequent charging speed). The second is the long-distance correlation mode, where charging demand is related to non-adjacent time / space information (e.g., the charging peak at 8 AM every Monday, the mutual influence of load distribution among three charging piles in the same area), requiring the capture of the "global correlation of non-continuous data points." Since LSTM excels at capturing the former (time-dependent) and Transformer excels at capturing the latter (long-distance correlation), the deep learning model in this embodiment adopts an LSTM-Transformer hybrid architecture, enabling joint modeling of "local temporal details + global correlation patterns," improving prediction accuracy in a single scenario.
[0091] The deep learning model in this embodiment of the invention can be a charging demand prediction model, which can predict charging demand values such as charging time based on the above-mentioned charging data other than charging demand.
[0092] The LSTM part of a deep learning model is used to capture long-term dependencies in time series data, and its hidden layer state update formula is as follows:
[0093]
[0094]
[0095]
[0096]
[0097]
[0098] in, , , These are the input gate, forget gate, and output gate, used to control the inflow, retention, and outflow of information. τ in the subscript represents time; σ is the sigmoid activation function, which maps the input to the (0, 1) interval to represent the degree of gate opening; each subscripted W is an element in the weight matrix W, used to perform weighted transformations on the input data and hidden layer states; each subscripted b is a bias vector, used to increase the expressive power of the model. This indicates element-wise multiplication; This refers to the state of memory cells, used to store long-term information; This is the hidden layer state, which is used as the output at the current moment and passed to the next moment.
[0099] The Transformer part of a deep learning model is used to handle long-range dependencies and feature interactions in sequences. This is achieved through a multi-head attention mechanism, and its computation process is as follows:
[0100]
[0101]
[0102] in, , , The input matrix is used to calculate attention weights, retrieve information, and acquire information, respectively. The key dimension is used to scale the attention score and prevent the gradient of the softmax function from vanishing due to an excessively large dot product. The number of heads is used to compute attention in parallel for different representation subspaces, enhancing the model's ability to capture complex relationships; The weight matrix is used to perform a linear transformation on the input; the softmax function is used to normalize the attention scores into a probability distribution; Concat represents the concatenation operation, combining multiple heads. i The outputs are concatenated and then linearly transformed to obtain the final multi-head attention output MultiHead(Q,K,V).
[0103] In the prediction output layer, the temporal features of the LSTM are concatenated with the global features of the Transformer, and the predicted charging time and other charging demand values are output through a two-layer fully connected network. The loss function is the mean squared error.
[0104]
[0105] Where MES represents the mean squared error, and N is the sample size. This represents the actual charging time. This is the predicted charging time.
[0106] It should be understood that there are significant differences in the distribution of charging data in different scenarios. For example, in the source scenario (urban fast charging station): the ambient temperature is 15~25℃, the voltage is stable at 370~390V, and the average charging time is 30~60 minutes; in the target scenario (low temperature charging station): the ambient temperature is -10~5℃, the voltage fluctuates at 350~380V, and the average charging time is 45~80 minutes. However, there is common knowledge in both scenarios, such as the basic rule that "the higher the voltage and the greater the current, the shorter the charging time".
[0107] The purpose of using transfer learning in this embodiment of the invention is twofold: first, to reuse the common knowledge of the source scenario (with sufficient data), such as the basic association of "voltage-current-duration" learned by LSTM and the association of "time period-demand" learned by Transformer, so as to avoid training the model from scratch in the target scenario (with scarce data); second, to reduce the scene differences through feature alignment, such as the MMD algorithm, so that the knowledge of the source scenario can be adapted to the special rules of the target scenario, such as "the current decays faster as the SOC increases" at low temperatures, and finally achieve high-precision prediction of the target scenario.
[0108] The embodiments of the present invention employ a strategy that combines parameter transfer and feature transfer.
[0109] Specifically, the parameters of the LSTM-Transformer model pre-trained in the source domain (urban fast charging stations) can be... As initial parameters of the target domain model Only the parameters of the Transformer multi-head attention layer and output layer are fine-tuned, and the parameters are updated with the following optimization objectives:
[0110]
[0111] in, Losses in the target area =0.01 is the regularization coefficient, which balances the target domain loss and parameter bias.
[0112] During the training process of a transfer learning model, a feature mapping function is learned. This maps samples from the source and target domains to a common feature space. This aims to make the data distributions of the source and target domains as similar as possible within the common feature space. In the common feature space, the difference between the data distributions of the source and target domains is minimized, and the maximum mean discrepancy (MMD) is used to measure the distribution difference.
[0113]
[0114] in, This represents the norm in the reproducing kernel Hilbert space (RKHS). The feature mapping function is optimized. , minimize This can make the distribution of the source domain and the target domain in the common feature space more similar.
[0115] Therefore, the total loss is:
[0116]
[0117] Where TotalLoss is the total loss, and α is the weight of the maximum average difference, which can be used to ensure the alignment of feature distributions across scenes. In a specific embodiment, α can be 0.05.
[0118] The mean squared error (MES) originally used in deep learning models is called the base loss, while the maximum mean difference (MMD) is the difference in data distribution between the source domain and the target domain. In other words, in the embodiments of this invention, when training and applying the transfer learning model, the loss function used is the total loss that combines the base loss with the difference in data distribution between the source domain and the target domain, which is the aforementioned TotalLoss.
[0119] During the model validation phase, mean absolute error (MAE) and prediction accuracy (Acc) can be used as evaluation metrics, and their formulas are as follows:
[0120]
[0121]
[0122] Furthermore, the original Maximum Mean Difference (MMD) formula applies equal weighting to all samples in both the source and target domains. Considering the significant differences in scenario representativeness among samples in charging pile scenarios—for example, in low-temperature scenarios, samples at -10℃ are more scenario-specific than those at 5℃—in one embodiment of this invention, dynamic weights can be assigned to samples to enhance the role of key scenario samples in distribution alignment. Specifically, historical data can be weighted based on similarity according to factors such as geographical location and vehicle model distribution. The weighting parameters can be adjusted through cross-validation to improve the prediction accuracy of new charging stations. The specific formula for the weighted maximum mean difference is as follows:
[0123]
[0124] in, and The sample weights are calculated as follows:
[0125] ,
[0126] in, For typical scenarios in the power source field (such as 25℃+380V in urban fast charging stations). The scene features (temperature + voltage) of the source domain sample k. Centered on typical scenarios in the target domain, The scene features of the target domain sample m; For Euclidean distance, This is a bandwidth parameter used to control the rate of weight decay.
[0127] The model can input charging data (excluding charging demand) of unassigned charging piles in the target area into a transfer learning model, outputting predicted charging demand values, including predicted charging time per pile (e.g., vehicle A requires 40 minutes, vehicle B requires 60 minutes) and group demand trends (e.g., an estimated 5 new charging vehicles are expected to be added in the next hour, with a total demand of approximately 300 kWh). Then, power correlation data for the unassigned charging piles is selected from all the data, including grid stability data, user satisfaction data, and equipment lifespan data.
[0128] The power allocation module 60 can specifically use multiple power-related parameters of the charging piles to be allocated as targets, and construct an objective function by combining the weights of each target. The multiple power-related parameters are obtained through real-time monitoring or migration, and the weights are obtained through migration. The constraints are obtained through migration. Then, the initial solution of the particle swarm optimization algorithm is obtained through migration, and the objective function is solved by the particle swarm optimization algorithm to obtain the charging power allocation scheme of the charging piles to be allocated.
[0129] For example, the power correlation data for the charging piles to be allocated includes grid stability data, user satisfaction data, and equipment lifespan data. Grid stability is measured by voltage fluctuation ΔV and frequency deviation Δf, and charging waiting time T is used as the basis for calculation. wait Charging efficiency η measures user satisfaction, and the loss rate of key components λ represents equipment lifespan. Therefore, the constructed objective function is:
[0130]
[0131] Among them, V rated For the rated voltage, f rated The rated frequency is α, with a numerical subscript indicating the weight of each target.
[0132] Weight transfer refers to retrieving the K scenes from historical data in the source domain that are most similar to the current scene features in the target domain, extracting the optimal weights of these K scenes, and obtaining the initial weight α of the target domain by weighted averaging (the higher the similarity, the larger the preset weight). j j ranges from 1 to 5.
[0133] For example, when migrating constraints, if the source domain has a power limit constraint, "the power limit of the same type of charging pile at 25℃ is 60kW", it will be corrected by the "temperature-power decay curve" learned from the source domain when migrating to the target domain (-45℃). For grid load constraints, if the source domain has a "total power must be ≤0.7 when the load rate is 80%", it will be corrected by the mapping relationship between "grid vulnerability and constraint coefficient" in the source domain after migrating to the target domain, taking into account the vulnerability of the target grid (such as an old grid).
[0134] For the migration of the initial solution of the particle swarm optimization algorithm, for example, it can be selected from the historical best solutions of similar scenarios in the source domain and fine-tuned according to the characteristics of the target domain (such as modifying the "50kW+30kW" scheme in the source domain to "45kW+28kW" at low temperature) to avoid the low optimization efficiency caused by insufficient data in the target domain.
[0135] By solving the problem using the particle swarm optimization algorithm, the optimal power allocation scheme for the charging piles to be allocated can be obtained, and the charging power can be allocated to each vehicle plugged in using the optimal power allocation scheme.
[0136] Furthermore, in one embodiment of the present invention, the charging power allocation system may also include an iterative training module, which is used to correct the transfer knowledge according to the actual charging power allocation scheme in the target domain and to iteratively train the transfer learning model.
[0137] Specifically, the deviation between the actual optimal weights in the target domain and the initial weights during transfer can be calculated, updating the "scene feature-weight" mapping relationship. If a constraint (such as a 51kW power limit) causes the charging time to exceed the user's tolerance range, the "temperature-power decay curve" is corrected based on feedback data, and adjusted to 53kW in the next transfer round. Finally, the feedback data is added to the target domain dataset, and the LSTM-Transformer prediction model and the scene matching algorithm of transfer learning are fine-tuned, forming a closed loop of "transfer-optimization-feedback-correction". This allows for continuous model optimization, further improving the effectiveness of charging power allocation in the target domain.
[0138] The charging power allocation system according to embodiments of the present invention, through transfer learning and multi-objective optimization techniques, can intelligently and dynamically allocate charging power in data-scarce scenarios, and has advantages in terms of efficiency, safety, and rationality.
[0139] In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0140] The execution order of the steps shown in the flowchart is the preferred implementation. In other embodiments of the present invention, the order can be adjusted according to the functions involved in each step, for example, they can be executed simultaneously or in the reverse order.
[0141] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in connection with, an instruction execution system, apparatus, or device. For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit a program for use by, or in connection with, an instruction execution system, apparatus, or device.
[0142] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.
[0143] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
Claims
1. A charging power distribution method, characterized in that, Includes the following steps: Acquire charging data from the source domain and the target domain; Build deep learning models; The deep learning model is pre-trained using the charging data from the source domain to obtain a pre-trained model. By transferring the parameters and features of the pre-trained model, the deep learning model is trained with charging data from the target domain to obtain a transfer learning model. The data of the charging piles to be assigned in the target area are processed by the transfer learning model to obtain the power correlation data of the charging piles to be assigned. Multi-objective optimization is performed using the power correlation data of the charging piles to be allocated to obtain the charging power allocation scheme for the charging piles to be allocated.
2. The charging power distribution method according to claim 1, characterized in that, The deep learning model is an LSTM-Transformer hybrid architecture.
3. The charging power distribution method according to claim 1, characterized in that, When training and applying the transfer learning model, the loss function used is the total loss that fuses the differences in data distribution between the source and target domains based on the base loss.
4. The charging power allocation method according to claim 1, characterized in that, Multi-objective optimization is performed using the power correlation data of the charging piles to be allocated, specifically including: Using multiple power correlation parameters of the charging piles to be allocated as targets, a target function is constructed by combining the weights of each target. The multiple power correlation parameters are obtained through real-time monitoring or migration, and the weights are obtained through migration. Constraints are obtained through migration; The initial solution of the particle swarm optimization algorithm is obtained by migration, and the objective function is solved by the particle swarm optimization algorithm to obtain the charging power allocation scheme of the charging pile to be allocated.
5. The charging power distribution method according to claim 4, characterized in that, Also includes: The transfer knowledge is corrected based on the actual charging power allocation scheme in the target domain, and the transfer learning model is iteratively trained.
6. A charging power distribution system, characterized in that, include: The data acquisition module is used to acquire charging data in the source field and charging data in the target field; A model building module, which is used to build deep learning models; A pre-training module is used to pre-train the deep learning model with the charging data from the source domain to obtain a pre-trained model. A transfer training module is used to train the deep learning model with charging data from the target domain by transferring the parameters and features of the pre-trained model, thereby obtaining a transfer learning model. The model application module is used to process the data of the charging piles to be assigned in the target domain through the transfer learning model to obtain the power correlation data of the charging piles to be assigned. A power allocation module is used to perform multi-objective optimization based on the power correlation data of the charging pile to be allocated, so as to obtain a charging power allocation scheme for the charging pile to be allocated.
7. The charging power distribution system according to claim 6, characterized in that, The deep learning model is an LSTM-Transformer hybrid architecture.
8. The charging power distribution system according to claim 6, characterized in that, When training and applying the transfer learning model, the loss function used is the total loss that fuses the differences in data distribution between the source and target domains based on the base loss.
9. The charging power distribution system according to claim 6, characterized in that, The power distribution module is specifically used for: Using multiple power correlation parameters of the charging piles to be allocated as targets, a target function is constructed by combining the weights of each target. The multiple power correlation parameters are obtained through real-time monitoring or migration, and the weights are obtained through migration. Constraints are obtained through migration; The initial solution of the particle swarm optimization algorithm is obtained by migration, and the objective function is solved by the particle swarm optimization algorithm to obtain the charging power allocation scheme of the charging pile to be allocated.
10. The charging power distribution system according to claim 9, characterized in that, Also includes: An iterative training module is used to correct the transfer knowledge according to the actual charging power allocation scheme in the target domain and to iteratively train the transfer learning model.