Alternating current charging pile metering optimization method based on multilayer sensing network

By using a multi-layer perception network in the AC charging pile metering system, combined with a dynamic variational autoencoder and a multi-scale error learning mechanism, the problem of insufficient metrology error and adaptability in traditional metrology systems under complex load and environmental changes is solved, and high-precision and real-time metrology optimization is achieved.

CN119830742AActive Publication Date: 2025-04-15嘉兴市计量检定测试院
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411905016.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

Traditional AC charging pile metering systems are difficult to achieve high-precision metering when facing complex AC loads and environmental changes, and the existing technology has shortcomings in harmonic analysis and error modeling, resulting in insufficient metrological errors and system adaptability.

Method used

A multi-layer perception network is used to form an innovative technical solution by combining dynamic variational autoencoder, multi-scale error learning mechanism, harmonic hierarchical modeling and compensation, and real-time feedback mechanism. Through dynamic variational autoencoder denoising and reconstruction of data, harmonic hierarchical modeling performs accurate compensation, and dynamic fusion errors are integrated by multi-scale error learning mechanism to achieve high-precision and real-time measurement optimization.

Benefits of technology

It significantly improves metrology accuracy, reduces metrology errors, enhances the dynamic adaptability and long-term operation stability of the system, and provides an efficient and reliable solution for charging metrology in complex load scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830742A_ABST
    Figure CN119830742A_ABST
Patent Text Reader

Abstract

The invention discloses an alternating current charging pile metering optimization method based on a multilayer sensing network. The method comprises the following steps: collecting metering data of an alternating current charging pile; compressing the data through an encoder of the dynamic variational auto-encoder, and reconstructing the measurement data through a decoder of the dynamic variational auto-encoder; performing frequency domain analysis on the reconstructed data, identifying and grading harmonic components, and compensating a low-frequency harmonic error and a high-frequency harmonic error; calculating an initial metering error compensation value; and performing modeling on the global error and the local error by using a multi-scale error learning mechanism, dynamically fusing the global error and the local error, and correcting the initial metering error compensation value. According to the method, the dynamic variational auto-encoder, the multi-scale error learning mechanism and the multi-layer sensing network are utilized, the metering error of the alternating current charging pile is optimized, and the method has the advantages of being high in metering precision, high in adaptability and excellent in robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric energy metering optimization, and in particular to an AC charging pile metering optimization method based on a multi-layer perception 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. AC charging piles have been widely used in urban and highway scenarios due to their high efficiency and convenience. During the charging process, the accuracy of electric energy metering is directly related to the calculation of users' charging costs and the fairness of power operators' revenue. Therefore, improving the metering accuracy of AC charging piles and reducing metering errors caused by complex loads and environmental influences have become important topics of concern in the industry.

[0003] The traditional AC charging pile metering system is mainly based on the real-time acquisition of current and voltage signals, and calculates active power and energy 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. The 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 impact of harmonics on signals, but while suppressing high-frequency interference, filters may also weaken the amplitude of some useful signals, resulting in reduced metering accuracy. In addition, traditional metering models cannot adapt to different load scenarios and environmental changes in real time, and metering deviations are prone to occur in dynamic scenarios.

[0004] In the field of harmonic analysis, existing technologies have attempted to extract harmonic features through fast Fourier transforms and use fixed compensation methods to perform error correction on 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 real-time changes in power signals. At the same time, existing technologies lack dynamic mechanisms in harmonic hierarchical modeling and are unable to adjust modeling strategies based on harmonic characteristics in different scenarios, further limiting the applicability and accuracy of metering systems.

[0005] In the data preprocessing stage, traditional methods mostly use simple signal processing techniques such as filtering and mean processing. Although some noise can be removed, it is difficult to retain the detailed characteristics of the signal at the same time. In recent years, the application of machine learning and deep learning technologies in the field of power signal processing has gradually emerged, especially the autoencoder (Autoencoder) has performed well in data dimensionality reduction and feature extraction. However, traditional autoencoders usually rely on a fixed latent space distribution, lack dynamic adaptive capabilities, and are difficult to cope with changes in data distribution under different load and environmental conditions. On this basis, the variational autoencoder optimizes the latent space distribution by introducing regularization constraints, making it more adaptable, but VAE has not yet been applied to the metering data optimization and anomaly detection of AC charging piles in the prior art.

[0006] In addition, in terms of the design of metrological models, existing technologies usually use simple multi-layer perceptron networks or convolutional neural networks for error modeling, but most of these models lack optimization in specific fields. Especially when facing nonlinear signals, traditional activation functions and regularization strategies are difficult to balance high precision and real-time performance, resulting in insufficient model generalization performance. Although some studies have introduced sparse regularization to reduce model complexity, they have not yet fully combined adaptive activation functions to enhance the ability to fit dynamic signals.

[0007] Error fusion and feedback optimization mechanism is another important defect in the existing technology. Most current metering systems only optimize models for static load conditions and lack real-time adjustment mechanisms for dynamic scenarios. Especially in the modeling of global and local errors, the existing technology usually uses a single fixed model and cannot effectively distinguish the contribution of different frequency components to the total error. In addition, the feedback optimization mechanism often remains in the offline analysis stage and lacks real-time closed-loop optimization capabilities, making it difficult to meet the requirements for high precision and dynamic adaptability in actual application scenarios. Summary of the invention

[0008] One purpose of the present invention is to propose an AC charging pile metering optimization method based on a multi-layer perception 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 a set of innovative technical solutions. The data is denoised and reconstructed by a dynamic variational autoencoder, and linear and nonlinear compensation models are designed for low-frequency and high-frequency harmonics respectively through harmonic hierarchical modeling, which improves the accuracy of harmonic compensation. Through a multi-scale error learning mechanism, global and local errors are dynamically integrated to enhance the model's adaptability to complex scenarios. Through a real-time feedback mechanism, model parameters are dynamically adjusted to achieve high-precision, real-time metering optimization.

[0009] According to an embodiment of the present invention, a method for optimizing AC charging pile metering based on a multi-layer perception network includes the following steps:

[0010] S1. Collect metering data of AC charging piles;

[0011] S2, inputting the collected metering data into a dynamic variational autoencoder, compressing the metering data through the encoder of the dynamic variational autoencoder, removing abnormal data and noise interference, reconstructing the metering data using the decoder of the dynamic variational autoencoder, and outputting the reconstructed data;

[0012] S3, performing frequency domain analysis on the reconstructed data, identifying and classifying harmonic components, dividing the harmonics into low-frequency harmonics and high-frequency harmonics, and based on the classified harmonic data, using a linear regression model to compensate for low-frequency harmonic errors, and using a nonlinear compensation model to compensate for high-frequency harmonic errors, to obtain harmonic error compensation values;

[0013] S4, inputting the harmonic error compensation value and the reconstructed data into the multi-layer perception network, and calculating the preliminary measurement error compensation value through the multi-layer perception network;

[0014] S5. Use a multi-scale error learning mechanism to model the global error and the local error, and dynamically fuse the global error and the local error through an attention weight mechanism. According to the fusion result of the multi-scale error learning mechanism, correct the preliminary measurement error compensation value to obtain the final measurement error compensation value, and output the measurement value after error compensation.

[0015] Optionally, the S2 specifically includes:

[0016] S21, passing the collected metering data as input to the input layer of the dynamic variational autoencoder, and performing feature normalization processing, mapping all metering data features to the range of [0,1], and ensuring 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, the feature normalized measurement data is mapped to the latent space to generate the 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 goal of latent distribution optimization and reconstruction data quality:

[0022]

[0023] Among them, q φ (Z|X) represents the variational distribution, φ represents the parameter of the variational distribution, and 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 potential distribution q φ (Z|X) and prior distribution p θ (Z), E represents the mathematical expectation, which indicates the optimization goal of the model for the potential distribution;

[0024] S24, performing reverse mapping through the decoder part of the dynamic variational autoencoder to decode the latent variable Z into reconstructed data;

[0025] S25, calculating the reconstruction error using the measurement data and the reconstruction data, and using 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, and X i Represents measurement data, Represents reconstruction data;

[0028] S26. Combining the regularization objective of the encoder and the reconstruction objective of the decoder, 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 totalr represents the total loss function;

[0031] S27. Output the reconstructed data generated by the optimized dynamic variational autoencoder.

[0032] Optionally, the S3 specifically includes:

[0033] S31, use fast Fourier transform to convert the reconstructed data into frequency domain to obtain frequency components and the corresponding amplitude

[0034]

[0035] in, 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, identifying harmonic components of the reconstructed signal according to the frequency components and the corresponding amplitudes, and separating the harmonic components contained in the signal from the fundamental signal;

[0037] S33, performing hierarchical processing on the reconstructed harmonic signal, dividing the harmonic into low-frequency harmonics and high-frequency harmonics based on the magnitude of the harmonic frequency, for the low-frequency harmonics, recording the corresponding amplitude and harmonic order, generating a set of low-frequency harmonic components, for the high-frequency harmonics, recording the corresponding amplitude and harmonic order, generating a set of high-frequency harmonic components;

[0038] S34. For low-frequency harmonics, a linear regression model is used to model and compensate for low-frequency harmonic errors:

[0039]

[0040] in, represents the error compensation value of the kth order low-frequency harmonic, a k and b k Represents the parameters of the linear regression model, which is obtained by fitting the historical data. represents the amplitude of the k-th order low-frequency harmonic;

[0041] S35, applying the error compensation value output by the linear regression model to the low-frequency harmonics to obtain compensated low-frequency harmonics:

[0042]

[0043] in, represents the compensated low-frequency harmonics, Indicates low-frequency harmonics;

[0044] S36. For high-frequency harmonics, a nonlinear compensation model is used to model and compensate for high-frequency harmonic errors:

[0045]

[0046] in, represents the error compensation value of the kth order high frequency harmonic, c k and d kRepresents the parameters of the nonlinear compensation model, which is obtained by fitting historical data. represents the amplitude of the k-th order high-frequency harmonic;

[0047] S37, applying the error compensation value output by the nonlinear compensation model to the high-frequency harmonics to obtain compensated high-frequency harmonics:

[0048]

[0049] in, represents the compensated low-frequency harmonics, Indicates low-frequency harmonics;

[0050] S38, combining the compensated low-frequency harmonics and high-frequency harmonics to generate final harmonic compensation, and outputting a harmonic error compensation value.

[0051] Optionally, the S4 specifically includes:

[0052] S41, using the harmonic error compensation value and the reconstruction data as input data;

[0053] S42, performing feature combination processing on the input data, aligning the input data by time, and generating a feature matrix;

[0054] S43. Design a multi-layer perception network model, wherein the multi-layer perception network includes an input layer, multiple hidden layers and an output layer, wherein the hidden layer adopts a sparse regularization constraint and an adaptive activation function, and the sparse regularization constraint enforces the sparsity of the weight matrix:

[0055] σ(x) = x·sigmoid(βx);

[0056] Among them, σ(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 perception network, 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] Among them, ΔQ initial Represents the preliminary measurement error compensation value, W L represents the weight matrix of the Lth hidden layer, b L represents the bias vector of the Lth hidden layer, L represents the number of layers in the multi-layer perception network, X inputRepresents input data.

[0060] Optionally, the S5 specifically includes:

[0061] S51, performing error decomposition on the preliminary measurement error compensation value, into global error and local error, wherein 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. Model the low-frequency part of the feature matrix through the global error modeling module, 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, g represents the global error modeling function, and linear regression is used for modeling;

[0065] S53, through the local error modeling module, the high-frequency part of the feature matrix is ​​modeled and the preliminary value of the local error is calculated:

[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, h represents the local error modeling function, and the nonlinear compensation model is used for modeling;

[0068] S54, the global error and the local error are integrated, dynamically allocated through the attention weight mechanism, and the comprehensive error compensation value is calculated:

[0069] ΔQ fused =α·ΔQ global +(1-α)·ΔQ local ;

[0070] Among them, ΔQ fused represents the comprehensive error compensation value after fusion, α represents the dynamic attention weight, which ranges from [0,1] and is dynamically adjusted according to the characteristics of the input signal:

[0071]

[0072] Among them, Var(X low ) represents the variance of 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 Indicates the measurement error compensation value;

[0076] S56. Perform 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 Indicates the actual measurement value. represents the uncompensated measurement value, and n represents the total number of measurement samples;

[0079] S57. Based on the quality assessment result, the total measurement error is compared with the preset measurement error threshold. If the total measurement error is greater than the measurement error threshold, the process returns 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, the final measurement error compensation value is output, and the measurement value after error compensation is output:

[0080]

[0081] Among them, Q compensated Represents the final measurement error compensation value, Represents the raw, uncompensated measurement value.

[0082] The beneficial effects of the present invention are:

[0083] First, by introducing a dynamic variational autoencoder to compress and reconstruct the metering data of the AC charging pile, the effect of data preprocessing is significantly improved. In traditional methods, filtering and simple normalization easily lead to the loss of signal details, while the dynamic variational autoencoder effectively removes noise and abnormal data by optimizing the latent space distribution while retaining the key features of the signal. In addition, the dynamic variational autoencoder has a strong adaptive ability and can dynamically adjust the latent space distribution according to different loads and environmental conditions, thereby 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 linear regression models and nonlinear compensation models to model low-frequency and high-frequency harmonic errors respectively. Compared with the traditional single-model harmonic compensation method, the present invention designs a more adaptable compensation mechanism based on the differences in low-frequency and high-frequency harmonic characteristics. The linear modeling of low-frequency harmonics ensures high-precision compensation in simple scenarios, while the nonlinear model of high-frequency harmonics overcomes the problem of insufficient error compensation capabilities in complex dynamic scenarios. This hierarchical modeling and compensation strategy improves the adaptability and compensation accuracy of the metering system in diversified load scenarios.

[0085] In addition, the multi-layer perception network of the present invention has made innovations in structural design. Through the combination of sparse regularization and adaptive activation function, efficient modeling of complex nonlinear signals is achieved. 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 different input signal characteristics by dynamically adjusting parameters, avoiding the gradient vanishing or overfitting problems that may occur in traditional activation functions in dynamic scenarios. The fusion of the multi-layer perception network with the reconstructed data and harmonic compensation values ​​makes the measurement error modeling more accurate and further improves the performance of measurement optimization.

[0086] Finally, the multi-scale error learning mechanism is a major technical innovation of the present invention. By modeling the global error and local error separately and introducing the dynamic attention mechanism to fuse the contribution values ​​of the two, accurate compensation for complex error characteristics is achieved. The modeling of global errors is suitable for capturing the overall characteristics of low-frequency signals, while the modeling of local errors is accurate for high-frequency components and mutation signals. The dynamic attention mechanism dynamically adjusts the weight distribution according to the changes in the characteristics of the input signal, so that the integrated error compensation value after fusion is more in line with the actual situation, solving the problem that the traditional single error model is insufficient in modeling complex signals.

[0087] In summary, the present invention combines dynamic variational autoencoders, multi-scale error learning mechanisms, harmonic hierarchical compensation models, and real-time feedback optimization technology to comprehensively solve the error problems caused by nonlinear 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] The accompanying 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 and do not constitute a limitation of the present invention. In the accompanying drawings:

[0089] Figure 1A flowchart of an AC charging pile metering optimization method based on a multi-layer perception network proposed by the present invention;

[0090] Figure 2 This is a schematic diagram of the multi-scale error learning and dynamic attention fusion mechanism of the AC charging pile metering optimization method based on a multi-layer perception network proposed in the present invention. DETAILED DESCRIPTION

[0091] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore 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, comprising the following steps:

[0093] S1. Collect metering data of AC charging piles;

[0094] S2, inputting the collected metering data into a dynamic variational autoencoder, compressing the metering data through the encoder of the dynamic variational autoencoder, removing abnormal data and noise interference, reconstructing the metering data using the decoder of the dynamic variational autoencoder, and outputting the reconstructed data;

[0095] S3, performing frequency domain analysis on the reconstructed data, identifying and classifying harmonic components, dividing the harmonics into low-frequency harmonics and high-frequency harmonics, and based on the classified harmonic data, using a linear regression model to compensate for low-frequency harmonic errors, and using a nonlinear compensation model to compensate for high-frequency harmonic errors, to obtain harmonic error compensation values;

[0096] S4, inputting the harmonic error compensation value and the reconstructed data into the multi-layer perception network, and calculating the preliminary measurement error compensation value through the multi-layer perception network;

[0097] S5. Use a multi-scale error learning mechanism to model the global error and the local error, and dynamically fuse the global error and the local error through an attention weight mechanism. According to the fusion result of the multi-scale error learning mechanism, correct the preliminary measurement error compensation value to obtain the final measurement error compensation value, and output the measurement value after error compensation.

[0098] In this implementation, S2 specifically includes:

[0099] S21, passing the collected metering data as input to the input layer of the dynamic variational autoencoder, and performing feature normalization processing, mapping all metering data features to the range of [0,1], and ensuring 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, the feature normalized measurement data is mapped to the latent space to generate the latent representation variable:

[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 parameter 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 goal of latent distribution optimization and reconstruction data quality:

[0105]

[0106] Among them, q φ (Z|X) represents the variational distribution, φ represents the parameter of the variational distribution, and 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 potential distribution q φ (Z|X) and prior distribution p θ (Z), E represents the mathematical expectation, which indicates the optimization goal of the model for the potential distribution;

[0107] S24, performing reverse mapping through the decoder part of the dynamic variational autoencoder to decode the latent variable Z into reconstructed data;

[0108] S25, calculating the reconstruction error using the measurement data and the reconstruction data, and using the mean square error as the loss function;

[0109]

[0110] 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 measurement data, Represents reconstruction data;

[0111] S26. Combining the regularization objective of the encoder and the reconstruction objective of the decoder, dynamically adjust the weight parameters of the dynamic variational autoencoder to minimize the total loss function;

[0112] L total =L+L r ;

[0113] Among them, L totalr represents the total loss function;

[0114] S27. Output the reconstructed data generated by the optimized dynamic variational autoencoder.

[0115] In this implementation, S3 specifically includes:

[0116] S31, use fast Fourier transform to convert the reconstructed data into frequency domain to obtain frequency components and the corresponding amplitude

[0117]

[0118] in, 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, identifying harmonic components of the reconstructed signal according to the frequency components and the corresponding amplitudes, and separating the harmonic components contained in the signal from the fundamental signal;

[0120] S33, performing hierarchical processing on the reconstructed harmonic signal, dividing the harmonic into low-frequency harmonics and high-frequency harmonics based on the magnitude of the harmonic frequency, for the low-frequency harmonics, recording the corresponding amplitude and harmonic order, generating a set of low-frequency harmonic components, for the high-frequency harmonics, recording the corresponding amplitude and harmonic order, generating a set of high-frequency harmonic components;

[0121] S34. For low-frequency harmonics, a linear regression model is used to model and compensate for low-frequency harmonic errors:

[0122]

[0123] in, represents the error compensation value of the kth order low-frequency harmonic, a k and b k Represents the parameters of the linear regression model, which is obtained by fitting the historical data. represents the amplitude of the k-th order low-frequency harmonic;

[0124] S35, applying the error compensation value output by the linear regression model to the low-frequency harmonics to obtain compensated low-frequency harmonics:

[0125]

[0126] in, represents the compensated low-frequency harmonics, Indicates low-frequency harmonics;

[0127] S36. For high-frequency harmonics, a nonlinear compensation model is used to model and compensate for high-frequency harmonic errors:

[0128]

[0129] in, represents the error compensation value of the kth order high frequency harmonic, c k and d k Represents the parameters of the nonlinear compensation model, which is obtained by fitting historical data. represents the amplitude of the k-th order high-frequency harmonic;

[0130] S37, applying the error compensation value output by the nonlinear compensation model to the high-frequency harmonics to obtain compensated high-frequency harmonics:

[0131]

[0132] in, represents the compensated low-frequency harmonics, Indicates low-frequency harmonics;

[0133] S38, combining the compensated low-frequency harmonics and high-frequency harmonics to generate final harmonic compensation, and outputting a harmonic error compensation value.

[0134] In this implementation, S4 specifically includes:

[0135] S41, using the harmonic error compensation value and the reconstruction data as input data;

[0136] S42, performing feature combination processing on the input data, aligning the input data by time, and generating a feature matrix;

[0137] S43. Design a multi-layer perception network model, wherein the multi-layer perception network includes an input layer, multiple hidden layers and an output layer, wherein the hidden layer adopts a sparse regularization constraint and an adaptive activation function, and the sparse regularization constraint enforces the sparsity of the weight matrix:

[0138] σ(x) = x·sigmoid(βx);

[0139] Among them, σ(x) represents the activation function, x represents the neuron input, and β represents the learnable adaptive parameter;

[0140] S44, input the feature matrix into the multi-layer perception 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] Among them, ΔQ initial Represents the preliminary measurement error compensation value, W L represents the weight matrix of the Lth hidden layer, b L represents the bias vector of the Lth hidden layer, L represents the number of layers in the multi-layer perception network, X input Represents input data.

[0143] In this implementation manner, S5 specifically includes:

[0144] S51, performing error decomposition on the preliminary measurement error compensation value, into global error and local error, wherein 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. Model the low-frequency part of the feature matrix through the global error modeling module, and calculate the preliminary value of the global error:

[0146] ΔQ global =g(X low );

[0147] Among them, ΔQ global represents the preliminary global error compensation value, X low represents the low-frequency features extracted from the feature matrix, g represents the global error modeling function, and linear regression is used for modeling;

[0148] S53, through the local error modeling module, the high-frequency part of the feature matrix is ​​modeled and the preliminary value of the local error is calculated:

[0149] ΔQ local =h(X high );

[0150] 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 the nonlinear compensation model is used for modeling;

[0151] S54, the global error and the local error are integrated, dynamically allocated through the attention weight mechanism, and the comprehensive error compensation value is calculated:

[0152] ΔQ fused =α·ΔQ global +(1-α)·ΔQ local ;

[0153] Among them, ΔQ fused represents the comprehensive error compensation value after fusion, α represents the dynamic attention weight, which ranges from [0,1] and is dynamically adjusted according to the characteristics of the input signal:

[0154]

[0155] Among them, Var(X low ) represents the variance of low-frequency features, Var(X high ) represents the variance of 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] Among them, ΔQ final Indicates the measurement error compensation value;

[0159] S56. Perform quality assessment on the measurement error compensation value and calculate the total measurement error:

[0160]

[0161] Among them, ∈ final Represents the total measurement error, Q i Indicates the actual measurement value. represents the uncompensated measurement value, and n represents the total number of measurement samples;

[0162] S57. Based on the quality assessment result, the total measurement error is compared with the preset measurement error threshold. If the total measurement error is greater than the measurement error threshold, the process returns 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, the final measurement error compensation value is output, and the measurement value after error compensation is output:

[0163]

[0164] Among them, Q compensated Represents the final measurement error compensation value, Represents the raw, uncompensated measurement value.

[0165] Embodiment 1:

[0166] A metering optimization system based on the method of the present invention is deployed on an AC charging pile in a new energy vehicle charging service center in a certain city. The charging pile serves different types of electric vehicles, and the variables such as vehicle battery characteristics, charging time, and environmental conditions are complex and diverse. In practical 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 the dynamic variational autoencoder, and the data is compressed through its encoder part. After eliminating abnormal signals and noise interference, it is reconstructed into high-quality metering data through the decoder part. The reconstructed data is then subjected to fast Fourier transform to identify and classify low-frequency harmonics and high-frequency harmonics. A linear regression model is used to compensate for the error of low-frequency harmonics, and a nonlinear model is introduced for accurate compensation of high-frequency harmonics, and finally a harmonic error compensation value is generated. The reconstructed data and the harmonic compensation value are simultaneously input into the optimized multi-layer perception network, which models the input data through sparse regularization and adaptive activation functions, and calculates the preliminary metering error compensation value. The system uses a multi-scale error learning mechanism to model global errors and local errors, and dynamically integrates the contributions of the two through an attention weight mechanism to correct the initial measurement error compensation value and finally generate an optimized measurement value.

[0167] To verify the effectiveness of the proposed method, experimental data was recorded for one month for the metering optimization system and compared with the traditional metering method. During the experiment, data from 5,000 charging sessions were collected. The metering results of the traditional metering method and the proposed optimization method were recorded and compared with the reference value of the standard electric energy metering device to calculate the total metering error.

[0168] Table 1 Comparison of experimental data between traditional measurement method and the method of the present invention

[0169] index Traditional measurement methods 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 (each measurement) 20ms 35ms Error margin 2.0%-8.0% 0.3%-1.8% Total number of measurement samples 5000 5000

[0170] In terms of the overall performance of the measurement error, the average measurement error of the traditional measurement 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 eliminates abnormal data and noise interference through compression and reconstruction mechanisms, making the input signal purer and reducing the generation of errors from the source. At the same time, the multi-scale error learning mechanism reduces the average error to 1.2% and the error range is controlled between 0.3% and 1.8% through the refined modeling and dynamic fusion of global and local errors, combined with the nonlinear modeling capabilities of the multi-layer perception network, thereby improving the measurement accuracy.

[0171] In scenarios where high-frequency harmonics affect metering results, the present invention demonstrates excellent adaptability. Traditional methods have limited ability to compensate for high-frequency harmonic errors, with an average error of 3.5%. When high-frequency harmonics account for a large proportion, the error contribution is further amplified, and metering accuracy is difficult to guarantee. The present invention uses a linear regression model for low-frequency harmonics and a nonlinear compensation model for high-frequency harmonics through harmonic grading modeling and compensation strategies, significantly enhancing the harmonic adaptability and compensation capability of the system. Experimental data show that the system controls high-frequency harmonic errors within an average range of 0.5%, and the low-frequency harmonic errors are also reduced from 1.8% to 0.4%, achieving relatively accurate error correction.

[0172] In addition, although the system adds 15ms of processing time to each measurement, its optimized processing time can still be maintained within 35ms, 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 large deviations in the actual metering results, especially in high-frequency charging scenarios where the cumulative error is more obvious. Through advanced modeling technology and optimization strategies, the present invention significantly improves the metering accuracy at 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 nonlinear loads and harmonic distortion 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 description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for optimizing AC charging pile metering based on a multi-layer perception network, characterized in that: The steps include: S1. Collect metering data of AC charging piles; S2, inputting the collected metering data into a dynamic variational autoencoder, compressing the metering data through the encoder of the dynamic variational autoencoder, removing abnormal data and noise interference, reconstructing the metering data using the decoder of the dynamic variational autoencoder, and outputting the reconstructed data; S3, performing frequency domain analysis on the reconstructed data, identifying and classifying harmonic components, dividing the harmonics into low-frequency harmonics and high-frequency harmonics, and based on the classified harmonic data, using a linear regression model to compensate for low-frequency harmonic errors, and using a nonlinear compensation model to compensate for high-frequency harmonic errors, to obtain harmonic error compensation values; S4, inputting the harmonic error compensation value and the reconstructed data into the multi-layer perception network, and calculating the preliminary measurement error compensation value through the multi-layer perception network; S5. Use a multi-scale error learning mechanism to model the global error and the local error, and dynamically fuse the global error and the local error through an attention weight mechanism. According to the fusion result of the multi-scale error learning mechanism, correct the preliminary measurement error compensation value to obtain the final measurement error compensation value, and output the measurement value after error compensation.

2. According to claim 1, a method for optimizing AC charging pile metering based on a multi-layer sensing network is characterized in that: The S2 specifically includes: S21, passing the collected metering data as input to the input layer of the dynamic variational autoencoder, and performing feature normalization processing, mapping all metering data features to the range of [0,1], and ensuring 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, the feature normalized measurement data is mapped to the latent space to generate the latent representation variable: Z~p θ (Z|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 under the condition of the input data X, and θ represents the weight parameter of the encoder; 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 goal of latent distribution optimization and reconstruction data quality: Among them, q φ (Z|X) represents the variational distribution, φ represents the parameter of the variational distribution, and 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 potential distribution q φ (Z|X) and prior distribution p θ (Z), E represents the mathematical expectation, which indicates the optimization goal of the model for the potential distribution; S24, performing reverse mapping through the decoder part of the dynamic variational autoencoder to decode the latent variable Z into reconstructed data; S25, calculating the reconstruction error using the measurement data and the reconstruction data, and using the mean square error as the loss function; 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 measurement data, Represents reconstruction data; S26. Combining the regularization objective of the encoder and the reconstruction objective of the decoder, dynamically adjust the weight parameters of the dynamic variational autoencoder to minimize the total loss function; L total =L+L r ; Among them, L totalr represents the total loss function; S27. Output the reconstructed data generated by the optimized dynamic variational autoencoder.

3. According to claim 1, a method for optimizing AC charging pile metering based on a multi-layer sensing network is characterized in that: The S3 specifically includes: S31, use fast Fourier transform to convert the reconstructed data into frequency domain to obtain frequency components and the corresponding amplitude in, 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, identifying harmonic components of the reconstructed signal according to the frequency components and the corresponding amplitudes, and separating the harmonic components contained in the signal from the fundamental signal; S33, performing hierarchical processing on the reconstructed harmonic signal, dividing the harmonic into low-frequency harmonics and high-frequency harmonics based on the magnitude of the harmonic frequency, for the low-frequency harmonics, recording the corresponding amplitude and harmonic order, generating a set of low-frequency harmonic components, for the high-frequency harmonics, recording the corresponding amplitude and harmonic order, generating a set of high-frequency harmonic components; S34. For low-frequency harmonics, a linear regression model is used to model and compensate for low-frequency harmonic errors: in, represents the error compensation value of the kth order low-frequency harmonic, a k and b k Represents the parameters of the linear regression model, which is obtained by fitting the historical data. represents the amplitude of the k-th order low-frequency harmonic; S35, applying the error compensation value output by the linear regression model to the low-frequency harmonics to obtain compensated low-frequency harmonics: in, represents the compensated low-frequency harmonics, Indicates low-frequency harmonics; S36. For high-frequency harmonics, a nonlinear compensation model is used to model and compensate for high-frequency harmonic errors: in, represents the error compensation value of the kth order high frequency harmonic, c k and d k Represents the parameters of the nonlinear compensation model, which is obtained by fitting historical data. represents the amplitude of the kth-order high-frequency harmonic; S37, applying the error compensation value output by the nonlinear compensation model to the high-frequency harmonics to obtain compensated high-frequency harmonics: in, represents the compensated low-frequency harmonics, Indicates low-frequency harmonics; S38, combining the compensated low-frequency harmonics and high-frequency harmonics to generate final harmonic compensation, and outputting a harmonic error compensation value.

4. According to the AC charging pile metering optimization method based on a multi-layer perception network according to claim 1, it is characterized in that: The S4 specifically includes: S41, using the harmonic error compensation value and the reconstruction data as input data; S42, performing feature combination processing on the input data, aligning the input data by time, and generating a feature matrix; S43. Design a multi-layer perception network model, wherein the multi-layer perception network includes an input layer, multiple hidden layers and an output layer, wherein the hidden layer adopts a sparse regularization constraint and an adaptive activation function, and the sparse regularization constraint enforces the sparsity of the weight matrix: σ(x) = x·sigmoid(βx); Among them, σ(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 perception network, 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 Lth hidden layer, b L represents the bias vector of the Lth hidden layer, L represents the number of layers in the multi-layer perception network, X input Represents input data.

5. The AC charging pile metering optimization method based on a multi-layer perception network according to claim 1 is characterized in that: The S5 specifically includes: S51, performing error decomposition on the preliminary measurement error compensation value, into global error and local error, wherein 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. Model the low-frequency part of the feature matrix through the global error modeling module, and calculate the preliminary value of the global error: Δ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, g represents the global error modeling function, and linear regression is used for modeling; S53, through the local error modeling module, the high-frequency part of the feature matrix is ​​modeled and the preliminary value of the local error is calculated: Δ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 the nonlinear compensation model is used for modeling; S54, the global error and the local error are integrated, dynamically allocated through the attention weight mechanism, and the comprehensive error compensation value is calculated: ΔQ fused =α·ΔQ global +(1-α)·ΔQ local ; Among them, ΔQ fused represents the comprehensive error compensation value after fusion, α represents the dynamic attention weight, which ranges from [0,1] and is dynamically adjusted according to the characteristics of the input signal: Among them, Var(X low ) represents the variance of low-frequency features, Var(X high ) represents the variance of high-frequency features; S55, calculate the error correction value, and use the comprehensive error compensation value as the correction factor: ΔQ final =ΔQ initial +ΔQ fused ; Among them, ΔQ final Indicates the measurement error compensation value; S56. Perform quality assessment on the measurement error compensation value and calculate the total measurement error: Among them, ∈ final Represents the total measurement error, Q i Indicates the actual measurement value. represents the uncompensated measurement value, and n represents the total number of measurement samples; S57. Based on the quality assessment result, the total measurement error is compared with the preset measurement error threshold. If the total measurement error is greater than the measurement error threshold, the process returns 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, the final measurement error compensation value is output, and the measurement value after error compensation is output: Among them, Q compensated Represents the final measurement error compensation value, Represents the raw, uncompensated measurement value.

Citation Information

Patent Citations

  • High-voltage circuit breaker fault diagnosis method based on SSD-SRAE

    CN112327149A

  • Method for automatically predicting wind error angle of wind indicator of fan and related equipment

    CN118499201A

  • Method for reducing metering error of output electric energy of direct current charging pile

    CN118604440A

  • Controllable video generation method and system based on multi-modal fusion

    CN119091362A

  • Controlled power converter

    US20100013534A1