Electric vehicle charging curve generation method and system

By using multi-scale sequence fragment decomposition and conditional diffusion generation model, the problems of discontinuity and temporal logic in the generation of electric vehicle charging curves are solved, achieving high-fidelity and diverse charging curve generation, and supporting power grid security assessment and scheduling analysis.

CN121579874APending Publication Date: 2026-02-27SOUTHEAST UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511479819.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing technologies suffer from unnatural power steps and physical discontinuities when generating long-term electric vehicle charging curves. They also lack accurate perception of absolute time and cannot incorporate physical constraints such as time-of-use pricing, resulting in generated data that does not conform to real-world logic.

Method used

By employing a multi-scale sequence fragment decomposition and weighted learning mechanism, combined with a conditional diffusion generation model, and through rotational position encoding and a Transformer denoising backbone network, spatiotemporal conditional injection and Softmax weighted overlapping addition algorithm are introduced to generate high-fidelity and diverse charging curves.

Benefits of technology

It solves the splicing artifact problem in traditional segmented generation strategies, ensures the physical continuity and temporal logic consistency of the generated curves, provides high-quality charging curve data support, and provides accurate data for power grid security assessment and dispatch strategy analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579874A_ABST
    Figure CN121579874A_ABST
Patent Text Reader

Abstract

The invention discloses an electric vehicle charging curve generation method and system, and the method comprises the steps: decomposing a noisy charging power curve into a plurality of overlapped Patches of different scales, so as to represent the transient impact of a charging start-stop stage and the steady state trend of a constant-current charging stage; the diffusion step length and the Patch center moment are coded through rotation position coding, and physical constraints on the absolute time power grid side are guided to a curve generation process through feature layer injection; a Transform backbone network is adopted to capture a long-time-sequence physical dependency relationship in the charging behavior; a power value and a reconstruction weight are respectively predicted through a double-path prediction head, and a generated curve is physically continuous and smooth by using weighted overlapping addition based on Softmax. According to the method, the problems of splicing artifacts and unreasonable time logic existing in charging curve generation are solved, and the high-fidelity charging curve with physical significance can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for generating electric vehicle charging curves, belonging to the fields of electric vehicle charging management and smart grid technology. Background Technology

[0002] With the deepening of global low-carbon strategies and continuous breakthroughs in core electric vehicle (EV) technologies, the proportion of EVs in global transportation systems is steadily increasing, placing higher demands on the planning, dispatching, and stable operation of power systems. The spatiotemporal uncertainties of large-scale EV cluster charging behavior make the aggregated load a key disturbance factor affecting grid security. Therefore, accurately generating EV charging load data highly consistent with real-world scenarios can assess the EV grid's resilience and flexibility, ensuring the safe and economical operation of the grid.

[0003] Acquiring large-scale, high-temporal-resolution charging data presents challenges related to cost, cycle time, quality, and privacy. While existing technologies offer various charging data generation methods to address data scarcity, they still exhibit significant limitations when simulating complex, long-term, and highly dynamic charging behaviors. Firstly, current models often employ segmented generation strategies, but during data stitching, fusion methods are prone to power step shifts, resulting in block artifacts. This physical distortion prevents the generated data from supporting sophisticated grid transient stability analysis. Secondly, existing models lack precise awareness of absolute time, failing to incorporate physical constraints or user behavior patterns specific to certain time periods. This can lead to the generation of contradictory data, such as intensive charging during peak electricity price periods, severely impacting the accuracy of demand response potential assessment and scheduling strategy analysis.

[0004] Therefore, in the process of generating electric vehicle charging load, it is necessary to overcome the physical continuity problem of existing technologies when reconstructing long-sequence data from the perspective of model mechanism, and to integrate accurate time logic constraints into the charging load generation process, so as to form a high-fidelity, diverse, and consistent high-quality charging curve in both physical and behavioral logic. Summary of the Invention

[0005] The technical problem this invention aims to solve is that existing technologies, when generating long-term electric vehicle charging curves, employ a segmented generation and then stitching method. This results in unnatural power steps at the stitching points, forming blocky artifacts and causing physical discontinuities. Furthermore, existing electric vehicle charging curve generation models lack accurate perception of absolute time within a day, failing to incorporate physical constraints such as time-of-use pricing or user behavior patterns. This may lead to the generation of data that does not conform to real-world logic, affecting the authenticity and usability of the generated electric vehicle charging data.

[0006] To address the aforementioned technical problems, this invention provides a method for generating electric vehicle charging curves, comprising the following steps:

[0007] Step S1: Collect historical electric vehicle charging power curve data and preprocess the historical electric vehicle charging power curve data;

[0008] Step S2: Decompose the preprocessed historical electric vehicle charging power curve data into M overlapping sequence segments of different scales;

[0009] Step S3: Construct a conditional diffusion generation model, which includes a multi-scale adaptive fusion module, a spatiotemporal conditional injection module, a Transformer denoising backbone network model, a dual-path prediction head, and a Softmax weighted overlapping and summing reconstruction module.

[0010] Step S4: Input the obtained multi-scale electric vehicle charging power curve sequence fragments into the conditional diffusion generation model, and use the learnable fusion module to perform weighted summation of the features of the sequence fragments from different scales to generate fused features.

[0011] Step S5: In the spatiotemporal condition injection module, the rotation position coding (RoPE) is used to encode the time information, and the feature layer injection is further used to dynamically adjust the fused features to obtain multi-scale sequence fragment feature tokens that incorporate spatiotemporal information.

[0012] Step S6: Input all the feature tokens of the multi-scale sequence segments after conditional injection into the Transformer denoising backbone network model of the conditional diffusion generation model to extract deep temporal features;

[0013] Step S7: Input the deep temporal feature sequence output by the Transformer denoising backbone network model in step S6 into the Value Head and Weight Head, respectively, and predict the charging power value and dynamic weights for smooth reconstruction in each sequence segment.

[0014] Step S8: Based on the obtained dynamic weights, the final charging curve is reconstructed using a Softmax-based weighted overlap summation algorithm.

[0015] In the aforementioned electric vehicle charging curve generation method, in step S1, the electric vehicle charging power curve data includes the total power curve at the charging station level, the operation data of a single charging pile, the charging record of a specific vehicle, and the charging scenario.

[0016] In the aforementioned method for generating electric vehicle charging curves, in step S2, for the m-th scale, the window length is set to L. m The step size is hm The vector representation of the u-th segment p = (m, u) at the m-th scale is x. p =[x[a m,u ],…,x[b m,u Starting point a m,u End point b m,u and center point c p They are defined as follows:

[0017] a m,u =uh m (1)

[0018] b m,u =a m,u +L m -1 (2)

[0019]

[0020] By setting different window lengths, the input charging power curve data sequence x t It is simultaneously mapped to a set of sequence fragments at different scales.

[0021] In the aforementioned electric vehicle charging curve generation method, in step S4, the fusion module adopts an attention mechanism-based module, as shown in equation (4):

[0022]

[0023] Wherein, the weighting coefficient α m,u As learnable dynamic weights, the scoring network g(·) first processes the features of each scale segment. Output scalar score The weighting coefficients α are then obtained through the Softmax function. m,u As shown in equation (5), the scoring network g(·) is a lightweight neural network implemented using a multilayer perceptron (MLP), and is expressed as:

[0024]

[0025] in, The denominator represents the feature vector of the segment at position u at the m-th scale. This means normalizing the indexed scores at position u for all scales m', such that the weighting coefficient α m,u It satisfies a probability distribution, where m' is a dummy index used for summation.

[0026] In the aforementioned method for generating electric vehicle charging curves, step S5 includes time information including global time conditions and local time conditions.

[0027] The aforementioned global time condition utilizes Rotational Position Encoding (RoPE) to encode the global denoising diffusion step time t during the diffusion process, generating a global time code c. (global) As shown in equation (6):

[0028] c (global) =RoPE(t / T) d (6)

[0029] Where T d Let t be the total number of steps in the diffusion process, t∈{0,1,...T} d-1} represents the current global denoising diffusion step size, and the global time encoding c (global) Provides a global generation progress control signal for the Transformer denoising backbone network of the conditional diffusion generation model;

[0030] The local time condition utilizes Rotational Position Encoding (RoPE) to determine the center time τ of each sequence segment within the original complete sequence. p Encode to generate local time codes. As shown in equation (7):

[0031]

[0032] The central time τ p It is the absolute time position of the segment within a 24-hour cycle;

[0033] Global time encoding c (global) With local time coding Concatenate them into the final condition vector.

[0034] In the aforementioned electric vehicle charging curve generation method, step S5, the feature layer injection step is as follows: The condition vector c containing physical information about electric vehicle charging, after being processed by Rotational Position Encoding (RoPE), is... p The scaling factor γ is generated through the parameter mapping network φ(·). p and offset factor β p Let sequence segment p = (m, u) represent the u-th sequence segment at the m-th scale. The features of sequence segment p = (m, u) Performing an affine transformation, at time step n, satisfies:

[0035] h′ p [n,:]=γ p ⊙h p [n,:]+β p (8)

[0036] In the formula, L mThis indicates the length of the scale window, D is the feature dimension, and ⊙ represents the element-wise multiplication operation, thus allowing the conditional diffusion generative model to adjust its output characteristics according to different electric vehicle charging conditions; h p [n,:] represents the segment feature vector at time step n after conditional modulation, h p [n,:] represents the feature vector of the original unmodulated time step n.

[0037] In the aforementioned electric vehicle charging curve generation method, in step S6, the electric vehicle charging power curve is generated through two processes: forward noise addition and reverse noise removal in the Transformer denoising backbone network model, and external conditions are used as physical constraints during the generation of charging data.

[0038] The positive noise addition process involves gradually adding noise to the actual charging power curve, causing the actual charging power curve to degenerate into pure Gaussian noise.

[0039] The reverse denoising process learns to gradually recover a structured, physically constrained, consistent charging power curve from pure noise.

[0040] In the aforementioned electric vehicle charging curve generation method, in step S7, the value prediction head consists of one or more fully connected layers, with each layer connected in a feedforward series relationship. The output of the previous layer serves as the input of the next layer, forming a multilayer perceptron (MLP). The task is to predict the true charging power or current value sequence V for each sequence segment p based on the deep features of the input. p ;

[0041] The structure of the weight prediction head is the same as that of the value prediction head. Its task is to predict a set of weight Logits sequence Z of the same length as the signal value for each segment p. p .

[0042] In the aforementioned electric vehicle charging curve generation method, in step S8, the Logits sequence Z output by the weight prediction head in step S7 is... p [n] is converted into a normalized contribution weight W' p [n], and then the contribution weights are applied to the power values ​​V predicted for each segment in step S7. p The weighted summation of [n] is used to calculate the final reconstruction power value Y[n] at the corresponding time point, which is expressed as:

[0043]

[0044] In the formula, n is the index of a time point in the time series; Z is the set of all sequence segments covering time point n; p [n] represents the logits value output by the weighted prediction head pair for segment p at time point n; Vp [n] represents the predicted power value of the prediction head pair for segment p at time point n; W' p [n] represents the normalized contribution weight; τ>0 is the temperature parameter controlling the smoothness of the weights; ∈ is the numerical stability constant to prevent the denominator from being zero.

[0045] The aforementioned method for generating electric vehicle charging curves further includes: Step S9: Based on the power value Y[n] reconstructed by the conditional diffusion generation model in step S8, the conditional diffusion generation model is optimized. The overall optimization objective includes optimization objective one, which is the multi-resolution short-time Fourier transform loss L. stft The expression is shown in equation (13):

[0046]

[0047] Among them, spectral convergence loss Logarithmic magnitude loss The expressions for are shown in equations (14) and (15) respectively:

[0048]

[0049] In the formula, Y i and These are the short-time Fourier transform results of the actual charging power curve and the generated curve at resolution i, respectively; |·| represents the amplitude taking operation; ||·|| F It is the Frobenius norm; ||·||1 is the L1 norm;

[0050] It also includes optimizing objective two, which is the temporal reconstruction loss, expressed using the L1 loss function or the L2 loss function:

[0051]

[0052]

[0053] In the formula, Indicates the L1 loss for temporal reconstruction. Let Y[n] represent the L2 loss of temporal reconstruction, Y[n] be the electric vehicle charging power curve generated by the conditional diffusion generation model, x[n] be the real electric vehicle charging power curve, and N be the sample length.

[0054] Perform a weighted summation of optimization objective one and optimization objective two;

[0055] The Adam gradient descent optimization algorithm is used to minimize the total loss function, which includes the frequency domain loss of optimization objective one and the time domain loss of optimization objective two. All learnable parameters inside the conditional diffusion generation model are iteratively updated until the conditional diffusion generation model converges and generates the charging curve.

[0056] A computer system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to perform the steps of the method described above.

[0057] The beneficial effects achieved by this invention are as follows: The method of this invention solves the splicing artifact problem in traditional segmented generation strategies by using multi-scale sequence fragment decomposition and weighted learning mechanisms, ensuring the physical continuity of the generated curves. By utilizing a conditional injection mechanism, grid-side physical constraints such as absolute time are precisely guided into the generation process, avoiding the problem of unreasonable temporal logic. Ultimately, it can generate high-quality charging curves with high fidelity, diversity, and high consistency in both physical and behavioral logic, providing crucial data support for power flow calculations, vehicle-to-grid (V2G) potential assessment, and stability analysis in power systems with high-density distributed resources. Attached Figure Description

[0058] Figure 1 This is a flowchart illustrating the overall architecture of the electric vehicle charging curve generation method in Embodiment 1 of the present invention.

[0059] Figure 2 This is a schematic diagram of the spatiotemporal condition injection module based on rotational position encoding in Embodiment 1 of the present invention;

[0060] Figure 3 This is a schematic diagram of the principle of the Softmax-weighted overlapping addition reconstruction module in Embodiment 1 of the present invention;

[0061] Figure 4 This is a schematic diagram illustrating the structure of the multi-resolution short-time Fourier transform loss in Embodiment 1 of the present invention;

[0062] Figure 5 This is a comparison diagram of the charging curve generation effect between the method of the present invention in Embodiment 1 and the prior art. Detailed Implementation

[0063] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0064] Example 1

[0065] like Figure 1 As shown, this embodiment provides a method for generating an electric vehicle charging curve, including the following steps:

[0066] Step S1: Collect historical electric vehicle charging power curve data and preprocess the data. The charging power curve data includes the total power curve at the charging station level, operational data of individual charging piles, charging records for specific vehicles, and charging scenarios. These charging scenarios include AC slow charging and DC fast charging. The collected historical electric vehicle charging power curve data is used for subsequent model training and validation.

[0067] The data preprocessing steps include cleaning the data, removing outliers, handling missing data through interpolation or deletion, and resampling all curve data to a uniform time resolution to ensure data consistency.

[0068] Step S2: Transfer the preprocessed historical electric vehicle charging power curve data x t Decomposed into M overlapping sequence segments of different scales, x t ∈R L R represents the real number space, and L represents the sequence length of the charging curve.

[0069] The multi-scale decomposition process can effectively decouple the transient power impact physical process during the charging start-stop phase from the steady-state power trend during the constant current or constant voltage charging phase, thereby improving the characterization capability of the following conditional diffusion generation model and generating electric vehicle charging power curves that are more consistent with real-world scenarios.

[0070] Specifically, for the m-th scale, the window length is set to L. m The step size is h m The vector representation of the u-th segment p = (m, u) at the m-th scale is x. p =[x[a m,u ],…,x[b m,u Starting point a m,u End point b m,u and center point c p They are defined as follows:

[0071] a m,u =uh m (1)

[0072] b m,u =a m,u +L m -1 (2)

[0073]

[0074] By setting different window lengths, the input charging power curve data sequence x tSimultaneously, it is mapped to multiple sets of sequence segments at different scales. This embodiment uses shorter-scale sequence segments with 16 sampling points, including: capturing high-frequency transient events during charging, power ramp-up after the charging pile and vehicle establish a communication handshake, instantaneous power drop caused by the Battery Management System (BMS) adjusting its state, and a sharp power decrease due to the end of charging or the user unplugging the charging gun. Longer-scale sequence segments with 256 sampling points include: capturing steady-state or gradually changing phases during charging, the constant-current charging phase of lithium battery charging, and the constant-voltage charging phase.

[0075] Step S3: Construct a conditional diffusion generation model, which includes a multi-scale adaptive fusion module, a spatiotemporal condition injection module, a Transformer denoising backbone network model, a dual-path prediction head, and a Softmax weighted overlapping and summing reconstruction module.

[0076] Step S4: Input the multi-scale electric vehicle charging power curve sequence fragments obtained in Step S2 into the conditional diffusion generation model, and use the learnable fusion module to analyze the features of the sequence fragments from different scales. Perform a weighted summation to generate the fused feature h. u .

[0077] The fusion module adopts an attention-based mechanism, as shown in equation (4):

[0078]

[0079] Wherein, the weighting coefficient α m,u These are learnable dynamic weights. First, the scoring network g(·) processes the features of each scale segment. Output scalar score The weighting coefficients α are then obtained through the Softmax function. m,u As shown in equation (5), the scoring network g(·) is a lightweight neural network, which can be implemented using a multilayer perceptron (MLP), and is expressed as:

[0080]

[0081] in, The denominator represents the feature vector of the segment at position u at the m-th scale. This means normalizing the indexed scores at position u for all scales m', such that the weighting coefficient α m,u It satisfies a probability distribution, where m' is a dummy index used for summation.

[0082] In the adaptive multi-scale fusion process, the conditional diffusion generation model can adaptively determine which scale of information to rely on more at specific parts of the generation curve, thereby obtaining the short-term transient and long-term steady-state characteristics of the charging process more flexibly. For example, at the beginning and end of the simulated charging, the conditional diffusion generation model will learn to give higher weights to the features of short-scale sequence segments, while in the simulation of long-term constant current charging, the weights of long-scale sequence segments need to be increased.

[0083] The fusion process integrates information from different scales in step 2 into a unified feature representation, preparing for denoising and feature extraction by the Transformer denoising backbone network model in the subsequent step 6, thereby improving the physical authenticity and accuracy of the final generated charging curve.

[0084] Step S5: As Figure 2 As shown, to accurately generate electric vehicle charging curves and ensure that the generated curves conform to real physical constraints and temporal patterns, a spatiotemporal condition injection module is introduced into the conditional generation diffusion model. In the spatiotemporal condition injection module, Rotational Position Encoding (RoPE) is first used to encode two key temporal information types. Furthermore, Feature Layer Injection (FiLM) is employed to dynamically adjust the fused features from step S4, obtaining multi-scale sequence fragment feature tokens incorporating spatiotemporal information.

[0085] The time information includes global time conditions and local time conditions.

[0086] The aforementioned global time condition utilizes Rotational Position Encoding (RoPE) to encode the global denoising diffusion step time t during the diffusion process, generating a global time code c. (global) As shown in equation (6):

[0087] c (global) =RoPE(t / T) d (6)

[0088] Where T d Let t be the total number of steps in the diffusion process, t∈{0,1,...T} d-1} represents the current global denoising diffusion step size, and the global time encoding c (global) This provides a global generation progress control signal for the Transformer denoising backbone network of the conditional diffusion generation model. By adjusting the denoising intensity and physical constraint injection rhythm at each step, the conditional diffusion generation model is guided to gradually add structured information from a completely disordered noise state, ultimately forming a complete charging power curve.

[0089] The local time condition, namely, using Rotational Position Encoding (RoPE) to determine the center time τ of each sequence segment in the original complete sequence. p Encode to generate local time codes. As shown in equation (7):

[0090]

[0091] The central time τ p It is the absolute time position of the segment within a 24-hour cycle.

[0092] The local time encoding This allows the conditional diffusion generative model to learn time-dependent charging behavior patterns. At the center time τ... p Corresponding to the off-peak electricity hours at night, the conditional diffusion generation model will be guided to generate AC slow charging curves with lower power and longer duration; when τ p For weekday midday hours, the conditional diffusion generation model generates DC fast charging curves with higher power and shorter duration to meet users' charging habits and electricity price incentives.

[0093] Global time encoding c (global) With local time coding Concatenate them into the final condition vector.

[0094] The Feature Layer Injection (FiLM) step involves: injecting the condition vector c containing physical information about electric vehicle charging from the Rotationally Encoded Position Entity (RoPE) layer... p The scaling factor γ is generated through the parameter mapping network φ(·). p and offset factor β p Sequence segment p = (m, u) represents the u-th sequence segment at the m-th scale. The features of sequence segment p = (m, u) Performing an affine transformation, at time step n, satisfies:

[0095] h′ p [n,:]=γ p ⊙h p [n,:]+β p (8)

[0096] In the formula, L m This indicates the length of the scale window, D is the feature dimension, and ⊙ represents the element-wise multiplication operation, thus allowing the conditional diffusion generative model to adjust its output characteristics according to different electric vehicle charging conditions; h p [n,:] represents the segment feature vector at time step n after conditional modulation, h p [n,:] represents the feature vector of the original unmodulated time step n.

[0097] Step S6: Input all multi-scale sequence fragment feature tokens processed by the conditional injection in step S5 into the Transformer denoising backbone network model of the conditional diffusion generation model to extract deep temporal features.

[0098] In the Transformer denoising backbone network model, the electric vehicle charging power curve is generated through two processes: forward noise addition and reverse denoising. During the generation of charging data, external conditions such as intraday absolute time, time-of-use electricity price, temperature, and station power limit are used as physical constraints to accurately guide the generation process.

[0099] The positive noise addition process involves gradually adding noise to the actual charging power curve, causing the actual charging power curve to degenerate into pure Gaussian noise.

[0100] The reverse denoising process learns to gradually recover a structured, physically constrained, consistent charging power curve from pure noise.

[0101] In electric vehicle charging scenarios, long-distance dependencies exist. For example, the vehicle's initial state of charge (SoC) and battery temperature directly affect the power curve shape during the constant voltage phase several hours after charging. The Transformer denoising backbone network model utilizes a self-attention mechanism to effectively capture physical dependencies across long time scales. This self-attention mechanism obtains the query Q, key K, and value V matrix by linearly projecting the input features and calculating the attention score to obtain the physical dependencies. The process is represented by the following formula:

[0102] Q = HW Q K = HW K V = HW V (9)

[0103]

[0104] Where H is the input feature, W Q W K W V , where are the learnable projection matrices used to generate query Q, key K, and value V, and d is the single-head dimension. The Transformer network, through the stacking of multiple layers of self-attention and feedforward networks, performs sufficient information interaction and deep context learning on the features of all sequence segments, extracting deep features containing long-term temporal physical dependencies.

[0105] Step S7: Input the deep temporal feature sequence output by the Transformer denoising backbone network model in Step S6 into the Value Head and Weight Head of the Conditional Diffusion Generative Model to predict the charging power value and dynamic weights for smooth reconstruction in each sequence segment, respectively. The Conditional Diffusion Generative Model not only predicts the power value, but also learns the confidence level of the predicted value at the current time point.

[0106] The value prediction head consists of one or more fully connected layers, which are connected in a feedforward series relationship. The output of the previous layer serves as the input of the next layer, forming a multilayer perceptron (MLP). The task is to predict the true charging power or current value sequence V for each sequence segment p based on the deep features of the input. p .

[0107] The structure of the weight prediction head is the same as that of the value prediction head. Its task is to predict a set of weight Logits sequence Z of the same length as the signal value for each segment p. p The weighted Logits sequence is used to calculate the normalized weights in step S8, reflecting the determinism of the conditional diffusion generation model's predictions for each point in the sequence segment. The electric vehicle charging curve generation model has higher predictive certainty for the central region of the segment, but higher uncertainty for the edge region.

[0108] Step S8: As Figure 3 As shown, to ensure the reconstructed charging curve is physically continuous and smooth, and to avoid power abrupt changes that do not conform to the charging load of electric vehicles, the final charging curve is reconstructed using the weighted overlap addition algorithm (OLA) based on Softmax, based on the dynamic weights obtained in step 7. When reconstructing the power value at any time point n, all sets covering that point are considered. Predictive information for sequence fragments.

[0109] First, the Logits sequence Z output by the weight prediction head in step S7 is... p [n] is converted into a normalized contribution weight W' p [n], and then the contribution weights are applied to the power values ​​V predicted for each segment in step S7. p The weighted summation of [n] is used to calculate the final reconstruction power value Y[n] at the corresponding time point, which is expressed as:

[0110]

[0111] In the formula, n is the index of a time point in the time series; Z is the set of all sequence segments covering time point n; p [n] represents the logits value output by the weighted prediction head pair for segment p at time point n; Vp [n] represents the predicted power value of the prediction head pair for segment p at time point n; W' p [n] represents the normalized contribution weight; τ>0 is a temperature parameter controlling the smoothness of the weights; ∈ is a numerical stability constant to prevent the denominator from being zero. The dynamic weighted averaging process ensures a smooth and continuous transition at the segment boundaries, thereby generating a continuous, non-jumping electric vehicle charging curve.

[0112] Example 2

[0113] Based on the technical solution of Embodiment 1, it also includes:

[0114] Step S9: As Figure 4 As shown, to ensure high fidelity in both the time and frequency domains of the generated curve, this embodiment optimizes the conditional diffusion generation model based on the reconstructed power value Y[n] from the conditional diffusion generation model in step S8. The overall optimization objective includes optimization objective one, which is the multi-resolution short-time Fourier transform loss L. stft Multi-resolution short-time Fourier loss functions can constrain power fluctuations during charging, avoiding unreasonable high-frequency jitter, especially since high-frequency ripple caused by power electronic converters has a direct impact on the power quality of the power grid.

[0115] The multi-resolution short-time Fourier transform loss L stft By minimizing the difference between the generated curve and the actual charging power curve at multiple spectral resolutions, the conditional diffusion generation model learns to generate curves that are consistent with the dynamic characteristics of the actual data at various rates of change. The expression is shown in equation (13):

[0116]

[0117] Among them, spectral convergence loss Logarithmic magnitude loss The expressions for are shown in equations (14) and (15) respectively:

[0118]

[0119] In the formula, Y i and These are the short-time Fourier transform results of the actual charging power curve and the generated curve at resolution i, respectively; |·| represents the amplitude taking operation; ||·|| F is the Frobenius norm; ||·||1 is the L1 norm. Optimization using a multi-resolution short-time Fourier transform loss function ensures that the generated curve not only more closely approximates the actual charging power curve in macroscopic shape, but also matches the actual charging load in spectral characteristics. This facilitates subsequent grid power flow calculations, stability analysis, and V2G potential assessment.

[0120] In addition to optimizing the frequency domain loss in objective one, the overall optimization objective of the conditional diffusion generation model also includes optimizing objective two, which is time domain reconstruction loss. The time domain reconstruction loss measures the difference between the generated curve and the actual charging power curve in the time domain, and is expressed using the L1 loss function or the L2 loss function.

[0121]

[0122] In the formula, Indicates the L1 loss for temporal reconstruction. Let Y[n] represent the time-domain reconstruction L2 loss, Y[n] be the electric vehicle charging power curve generated by the conditional diffusion generation model, x[n] be the real electric vehicle charging power curve, and N be the sample length.

[0123] Then, a weighted sum is performed on optimization objective one and optimization objective two, and the weight coefficients can be set according to the actual situation. Optimization objective one and optimization objective two complement each other and are jointly optimized to ensure that the conditional diffusion generation model simultaneously satisfies the accuracy of time-domain amplitude and shape, and maintains the consistency of frequency-domain dynamic characteristics with the actual load.

[0124] Finally, gradient descent optimization algorithms such as Adam are used to minimize the total loss function, which includes the frequency domain loss of optimization objective one and the time domain loss of optimization objective two. All learnable parameters inside the conditional diffusion generation model are iteratively updated until the conditional diffusion generation model converges, generating a high-fidelity charging curve.

[0125] This embodiment uses a testing system based on real charging data to verify the proposed method. The experimental data comes from charging records of the JPL (Jet Propulsion Laboratory) station in the publicly available ACN-Data dataset. This dataset contains a large amount of charging session information from real users, covering different vehicle models, different charging power, and different user behavior patterns. A continuous year's worth of charging data, containing tens of thousands of independent charging events, can be selected to fully verify the performance of the method of this invention.

[0126] Reference Figure 5 This indicates a comparison between the method of the present invention and existing technologies in terms of the effect of generating charging curves. Figure 5 (a) shows the charging curve generated by a Generative Adversarial Network (GAN) using a traditional segmented generation model. It can be seen that there are obvious, physically inconsistent power jumps at the segment splicing points, i.e., block artifacts. Figure 5As shown in (b), the present invention introduces a weighted overlapping summation OLA reconstruction mechanism based on Softmax, which generates a charging curve that is physically continuous and smooth, eliminating splicing artifacts. Whether it is the transient impact during the charging start-up and shutdown phase or the steady-state trend during the constant current and constant voltage phase, it is closer to the real charging process.

[0127] Example 3

[0128] A computer system includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to perform the steps of the method as described in Embodiment 1.

[0129] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for generating a charging curve for an electric vehicle, characterized in that, Includes the following steps: S1: Collect historical electric vehicle charging power curve data and preprocess the historical electric vehicle charging power curve data; S2: Decompose the preprocessed historical electric vehicle charging power curve data into M overlapping sequence segments of different scales; S3: Construct a conditional diffusion generation model, which includes a multi-scale adaptive fusion module, a spatiotemporal conditional injection module, a Transformer denoising backbone network model, a dual-path prediction head and a Softmax weighted overlapping and summing reconstruction module. S4: Input the obtained multi-scale electric vehicle charging power curve sequence fragments into the conditional diffusion generation model, and use the learnable fusion module to perform weighted summation of the features from sequence fragments from different scales to generate fused features; S5: In the spatiotemporal condition injection module, rotational position coding (RoPE) is used to encode the time information, and feature layer injection is further used to dynamically adjust the fused features to obtain multi-scale sequence fragment feature tokens that incorporate spatiotemporal information. S6: Input all multi-scale sequence fragment feature tokens after conditional injection into the Transformer denoising backbone network model of the conditional diffusion generation model to extract deep temporal features. S7: Input the deep temporal feature sequence output by the Transformer denoising backbone network model in step S6 into the Value Head and Weight Head to predict the charging power value and dynamic weights for smooth reconstruction in each sequence segment, respectively. S8: Based on the obtained dynamic weights, the final charging curve is reconstructed using a Softmax-based weighted overlap summation algorithm.

2. The method for generating electric vehicle charging curves according to claim 1, characterized in that, In step S2, for the m-th scale, the window length is set to L. m The step size is h m The vector representation of the u-th segment p = (m, u) at the m-th scale is x. p =[x[a m,u ],…,x[b m,u Starting point a m,u End point b m,u and center point c p They are defined as follows: a m,u =uh m (1) b m,u =a m,u +L m -1 (2) By setting different window lengths, the input charging power curve data sequence x t It is simultaneously mapped to a set of sequence fragments at different scales.

3. The method for generating electric vehicle charging curves according to claim 1, characterized in that, In step S4, the fusion module adopts an attention-based module, as shown in equation (4): Wherein, the weighting coefficient α m,u As learnable dynamic weights, the scoring network g(·) first processes the features of each scale segment. Output scalar score The weighting coefficients α are then obtained through the Softmax function. m,u As shown in equation (5), the scoring network g(·) is a lightweight neural network implemented using a multilayer perceptron (MLP), and is expressed as: in, The denominator represents the feature vector of the segment at position u at the m-th scale. This means normalizing the indexed scores at position u for all scales m', such that the weighting coefficient α m,u It satisfies a probability distribution, where m' is a dummy index used for summation.

4. The method for generating electric vehicle charging curves according to claim 4, characterized in that, In step S5, the time information includes global time conditions and local time conditions; The aforementioned global time condition utilizes Rotational Position Encoding (RoPE) to encode the global denoising diffusion step time t during the diffusion process, generating a global time code c. (global) As shown in equation (6): c (global) =RoPE(t / T d ) (6) Where T d Let t be the total number of steps in the diffusion process, t∈{0,1,...T} d-1 } represents the current global denoising diffusion step size, and the global time encoding c (global) Provides a global generation progress control signal for the Transformer denoising backbone network of the conditional diffusion generation model; The local time condition utilizes Rotational Position Encoding (RoPE) to determine the center time τ of each sequence segment within the original complete sequence. p Encode to generate local time codes. As shown in equation (7): The central time τ p It is the absolute time position of the segment within a 24-hour cycle; Global time encoding c (global) With local time coding Concatenate them into the final condition vector.

5. The method for generating electric vehicle charging curves according to claim 4, characterized in that, In step S5, the feature layer injection step is as follows: The condition vector c containing physical information about electric vehicle charging, after being encoded by Rotational Position Encoding (RoPE), is... p The scaling factor γ is generated through the parameter mapping network φ(·). p and offset factor β p Let sequence segment p = (m, u) represent the u-th sequence segment at the m-th scale. The features of sequence segment p = (m, u) Performing an affine transformation, at time step n, satisfies: h' p [n,:]=γ p ☉h p [n,:]+β p (8) In the formula, L m This indicates the length of the scale window, D is the feature dimension, and ⊙ represents the element-wise multiplication operation, thus allowing the conditional diffusion generative model to adjust its output characteristics according to different electric vehicle charging conditions; h p [n,:] represents the segment feature vector at time step n after conditional modulation, h p [n,:] represents the feature vector of the original unmodulated time step n.

6. The method for generating an electric vehicle charging curve according to claim 1, characterized in that, In step S6, the electric vehicle charging power curve is generated in the Transformer denoising backbone network model through two processes: forward noise addition and reverse noise reduction. In the process of generating charging data, external conditions are used as physical constraints. The positive noise addition process involves gradually adding noise to the actual charging power curve, causing the actual charging power curve to degenerate into pure Gaussian noise. The reverse denoising process learns to gradually recover a structured, physically constrained, consistent charging power curve from pure noise.

7. The method for generating an electric vehicle charging curve according to claim 1, characterized in that, In step S7, the value prediction head consists of one or more fully connected layers, which are connected in a feedforward series relationship. The output of the previous layer serves as the input of the next layer, forming a multilayer perceptron (MLP). The task is to predict the true charging power or current value sequence V for each sequence segment p based on the deep features of the input. p ; The structure of the weight prediction head is the same as that of the value prediction head. Its task is to predict a set of weight Logits sequence Z of the same length as the signal value for each segment p. p .

8. The method for generating an electric vehicle charging curve according to claim 8, characterized in that, In step S8, the Logits sequence Z output by the weight prediction head in step S7 is... p [n] is converted into a normalized contribution weight W' p [n], and then the contribution weights are applied to the power values ​​V predicted for each segment in step S7. p The weighted summation of [n] is used to calculate the final reconstruction power value Y[n] at the corresponding time point, which is expressed as: In the formula, n is the index of a time point in the time series; Z is the set of all sequence segments covering time point n; p [n] represents the logits value output by the weighted prediction head pair for segment p at time point n; V p [n] represents the predicted power value of the prediction head pair for segment p at time point n; W' p [n] represents the normalized contribution weight; τ>0 is the temperature parameter controlling the smoothness of the weights; ∈ is the numerical stability constant to prevent the denominator from being zero.

9. The method for generating an electric vehicle charging curve according to claim 1, characterized in that, It also includes: Step S9: Based on the reconstructed power value Y[n] of the conditional diffusion generation model in step S8, the conditional diffusion generation model is optimized. The overall optimization objective includes optimization objective one, which is the multi-resolution short-time Fourier transform loss L. stft The expression is shown in equation (13): Among them, spectral convergence loss Logarithmic magnitude loss The expressions for are shown in equations (14) and (15) respectively: In the formula, Y i and These are the short-time Fourier transform results of the actual charging power curve and the generated curve at resolution i, respectively; |·| represents the amplitude taking operation; ||·|| F It is the Frobenius norm; ||·||1 is the L1 norm; It also includes optimizing objective two, which is the temporal reconstruction loss, expressed using the L1 loss function or the L2 loss function: In the formula, Indicates the L1 loss for temporal reconstruction. Let Y[n] represent the L2 loss of temporal reconstruction, Y[n] be the electric vehicle charging power curve generated by the conditional diffusion generation model, x[n] be the real electric vehicle charging power curve, and N be the sample length. Perform a weighted summation of optimization objective one and optimization objective two; The Adam gradient descent optimization algorithm is used to minimize the total loss function, which includes the frequency domain loss of optimization objective one and the time domain loss of optimization objective two. All learnable parameters inside the conditional diffusion generation model are iteratively updated until the conditional diffusion generation model converges and generates the charging curve.

10. A computer system comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to perform the steps of the method as described in any one of claims 1-10.

Citation Information

Cited By

  • Physical constraint-oriented electric vehicle charging curve generation method and system

    CN121901654A

  • A physical constraint-oriented electric vehicle charging curve generation method and system

    CN121901654B