An AC charging pile metering optimization method based on a multi-layer perceptron network
Through the combination of dynamic variational autoencoder and multi-layer perception network, the measurement error problem of AC charging pile metering system under nonlinear load and environmental changes is solved, and high-precision and real-time measurement optimization are achieved.
Patent Information
- Application Number
- CN202411905016.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2044-12-23
AI Technical Summary
When traditional AC charging pile metering systems face nonlinear loads and environmental changes, the metrology accuracy is insufficient and it is difficult to adapt to complex power signals. The existing technology lacks dynamic adaptability and real-time feedback optimization mechanism, resulting in large metrology errors.
The dynamic variational autoencoder is used for data preprocessing, and error compensation is performed through harmonic hierarchical modeling and multi-layer perception network. Combined with multi-scale error learning mechanism and real-time feedback optimization, model parameters are dynamically adjusted to achieve high-precision and real-time measurement optimization.
It significantly improves metrological accuracy, reduces metrological errors, improves the dynamic adaptability and long-term operation stability of the system, and meets the metrological needs in complex load scenarios.
Smart Images

Figure CN119830742B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power metering optimization, and particularly to an AC charging pile metering optimization method based on a multi-layer perceptron network. Background Art
[0002] With the rapid popularization of new energy electric vehicles, charging piles, as energy supply infrastructure, have become an important part of the modern transportation energy system. Due to their efficient and convenient characteristics, AC charging piles have been widely used in urban and highway scenarios. During the charging process, the accuracy of power metering is directly related to the calculation of users' charging fees and the revenue fairness of power operators. Therefore, improving the metering accuracy of AC charging piles and reducing metering errors caused by complex loads and environmental impacts have become important issues of concern in the industry.
[0003] Traditional AC charging pile metering systems mainly rely on the real-time acquisition of current and voltage signals, and calculate active power and power consumption through fixed algorithms. However, due to the complexity of AC loads, especially the widespread existence of nonlinear loads, traditional linear metering models are difficult to adapt to complex power signals. A large number of harmonic components generated by nonlinear loads will distort the current and voltage signals, resulting in metering errors. Existing technologies usually use filters to suppress the influence of harmonics on signals, but while suppressing high-frequency interference, filters may also weaken the amplitudes of some useful signals, leading to a decrease in metering accuracy. In addition, traditional metering models cannot adapt to different load scenarios and environmental changes in real time, and are prone to metering deviations in dynamic scenarios.
[0004] In the field of harmonic analysis, existing technologies have tried to extract harmonic features through fast Fourier transform and use fixed compensation methods to correct errors for harmonics of different frequencies. However, traditional methods usually use simple linear models for low-frequency harmonics and lack effective nonlinear modeling capabilities for high-frequency harmonics. In addition, fixed compensation models have poor adaptability to load types and harmonic distributions and are difficult to cope with the real-time changes of power signals. At the same time, existing technologies lack a dynamic mechanism in harmonic hierarchical modeling and cannot adjust modeling strategies according to the harmonic characteristics in different scenarios, further limiting the applicability and accuracy of metering systems.
[0005] In the data pre - processing stage, traditional methods mostly adopt simple signal - processing techniques such as filtering and mean processing. Although they can remove some noise, it is difficult to retain the detailed features of the signal simultaneously. In recent years, the application of machine - learning and deep - learning techniques in the field of power - signal processing has gradually emerged. In particular, the Autoencoder has shown excellent performance in data dimensionality reduction and feature extraction. However, traditional autoencoders usually rely on a fixed latent - space distribution and lack dynamic adaptability, making it difficult to cope with the changes in data distribution under different loads and environmental conditions. Based on this, the Variational Autoencoder (VAE) optimizes the latent - space distribution by introducing regularization constraints, making it more adaptable. However, in the existing technology, VAE has not been applied to the metering - data optimization and anomaly detection of AC charging piles.
[0006] In addition, in the design of metering models, existing technologies usually use simple multi - layer perceptron networks or convolutional neural networks for error modeling. However, most of these models lack optimization in specific domains. Especially when dealing with non - linear signals, traditional activation functions and regularization strategies are difficult to balance high accuracy and real - time performance, resulting in insufficient model generalization performance. Although some studies have introduced sparse regularization to reduce model complexity, they have not fully combined adaptive activation functions to enhance the fitting ability for dynamic signals.
[0007] The error - fusion and feedback - optimization mechanism is another important defect in the existing technology. Currently, most metering systems only optimize the model for static - load conditions and lack a real - time adjustment mechanism for dynamic scenarios. Especially in the modeling of global and local errors, existing technologies usually use a single fixed model and cannot effectively distinguish the contributions of different frequency components to the total error. In addition, the feedback - optimization mechanism often stays in the offline - analysis stage and lacks real - time closed - loop optimization ability, making it difficult to meet the requirements of high accuracy and dynamic adaptability in actual application scenarios. Summary of the Invention
[0008] An object of the present invention is to propose a metering - optimization method for AC charging piles based on a multi - layer perceptron network. The present invention combines a dynamic variational autoencoder, a multi - scale error - learning mechanism, harmonic hierarchical modeling and compensation, and a real - time feedback mechanism to form an innovative technical solution. The data is denoised and reconstructed by the dynamic variational autoencoder. Through harmonic hierarchical modeling, linear and non - linear compensation models are designed for low - frequency and high - frequency harmonics respectively, improving the harmonic - compensation accuracy. Through the multi - scale error - learning mechanism, global and local errors are dynamically fused, enhancing the model's adaptability to complex scenarios. Through the real - time feedback mechanism, model parameters are dynamically adjusted to achieve high - accuracy and real - time metering optimization.
[0009] A metering - optimization method for AC charging piles based on a multi - layer perceptron network according to an embodiment of the present invention includes the following steps:
[0010] S1. Collect the metering data of the AC charging pile;
[0011] S2. Input the collected metering data into the dynamic variational autoencoder. Compress the metering data through the encoder of the dynamic variational autoencoder, remove abnormal data and noise interference, reconstruct the metering data using the decoder of the dynamic variational autoencoder, and output the reconstructed data;
[0012] S3. Conduct frequency-domain analysis on the reconstructed data, identify harmonic components and classify them. Divide the harmonics into low-frequency harmonics and high-frequency harmonics. Based on the classified harmonic data, use a linear regression model to compensate for the low-frequency harmonic error, and use a non-linear compensation model to compensate for the high-frequency harmonic error to obtain a harmonic error compensation value;
[0013] S4. Input the harmonic error compensation value and the reconstructed data into a multi-layer perceptron network, and perform calculations through the multi-layer perceptron network to calculate a preliminary metering error compensation value;
[0014] S5. Use a multi-scale error learning mechanism to model the global error and local error, and dynamically fuse the global error and local error through an attention weight mechanism. According to the fusion result of the multi-scale error learning mechanism, correct the preliminary metering error compensation value to obtain a final metering error compensation value, and output the metering value after error compensation.
[0015] Optionally, the S2 specifically includes:
[0016] S21. Transfer the collected metering data as input to the input layer of the dynamic variational autoencoder, and perform feature normalization processing to map all metering data features to the range of [0,1] to ensure that the input features have the same numerical scale. The metering data includes current, voltage, frequency, phase angle, and harmonic data;
[0017] S22. Through the encoder part of the dynamic variational autoencoder, map the metering data after feature normalization to the latent space to generate a latent representation variable:
[0018] Z~p θ (Z|X);
[0019] Z = {z1,z2,...,z m};
[0020] where Z represents the compressed representation in the latent space, m represents the dimension of the latent space, X represents the input data, and p θ (Z|X) represents the probability distribution of the latent space variable Z under the condition of the input data X, and θ represents the weight parameter of the encoder;
[0021] S23. The dynamic variational autoencoder optimizes the distribution of the latent space through regularization constraints, and uses the objective function $L$ to represent the joint objective of latent distribution optimization and reconstructed data quality:
[0022]
[0023] Among them, $q$ φ $(Z|X)$ represents the variational distribution, $\varphi$ represents the parameters of the variational distribution, $p$ θ $(X|Z)$ represents the conditional probability distribution of the reconstructed data, $p$ θ $(Z)$ represents the prior distribution, $D$ KL $(q$ φ $(Z|X)||p$ θ $(Z))$ represents the Kullback-Leibler divergence, which is used to measure the difference between the latent distribution $q$ φ $(Z|X)$ and the prior distribution $p$ θ $(Z)$, $E$ represents the mathematical expectation, indicating the optimization objective of the model for the latent distribution;
[0024] S24. Perform inverse mapping through the decoder part of the dynamic variational autoencoder to decode the latent variable $Z$ into reconstructed data;
[0025] S25. Calculate the reconstruction error using the measurement data and the reconstructed data, and use the mean square error as the loss function;
[0026]
[0027] Among them, $L$ r represents the loss function, which is used to evaluate the quality of the reconstructed data, $n$ represents the number of data samples, $X$ i represents the measurement data, represents the reconstructed data;
[0028] S26. Combine the regularization objective of the encoder and the reconstruction objective of the decoder, and dynamically adjust the weight parameters of the dynamic variational autoencoder to minimize the total loss function;
[0029] $L$ total $=L + L$ r ;
[0030] Among them, $L$ total represents the total loss function;
[0031] S27. Output the reconstructed data generated by the optimized dynamic variational autoencoder.
[0032] Optionally, the specific content of S3 includes:
[0033] S31. Perform frequency domain conversion on the reconstructed data using the fast Fourier transform to obtain frequency components and the corresponding amplitude
[0034]
[0035] wherein, represents the frequency component, represents the nth sampling value in the time domain, j represents the imaginary unit, k represents the order of the harmonic, and N represents the total number of sampling points;
[0036] S32. Identify the harmonic components of the reconstructed signal according to the frequency component and the corresponding amplitude, and separate the harmonic components contained in the signal from the fundamental wave signal;
[0037] S33. Perform hierarchical processing on the reconstructed harmonic signal, divide the harmonics into two parts: low-frequency harmonics and high-frequency harmonics based on the magnitude of the harmonic frequency. For low-frequency harmonics, record their corresponding amplitudes and harmonic orders to generate a set of low-frequency harmonic components. For high-frequency harmonics, record their corresponding amplitudes and harmonic orders to generate a set of high-frequency harmonic components;
[0038] S34. For low-frequency harmonics, use a linear regression model to model and compensate for the low-frequency harmonic error:
[0039]
[0040] wherein, represents the error compensation value of the kth-order low-frequency harmonic, a k and b k represent the parameters of the linear regression model, which are obtained by fitting historical data, represents the amplitude of the kth-order low-frequency harmonic;
[0041] S35. Apply the error compensation value output by the linear regression model to the low-frequency harmonics to obtain the compensated low-frequency harmonics:
[0042]
[0043] wherein, represents the compensated low-frequency harmonics, represents the low-frequency harmonics;
[0044] S36. For high-frequency harmonics, use a non-linear compensation model to model and compensate for the high-frequency harmonic error:
[0045]
[0046] wherein, represents the error compensation value of the kth-order high-frequency harmonic, c k and d kRepresents the parameters of the non-linear compensation model, obtained by fitting historical data. Represents the amplitude of the k-th order high-frequency harmonic;
[0047] S37. Apply the error compensation value output by the non-linear compensation model to the high-frequency harmonic to obtain the compensated high-frequency harmonic:
[0048]
[0049] Wherein, Represents the compensated low-frequency harmonic, Represents the low-frequency harmonic;
[0050] S38. Combine the compensated low-frequency harmonic and high-frequency harmonic to generate the final harmonic compensation and output the harmonic error compensation value.
[0051] Optionally, the S4 specifically includes:
[0052] S41. Use the harmonic error compensation value and the reconstructed data as input data;
[0053] S42. Perform feature combination processing on the input data, align the input data in time, and generate a feature matrix;
[0054] S43. Design a multi-layer perceptron network model. The multi-layer perceptron includes an input layer, multiple hidden layers, and an output layer. The hidden layer uses sparse regularization constraints and an adaptive activation function, and the sparse regularization constraints enforce the sparsity of the weight matrix:
[0055] σ(x) = x · sigmoid(βx);
[0056] Wherein, σ(x) represents the activation function, x represents the neuron input, and β represents the learnable adaptive parameter;
[0057] S44. Input the feature matrix into the multi-layer perceptron and calculate the preliminary measurement error compensation value through the forward propagation process:
[0058] ΔQ initial = W L · σ(W L-1 · σ(…σ(W1 · X input + b1)…)+ b L-1 )+ b L ;
[0059] Wherein, ΔQ initial represents the preliminary measurement error compensation value, W L represents the weight matrix of the L-th hidden layer, b L represents the bias vector of the L-th hidden layer, L represents the number of layers of the multi-layer perceptron, and X inputRepresents the input data.
[0060] Optionally, S5 specifically includes:
[0061] S51. Decompose the preliminary measurement error compensation value into global error and local error. The global error represents the error caused by the low-frequency characteristics of the overall input signal, and the local error represents the error caused by the high-frequency components in the input signal.
[0062] S52. Through the global error modeling module, model the low-frequency part of the feature matrix and calculate the preliminary value of the global error:
[0063] ΔQ global = g(X low );
[0064] Among them, ΔQ global represents the preliminary global error compensation value, X low represents the low-frequency features extracted from the feature matrix, and g represents the global error modeling function, which is modeled using linear regression.
[0065] S53. Through the local error modeling module, model the high-frequency part of the feature matrix and calculate the preliminary value of the local error:
[0066] ΔQ local = h(X high );
[0067] Among them, ΔQ local represents the preliminary local error compensation value, X high represents the high-frequency features extracted from the feature matrix, and h represents the local error modeling function, which is modeled using a non-linear compensation model.
[0068] S54. Fuse the global error and the local error, and dynamically allocate them through the attention weight mechanism to calculate the comprehensive error compensation value:
[0069] ΔQ fused = α·ΔQ global + (1 - α)·ΔQ local ;
[0070] Among them, ΔQ fused represents the fused comprehensive error compensation value, α represents the dynamic attention weight, and its value range is [0, 1], which is dynamically adjusted according to the characteristics of the input signal:
[0071]
[0072] Among them, Var(X low ) represents the variance of the low-frequency features, Var(X high) represents the variance of high-frequency features;
[0073] S55. Calculate the error correction value and use the comprehensive error compensation value as the correction factor:
[0074] ΔQ final =ΔQ initial +ΔQ fused ;
[0075] Among them, ΔQ final represents the measurement error compensation value;
[0076] S56. Conduct a quality assessment on the measurement error compensation value and calculate the total measurement error:
[0077]
[0078] Among them, ∈ final represents the total measurement error, Q i represents the actual measured value, represents the uncompensated measured value, and n represents the total number of measurement samples;
[0079] S57. Based on the quality assessment result, compare the total measurement error with the preset measurement error threshold. If the total measurement error is greater than the measurement error threshold, return to step S54 to readjust the attention weight and recalculate the comprehensive error compensation value. If the total measurement error is less than the measurement error threshold, output the final measurement error compensation value and output the measured value after error compensation:
[0080]
[0081] Among them, Q compensated represents the final measurement error compensation value, represents the uncompensated original measured value.
[0082] The beneficial effects of the present invention are:
[0083] First of all, by introducing a dynamic variational autoencoder to compress and reconstruct the measurement data of AC charging piles, the effect of data preprocessing is significantly improved. In traditional methods, filtering and simple normalization are prone to cause the loss of signal details, while the dynamic variational autoencoder effectively removes noise and abnormal data by optimizing the latent space distribution, and at the same time retains the key features of the signal. In addition, the dynamic variational autoencoder has strong adaptability and can dynamically adjust the latent space distribution according to different loads and environmental conditions, thus ensuring the integrity and accuracy of the data and providing high-quality input for subsequent harmonic analysis and error modeling.
[0084] Secondly, in terms of harmonic modeling and compensation, the present invention performs hierarchical processing on harmonics through frequency-domain analysis, and uses a linear regression model and a non-linear compensation model to model the low-frequency and high-frequency harmonic errors respectively. Compared with the traditional harmonic compensation method using a single model, the present invention designs a more adaptable compensation mechanism according to the differences in the characteristics of low-frequency and high-frequency harmonics. The linear modeling of low-frequency harmonics ensures high-precision compensation in simple scenarios, while the non-linear model of high-frequency harmonics overcomes the problem of insufficient error compensation ability in complex dynamic scenarios. This hierarchical modeling and compensation strategy improves the adaptability and compensation accuracy of the metering system in diverse load scenarios.
[0085] In addition, the multi-layer perceptron network of the present invention has made innovations in structural design. By combining sparse regularization and an adaptive activation function, it realizes efficient modeling of complex non-linear signals. Sparse regularization effectively reduces the computational complexity of the network, enabling it to run in real time on embedded devices, while the adaptive activation function enhances the adaptability of the model to the characteristics of different input signals by dynamically adjusting parameters, avoiding the problems of gradient disappearance or overfitting that may occur with traditional activation functions in dynamic scenarios. The integration of the multi-layer perceptron network with the reconstructed data and harmonic compensation values makes the metering error modeling more accurate, further improving the performance of metering optimization.
[0086] Finally, the multi-scale error learning mechanism is a major technological innovation point of the present invention. By separately modeling the global error and the local error and introducing a dynamic attention mechanism to fuse the contribution values of both, it realizes precise compensation for complex error characteristics. The modeling of the global error is suitable for capturing the overall characteristics of low-frequency signals, while the modeling of the local error accurately models high-frequency components and mutant signals. The dynamic attention mechanism dynamically adjusts the weight distribution according to the changes in the characteristics of the input signal, making the fused comprehensive error compensation value more in line with the actual situation and solving the problem of insufficient modeling of complex signals by traditional single-error models.
[0087] In summary, the present invention combines a dynamic variational autoencoder, a multi-scale error learning mechanism, a harmonic hierarchical compensation model, and real-time feedback optimization technology to comprehensively solve the error problems caused by non-linear loads, harmonic distortion, and environmental noise in AC charging pile metering. Through this technical solution, the metering accuracy, the dynamic adaptability of the system, and the long-term operation stability are improved, providing an efficient and reliable solution for charging metering in complex load scenarios. Description of the Drawings
[0088] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, but do not constitute a limitation to the present invention. In the drawings:
[0089] Figure 1Flow chart of an AC charging pile metering optimization method based on a multi-layer perception network proposed by the present invention;
[0090] Figure 2 Schematic diagram of the multi-scale error learning and dynamic attention fusion mechanism of an AC charging pile metering optimization method based on a multi-layer perception network proposed by the present invention. Detailed implementation manners
[0091] Now, the present invention will be further described in detail with reference to the accompanying drawings. These drawings are all simplified schematic diagrams, only illustrating the basic structure of the present invention in a schematic manner, so they only show the components related to the present invention.
[0092] Refer to Figure 1 and Figure 2 , an AC charging pile metering optimization method based on a multi-layer perception network, includes the following steps:
[0093] S1. Collect metering data of the AC charging pile;
[0094] S2. Input the collected metering data into the dynamic variational autoencoder. Compress the metering data through the encoder of the dynamic variational autoencoder to remove abnormal data and noise interference. Use the decoder of the dynamic variational autoencoder to reconstruct the metering data and output the reconstructed data;
[0095] S3. Conduct frequency-domain analysis on the reconstructed data, identify harmonic components and classify them. Divide the harmonics into low-frequency harmonics and high-frequency harmonics. Based on the classified harmonic data, use a linear regression model to compensate for low-frequency harmonic errors and a non-linear compensation model to compensate for high-frequency harmonic errors to obtain a harmonic error compensation value;
[0096] S4. Input the harmonic error compensation value and the reconstructed data into the multi-layer perception network, and perform calculations through the multi-layer perception network to calculate a preliminary metering error compensation value;
[0097] S5. Use the multi-scale error learning mechanism to model the global error and local error, and dynamically fuse the global error and local error through the attention weight mechanism. According to the fusion result of the multi-scale error learning mechanism, correct the preliminary metering error compensation value to obtain the final metering error compensation value, and output the metering value after error compensation.
[0098] In this embodiment, the specific content of S2 includes:
[0099] S21. Take the collected metering data as input and transfer it to the input layer of the dynamic variational autoencoder, and perform feature normalization processing to map all metering data features to the range of [0, 1] to ensure that the input features have the same numerical scale. The metering data includes current, voltage, frequency, phase angle, and harmonic data;
[0100] S22. Through the encoder part of the dynamic variational autoencoder, map the metering data after feature normalization to the latent space to generate latent representation variables:
[0101] Z ∼ p θ (Z|X);
[0102] Z = {z1, z2,..., z m};
[0103] where Z represents the compressed representation in the latent space, m represents the dimension of the latent space, X represents the input data, and p θ (Z|X) represents the probability distribution of the latent space variable Z under the condition of the input data X, and θ represents the weight parameters of the encoder;
[0104] S23. The dynamic variational autoencoder optimizes the distribution of the latent space through regularization constraints, and uses the objective function L to represent the joint objective of latent distribution optimization and reconstruction data quality:
[0105]
[0106] where q φ (Z|X) represents the variational distribution, φ represents the parameters of the variational distribution, p θ (X|Z) represents the conditional probability distribution of the reconstructed data, p θ (Z) represents the prior distribution, D KL (q φ (Z|X)||p θ (Z)) represents the Kullback-Leibler divergence, which is used to measure the difference between the latent distribution q φ (Z|X) and the prior distribution p θ (Z), and E represents the mathematical expectation, indicating the optimization objective of the model for the latent distribution;
[0107] S24. Perform inverse mapping through the decoder part of the dynamic variational autoencoder to decode the latent variable Z into reconstructed data;
[0108] S25. Calculate the reconstruction error using the metering data and the reconstructed data, and adopt the mean square error as the loss function;
[0109]
[0110] where L r represents the loss function, which is used to evaluate the quality of the reconstructed data, n represents the number of data samples, X i represents the metering data, represents the reconstructed data;
[0111] S26. Combine the regularization objective of the encoder and the reconstruction objective of the decoder to dynamically adjust the weight parameters of the dynamic variational autoencoder to minimize the total loss function;
[0112] L total = L + L r ;
[0113] where L total represents the total loss function;
[0114] S27. Output the reconstructed data generated by the optimized dynamic variational autoencoder.
[0115] In this embodiment, S3 specifically includes:
[0116] S31. Perform frequency-domain conversion on the reconstructed data using the fast Fourier transform to obtain the frequency components and the corresponding amplitudes
[0117]
[0118] where represents the frequency component, represents the nth sampling value in the time domain, j represents the imaginary unit, k represents the order of the harmonic, and N represents the total number of sampling points;
[0119] S32. Identify the harmonic components of the reconstructed signal based on the frequency components and the corresponding amplitudes, and separate the harmonic components contained in the signal from the fundamental wave signal;
[0120] S33. Perform hierarchical processing on the reconstructed harmonic signal, divide the harmonics into two parts: low-frequency harmonics and high-frequency harmonics based on the magnitude of the harmonic frequency. For low-frequency harmonics, record their corresponding amplitudes and harmonic orders to generate a set of low-frequency harmonic components. For high-frequency harmonics, record their corresponding amplitudes and harmonic orders to generate a set of high-frequency harmonic components;
[0121] S34. For low-frequency harmonics, use a linear regression model to model and compensate for the low-frequency harmonic error:
[0122]
[0123] where represents the error compensation value of the kth-order low-frequency harmonic, a k and b k represent the parameters of the linear regression model, which are obtained by fitting historical data, represents the amplitude of the kth-order low-frequency harmonic;
[0124] S35. Apply the error compensation value output by the linear regression model to the low-frequency harmonics to obtain the compensated low-frequency harmonics:
[0125]
[0126] where, represents the compensated low-frequency harmonics, represents the low-frequency harmonics;
[0127] S36. For high-frequency harmonics, use a non-linear compensation model to model and compensate the high-frequency harmonic error:
[0128]
[0129] where, represents the error compensation value of the k-th order high-frequency harmonics, c k and d k represent the parameters of the non-linear compensation model, which are obtained by fitting historical data, represents the amplitude of the k-th order high-frequency harmonics;
[0130] S37. Apply the error compensation value output by the non-linear compensation model to the high-frequency harmonics to obtain the compensated high-frequency harmonics:
[0131]
[0132] where, represents the compensated low-frequency harmonics, represents the low-frequency harmonics;
[0133] S38. Combine the compensated low-frequency harmonics and high-frequency harmonics to generate the final harmonic compensation and output the harmonic error compensation value.
[0134] In this embodiment, the specific steps of S4 are as follows:
[0135] S41. Use the harmonic error compensation value and the reconstructed data as input data;
[0136] S42. Perform feature combination processing on the input data, align the input data in time, and generate a feature matrix;
[0137] S43. Design a multi-layer perceptron network model. The multi-layer perceptron includes an input layer, multiple hidden layers, and an output layer. The hidden layer uses sparse regularization constraints and an adaptive activation function, and the sparse regularization constraints enforce the sparsity of the weight matrix:
[0138] σ(x) = x · sigmoid(βx);
[0139] where, σ(x) represents the activation function, x represents the neuron input, and β represents the learnable adaptive parameter;
[0140] S44. Input the feature matrix into a multi-layer perceptron network and calculate the preliminary measurement error compensation value through the forward propagation process:
[0141] ΔQ initial = W L ·σ(W L-1 ·σ(…σ(W1·X input +b1)…)+b L-1 )+b L ;
[0142] where, ΔQ initial represents the preliminary measurement error compensation value, W L represents the weight matrix of the L-th hidden layer, b L represents the bias vector of the L-th hidden layer, L represents the number of layers of the multi-layer perceptron network, and X input represents the input data.
[0143] In this embodiment, S5 specifically includes:
[0144] S51. Decompose the preliminary measurement error compensation value into global error and local error. The global error represents the error caused by the low-frequency characteristics of the overall input signal, and the local error represents the error caused by the high-frequency components in the input signal;
[0145] S52. Through the global error modeling module, model the low-frequency part of the feature matrix and calculate the preliminary value of the global error:
[0146] ΔQ global = g(X low );
[0147] where, ΔQ global represents the preliminary global error compensation value, X low represents the low-frequency features extracted from the feature matrix, and g represents the global error modeling function, which is modeled using linear regression;
[0148] S53. Through the local error modeling module, model the high-frequency part of the feature matrix and calculate the preliminary value of the local error:
[0149] ΔQ local = h(X high );
[0150] where, ΔQ local represents the preliminary local error compensation value, X high represents the high-frequency features extracted from the feature matrix, and h represents the local error modeling function, which is modeled using a non-linear compensation model;
[0151] S54. Integrate the global error and the local error, dynamically allocate them through the attention weight mechanism, and calculate the comprehensive error compensation value:
[0152] ΔQ fused = α·ΔQ global +(1 - α)·ΔQ local ;
[0153] where, ΔQ fused represents the integrated comprehensive error compensation value, α represents the dynamic attention weight, and its value range is [0, 1], which is dynamically adjusted according to the characteristics of the input signal:
[0154]
[0155] where, Var(X low ) represents the variance of the low - frequency features, and Var(X high ) represents the variance of the high - frequency features;
[0156] S55. Calculate the error correction value, and use the comprehensive error compensation value as the correction factor:
[0157] ΔQ final = ΔQ initial + ΔQ fused ;
[0158] where, ΔQ final represents the measurement error compensation value;
[0159] S56. Conduct a quality assessment on the measurement error compensation value, and calculate the total measurement error:
[0160]
[0161] where, ∈ final represents the total measurement error, Q i represents the actual measured value, represents the uncompensated measured value, and n represents the total number of measurement samples;
[0162] S57. Based on the quality assessment result, compare the total measurement error with the preset measurement error threshold. If the total measurement error is greater than the measurement error threshold, return to step S54 to readjust the attention weight and recalculate the comprehensive error compensation value. If the total measurement error is less than the measurement error threshold, output the final measurement error compensation value and output the measured value after error compensation:
[0163]
[0164] where, Q compensated represents the final measurement error compensation value, represents the original uncompensated measured value.
[0165] Example 1:
[0166] On an AC charging pile at a new energy vehicle charging service center in a certain city, a metering optimization system based on the method of the present invention is deployed. This charging pile serves different types of electric vehicles, and variables such as vehicle battery characteristics, charging duration, and environmental conditions are complex and diverse. In actual applications, the metering optimization system first collects metering data such as three-phase current, voltage, frequency, phase angle, and harmonic components of the charging pile through built-in sensors. These data are input into a dynamic variational autoencoder, and the encoder part of it compresses the data. After removing abnormal signals and noise interference, it is reconstructed into high-quality metering data through the decoder part. The reconstructed data is then subjected to a fast Fourier transform to identify and classify low-frequency harmonics and high-frequency harmonics. For low-frequency harmonics, a linear regression model is used to compensate for errors, and for high-frequency harmonics, a non-linear model is introduced for precise compensation, and finally a harmonic error compensation value is generated. The reconstructed data and the harmonic compensation value are simultaneously input into an optimized multi-layer perceptron network. This network models the input data through sparse regularization and an adaptive activation function, and calculates a preliminary metering error compensation value. The system uses a multi-scale error learning mechanism to model global errors and local errors, and dynamically fuses the contributions of both through an attention weight mechanism to correct the preliminary metering error compensation value, and finally generates an optimized metering value.
[0167] To verify the effectiveness of the method of the present invention, experimental data for one month was recorded for this metering optimization system and compared with traditional metering methods. During the experiment, data from 5000 charging sessions was collected. The metering results of the traditional metering method and the optimized method of the present invention were both recorded and compared with the reference value of a standard electrical energy metering device to calculate the total metering error.
[0168] Table 1 Comparison of experimental data between traditional metering method and the method of the present invention
[0169] Index Traditional measurement method Method of the present invention Total measurement error 5.8% 1.2% High-frequency harmonic error 3.5% 0.5% Low-frequency harmonic error 1.8% 0.4% Processing time (per measurement) 20ms 35ms Error range 2.0%-8.0% 0.3%-1.8% Total number of measurement samples 5000 5000
[0170] In terms of the overall performance of metering errors, the average metering error of the traditional metering method under dynamic load conditions is 5.8%, and the error range is between 2.0% and 8.0%, showing obvious instability. This situation is particularly prominent in complex load scenarios. The present invention uses a dynamic variational autoencoder to preprocess the input data, and through a compression and reconstruction mechanism, abnormal data and noise interference are removed, making the input signal cleaner and reducing the generation of errors from the source. At the same time, the multi-scale error learning mechanism, through the refined modeling and dynamic fusion of global and local errors, combined with the non-linear modeling ability of the multi-layer perceptron network, reduces the average error to 1.2%, and controls the error range within 0.3% to 1.8%, achieving an improvement in metering accuracy.
[0171] In the scenario of the influence of high-frequency harmonics on the metering results, the present invention demonstrates excellent adaptability. The traditional method has limited compensation ability for high-frequency harmonic errors, with an average error of 3.5%. Moreover, in the case of a large proportion of high-frequency harmonics, the error contribution is further amplified, making it difficult to guarantee the metering accuracy. The present invention adopts a harmonic hierarchical modeling and compensation strategy, using a linear regression model for low-frequency harmonics and a non-linear compensation model for high-frequency harmonics, significantly enhancing the harmonic adaptability and compensation ability of the system. Experimental data shows that the system controls the high-frequency harmonic error within an average range of 0.5%, and the low-frequency harmonic error is also reduced from 1.8% to 0.4%, achieving relatively accurate error correction.
[0172] In addition, although the system adds 15 ms of processing time to each metering, its optimized processing time can still be maintained within 35 ms, fully meeting the real-time requirements in dynamic scenarios. Although the traditional metering system has a slight advantage in processing time, its high error rate leads to a large deviation in the actual metering results, especially in the case of high-frequency charging scenarios where the cumulative error is more obvious. Through advanced modeling techniques and optimization strategies, the present invention significantly improves the metering accuracy on the premise of slightly increasing the computing cost. In the long run, this increase in processing time is completely worthwhile.
[0173] In summary, the present invention improves the accuracy of the metering system, realizes comprehensive compensation for non-linear loads and harmonic distortions through a dynamic variational autoencoder and a multi-scale error learning mechanism, and provides an efficient and stable solution for the high-precision and real-time metering requirements of AC charging piles.
[0174] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, makes equivalent substitutions or changes, and should be covered by the protection scope of the present invention.
Claims
1. An AC charging pile metering optimization method based on a multi-layer perceptron network, characterized in that, It includes the following steps: S1. Collect the metering data of the AC charging pile; S2. Input the collected metering data into the dynamic variational autoencoder. Compress the metering data through the encoder of the dynamic variational autoencoder, remove abnormal data and noise interference, reconstruct the metering data using the decoder of the dynamic variational autoencoder, and output the reconstructed data; S3. Conduct frequency-domain analysis on the reconstructed data, identify and classify harmonic components, divide the harmonics into low-frequency harmonics and high-frequency harmonics. Based on the classified harmonic data, use a linear regression model to compensate for low-frequency harmonic errors and a non-linear compensation model to compensate for high-frequency harmonic errors to obtain a harmonic error compensation value; S4. Input the harmonic error compensation value and the reconstructed data into a multi-layer perceptron network, and perform calculations through the multi-layer perceptron network to calculate a preliminary metering error compensation value; S5. Use a multi-scale error learning mechanism to model the global error and local error, and dynamically fuse the global error and local error through an attention weight mechanism. According to the fusion result of the multi-scale error learning mechanism, correct the preliminary metering error compensation value to obtain the final metering error compensation value, and output the metering value after error compensation; The specific content of S2 includes: S21. Transfer the collected metering data as input to the input layer of the dynamic variational autoencoder, and perform feature normalization processing to map all metering data features to the range of [0, 1] to ensure that the input features have the same numerical scale. The metering data includes current, voltage, frequency, phase angle, and harmonic data; S22. Through the encoder part of the dynamic variational autoencoder, map the feature-normalized metering data to the latent space to generate a latent representation variable; S23. The dynamic variational autoencoder optimizes the distribution of the latent space through regularization constraints, and uses the objective function L to represent the joint objective of latent distribution optimization and the quality of the reconstructed data; S24. Perform an inverse mapping through the decoder part of the dynamic variational autoencoder to decode the latent variable Z into the reconstructed data; S25. Calculate the reconstruction error using the metering data and the reconstructed data, and use the mean square error as the loss function; S26. Combine the regularization objective of the encoder and the reconstruction objective of the decoder to dynamically adjust the weight parameters of the dynamic variational autoencoder to minimize the total loss function; S27. Output the reconstructed data generated by the optimized dynamic variational autoencoder; The specific content of S5 includes: S51. Decompose the preliminary metering error compensation value into global error and local error. The global error represents the error caused by the low-frequency characteristics of the overall input signal, and the local error represents the error caused by the high-frequency components in the input signal; S52. Through the global error modeling module, model the low-frequency part of the feature matrix and calculate the preliminary value of the global error; S53. Through the local error modeling module, model the high-frequency part of the feature matrix and calculate the preliminary value of the local error; S54. Fuse the global error and the local error, and dynamically allocate them through the attention weight mechanism to calculate the comprehensive error compensation value; S55. Calculate the error correction value, and use the comprehensive error compensation value as the correction factor; S56. Perform quality assessment on the measurement error compensation value and calculate the total measurement error; S57. Based on the quality assessment result, compare the total measurement error with a preset measurement error threshold. If the total measurement error is greater than the measurement error threshold, return to step S54 to readjust the attention weight and recalculate the comprehensive error compensation value. If the total measurement error is less than the measurement error threshold, output the final measurement error compensation value and output the measured value after error compensation.
2. The optimization method for measuring an AC charging pile based on a multi-layer perceptron network according to claim 1, wherein, The potential representation variable is: Z to p θ (Z or X); Z = {z1, z2,..., z m}; where Z represents the compressed representation in the latent space, m represents the dimension of the latent space, X represents the input data, and p θ (Z|X) represents the probability distribution of the latent space variable Z conditional on the input data X, and θ represents the weight parameters of the encoder; The objective function is: where q φ (Z|X) represents the variational distribution, φ represents the parameters of the variational distribution, p θ (X|Z) represents the conditional probability distribution of the reconstructed data, p θ (Z) represents the prior distribution, D KL (q φ (Z|X)||p θ (Z)) represents the Kullback-Leibler divergence, which is used to measure the difference between the latent distribution q φ (Z|X) and the prior distribution p θ (Z), and E represents the mathematical expectation, which represents the optimization objective of the model for the latent distribution; The loss function is; Among them, L r represents the loss function, which is used to evaluate the quality of the reconstructed data. n represents the number of data samples, and X i represents the measured data, and represents the reconstructed data; The total loss function is; L total = L + L r ; Among them, L total represents the total loss function.
3. The optimized method for metering an AC charging pile based on a multi-layer perception network according to claim 1, wherein The specific steps of S3 include: S31. Perform frequency-domain conversion on the reconstructed data using the fast Fourier transform to obtain the frequency components and the corresponding amplitudes Among them, represents the frequency component, represents the nth sampling value in the time domain, j represents the imaginary unit, k represents the order of the harmonic, and N represents the total number of sampling points; S32. According to the frequency components and the corresponding amplitudes, identify the harmonic components of the reconstructed signal and separate the harmonic components contained in the signal from the fundamental wave signal; S33. Perform hierarchical processing on the reconstructed harmonic signals. Based on the magnitude of the harmonic frequencies, divide the harmonics into two parts: low-frequency harmonics and high-frequency harmonics. For low-frequency harmonics, record their corresponding amplitudes and harmonic orders to generate a set of low-frequency harmonic components. For high-frequency harmonics, record their corresponding amplitudes and harmonic orders to generate a set of high-frequency harmonic components; S34. For low-frequency harmonics, use a linear regression model to model and compensate for the low-frequency harmonic errors: Among them, represents the error compensation value of the k-th order low-frequency harmonic, a k and b k represent the parameters of the linear regression model, which are obtained by fitting according to historical data, represents the amplitude of the k-th order low-frequency harmonic; S35. Apply the error compensation value output by the linear regression model to the low-frequency harmonics to obtain the compensated low-frequency harmonics: Among them, represents the compensated low-frequency harmonic, represents the low-frequency harmonic; S36. For high-frequency harmonics, use a non-linear compensation model to model and compensate for the high-frequency harmonic errors: Among them, represents the error compensation value of the k-th order high-frequency harmonic, c k and d k represent the parameters of the nonlinear compensation model, which are obtained by fitting historical data. represents the amplitude of the k-th order high-frequency harmonic; S37. Apply the error compensation value output by the non-linear compensation model to the high-frequency harmonics to obtain the compensated high-frequency harmonics: Among them, represents the compensated low-frequency harmonic, represents the low-frequency harmonic; S38. Combine the compensated low-frequency harmonics and high-frequency harmonics to generate the final harmonic compensation and output the harmonic error compensation value.
4. The AC charging pile metering optimization method based on a multi-layer perception network according to claim 1, characterized in that The specific steps of S4 include: S41. Use the harmonic error compensation value and the reconstructed data as input data; S42. Perform feature combination processing on the input data, align the input data in time, and generate a feature matrix; S43. Design a multi-layer perceptron network model. The multi-layer perceptron includes an input layer, multiple hidden layers, and an output layer. The hidden layer uses sparse regularization constraints and an adaptive activation function, and the sparse regularization constraints enforce the sparsity of the weight matrix: σ(x) = x · sigmoid(βx); where σ(x) represents the activation function, x represents the neuron input, and β represents the learnable adaptive parameter; S44. Input the feature matrix into the multi-layer perceptron and calculate the preliminary measurement error compensation value through the forward propagation process: ΔQ initial = W L ·σ(W L-1 ·σ(…σ(W1·X input + b1)…)+ b L-1 )+ b L ; Among them, ΔQ initial represents the preliminary measurement error compensation value, W L represents the weight matrix of the L-th hidden layer, b L represents the bias vector of the L-th hidden layer, L represents the number of layers of the multi-layer perceptron network, X input represents the input data.
5. A method for optimizing the metering of an AC charging pile based on a multi-layer perceptron network according to claim 1, characterized in that, The preliminary value of the global error is: ΔQ global = g(X low ); Among them, ΔQ global represents the preliminary global error compensation value, X low represents the low-frequency features extracted from the feature matrix, and g represents the global error modeling function, which is modeled using linear regression; The preliminary value of the local error is: ΔQ local = h(X high ); Among them, ΔQ local represents the preliminary local error compensation value, X high represents the high-frequency features extracted from the feature matrix, h represents the local error modeling function, and a non-linear compensation model is used for modeling; The comprehensive error compensation value is: ΔQ fused = α·ΔQ global + (1 - α)·ΔQ local ; Among them, ΔQ fused represents the comprehensive error compensation value after fusion, α represents the dynamic attention weight, and its value range is [0, 1], which is dynamically adjusted according to the characteristics of the input signal: Among them, Var(X low ) represents the variance of the low-frequency features, and Var(X high ) represents the variance of the high-frequency features; The error correction value is: ΔQ final = ΔQ initial + ΔQ fused ; Among them, ΔQ final represents the measurement error compensation value; The total measurement error is: wherein, ∈ final represents the total measurement error, Q i represents the actual measured value, represents the uncompensated measured value, and n represents the total number of measurement samples; The measured value after error compensation is: Among them, Q compensated represents the final measurement error compensation value, and represents the original uncompensated measurement value.
Citation Information
Patent Citations
High-voltage circuit breaker fault diagnosis method based on SSD-SRAE
CN112327149A
Method for reducing metering error of output electric energy of direct current charging pile
CN118604440A