Non-intrusive load identification method for charging of electric bicycle

Obtaining electricity consumption information through smart meters, combined with time-frequency analysis and a customized loss function model, the accurate identification of electric bicycle charging loads is achieved, solving the problems of insufficient accuracy and practicality in the existing technology, and improving the security of the power grid. and monitoring efficiency.

CN118797438APending Publication Date: 2024-10-18HOHAI UNIV +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410831842.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing electric bicycle charging load identification methods have insufficient accuracy and practicality. Especially in non-intrusive monitoring, it is difficult to accurately identify charging behavior, and the computational complexity and error detection rate are high, leading to grid overload and safety hazards.

Method used

Smart meters are used to obtain electricity consumption information non-intrusively. Through time-frequency analysis, wavelet decomposition, feature scaling and custom loss function, the LightGBM model is combined with the TabNet model to perform weighted fusion and secondary discrimination to improve the accuracy of electric bicycle charging load identification. accuracy and recall rate, reducing the risk of missed detections.

Benefits of technology

It effectively improves the accuracy and recall rate of electric bicycle charging load identification, reduces the risk of missed detection, ensures comprehensive monitoring of charging events, improves practicality and on-site operability, and takes into account flexibility and user privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797438A_ABST
    Figure CN118797438A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of electric bicycle charging load identification, and discloses a non-intrusive load identification method for electric bicycle charging, and the method comprises the steps: collecting the total power utilization information of a user in a non-intrusive manner through an intelligent electric meter, and carrying out the time-frequency analysis, feature selection, data reconstruction, normalization processing, and the training and optimization of LightGBM and TabNet models. And finally, accurately identifying the charging event of the electric bicycle through weighted fusion and a secondary discrimination process. According to the method, the loss function is self-defined in the LightGBM architecture, and the CMA-ES algorithm is utilized to automatically search the model fusion weight and the judgment threshold, so that the identification accuracy and the practical application performance of the charging event of the electric bicycle are effectively improved; the technology has important practical significance and application value in the aspects of improving the power utilization safety and promoting the development of a smart power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of electric bicycle charging load identification, and specifically relates to a non-intrusive load identification method for electric bicycle charging. Background Art

[0002] As electric bicycles become more popular as an environmentally friendly means of transportation, the issue of charging safety has gradually become a focus of social attention. Among the many safety issues, grid load management during charging is particularly important. Improper charging behavior, such as charging at the same time during peak hours, may cause grid overload, leading to power instability and even fire and other safety accidents.

[0003] At present, most of the load monitoring methods on the market rely on invasive monitoring, which requires the installation of additional monitoring hardware on the user's charging equipment. This method is not only costly to install, but also easily resisted by users. In addition, the existing non-invasive load monitoring technology is still limited in accuracy and practicality, especially in the accurate identification and recognition of electric bicycle charging behavior at home, there is a lot of room for improvement. Therefore, in recent years, non-invasive load monitoring has received a lot of attention as a method that only requires a single smart meter to detect the power situation. However, there is still room for improvement in accuracy and practicality. Especially in the identification and recognition of electric bicycle charging loads, existing research focuses on algorithm innovation, but has not yet achieved satisfactory results in the balance of accuracy, recall rate and computational complexity.

[0004] Considering these limitations, an optimized load monitoring method is needed that can accurately identify the charging behavior of electric bicycles without adding intrusive sensors. In addition, the problem of reducing the computational complexity and the high false detection rate and missed detection rate needs to be solved to ensure that the monitoring system is both efficient and practical. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a non-invasive load identification method for electric bicycle charging. The method non-invasively collects the user's total electricity consumption information through a smart meter, and through a series of processing, finally through a weighted fusion and secondary discrimination process, improves the accuracy of electric bicycle charging load identification and good practical application performance. In order to prevent missed detection, the recall rate is improved while ensuring a certain accuracy rate, and in actual application scenarios, it can quickly and accurately identify whether an electric bicycle charging event occurs.

[0006] In order to achieve the above object, the present invention is achieved through the following technical solutions:

[0007] The present invention is a non-intrusive load identification method for charging an electric bicycle, and the method specifically comprises the following steps:

[0008] Step S1: Use a smart meter to non-invasively obtain the user's total electricity consumption information, including current, voltage, active power, and reactive power. The sampling frequency of the electricity consumption information is 0.2 Hz;

[0009] Step S2: performing time-frequency analysis on the total power consumption information of the user obtained in step S1, and selecting appropriate features in combination with the tag information;

[0010] Step S3, performing wavelet decomposition and reconstruction on the feature data of step S2, removing noise and enhancing important features in the feature data, such as mutations or discontinuities in the signal;

[0011] Step S4, performing feature scaling and normalization processing on the feature data processed in step S3;

[0012] Step S5, construct a LightGBM model and a TabNet model with a custom loss function, and use the custom loss function to improve the recall rate by giving a greater penalty to the misclassification of positive samples;

[0013] Step S6: Use the feature data after step S4 to train the LightGBM model and TabNet model in step S5, input the data to be recognized into the trained LightGBM model and TabNet model, and then output the recognition result;

[0014] Step S7: weighted fusion is performed on the recognition results of step S6, and the CMA-ES algorithm is used to calculate the optimal fusion weight and decision threshold, so as to improve the recall rate while ensuring the accuracy rate;

[0015] Step S8: perform secondary discrimination, by traversing the recognition result sequence, using the set threshold k and fault tolerance parameter t to determine the significance and continuity of the state change, and obtain the final recognition result.

[0016] The present invention is further improved in that: in order to select more suitable features to complete the subsequent model training and recognition tasks, in the step S2, the total power consumption information of the user obtained is subjected to time-frequency analysis, specifically: time domain waveforms of current, voltage, active power, and reactive power are respectively made in combination with the label information, and the time domain features that best match the label changes are selected; the odd harmonics of the existing power consumption information are obtained using the fast Fourier transform (FFT), which are used as frequency domain features, and a frequency domain waveform is made. These selected time domain features of active power and reactive power and frequency domain features of 1st, 3rd, 5th, and 7th harmonics are all used as features for prediction model training.

[0017] A further improvement of the present invention is that: in step S3, wavelet decomposition is a process of decomposing a signal into different scales or levels by wavelet transform. The wavelet decomposition of a given signal x(t) at its level l is expressed as:

[0018]

[0019] Among them, a and b are the scale and displacement parameters of the wavelet transform, respectively, ψ(t) is the selected wavelet basis function, t represents the position in time or space, and is the specific point where the wavelet function acts. The integral of all time t represents the integral over the domain of the entire signal. Used to ensure normalization of wavelet transform;

[0020] For each wavelet coefficient c lj , apply soft thresholding:

[0021] c l ' j =sign(c lj )max(c lj -T l |,0).

[0022] The present invention is further improved in that: in step S4, the feature scaling and normalization processing of the feature data is specifically performed as follows:

[0023]

[0024] Among them, X is the original data, X max and X min are the minimum and maximum values ​​of the feature in the data set, respectively, norm is the normalized value.

[0025] A further improvement of the present invention is that for the construction of a custom loss function in the LightGBM model, in order to increase the recall rate while ensuring the accuracy, a custom function is designed to impose heavier penalties on misclassification of the positive category, and a tree model is constructed using the corresponding gradient and Hessian matrix to quickly guide the model to iteratively update in the direction of convergence.

[0026] The step S5 specifically comprises the following steps:

[0027] Step S51, the custom loss function is expressed as:

[0028]

[0029] Among them, the residual r i =y true,i -y pred,i, by giving a larger penalty to the misclassification of positive samples to improve the recall rate, when the residual r i When >0, it means that there is a misclassification of the positive sample. At this time, the gradient magnification factor of the positive sample is multiplied by scale to increase the penalty for misclassification of the positive sample.

[0030] Step S52, in the LightGBM model, the gradient represents the slope or rate of change of the custom loss function relative to the output of the LightGBM model. In each iteration of the LightGBM model training, the LightGBM model calculates the gradient of the recognition error of the current model for each sample. These gradients reflect the direction and magnitude of the deviation of the model recognition value relative to the true value. The gradient is used to indicate how the LightGBM model parameters are adjusted to reduce the recognition error, that is, it indicates the direction in which the loss function decreases fastest. The corresponding function expression is shown in the following formula:

[0031]

[0032] Among them, the gradient g i Represents the first-order derivative of the loss function with respect to the predicted value of the i-th sample.

[0033] Step S53, the Hessian matrix is ​​the second-order derivative of the custom loss function for each sample recognition value, which represents the local curvature of the loss function, that is, the speed of gradient change or the sensitivity of model recognition error. In the LightGBM model, the information of the gradient and the Hessian matrix is ​​used to optimize the split point selection of the tree and the split value at the split point, ensuring that the TabNet model fits the data more accurately while reducing the loss. By considering the gradient and the Hessian matrix, the LightGBM model processes data with different second-order derivative values ​​to improve the robustness and accuracy of the model. The corresponding function expression is shown in the following formula:

[0034]

[0035] Among them, the Hessian matrix H i Represents the second-order derivative of the loss function with respect to the predicted value of the i-th sample.

[0036] The present invention is further improved in that: the step S7 specifically includes the following steps:

[0037] Step S71, setting an objective function, which takes weight parameters and thresholds as variables, the weights of the LightGBM model and the TabNet model are used to reconcile the recognition results of different prediction models, and the threshold is used to determine the final recognition state;

[0038] Step S72: finding the optimal solution of the objective function by an automated search algorithm, where the optimal solution determines the optimal weight and optimal threshold for result fusion;

[0039] Step S73, applying the solved optimal weight to weighted average the recognition results of different prediction models to generate a comprehensive result;

[0040] Step S74, using the optimal threshold determined in step S72 to perform binarization processing on the comprehensive result of step S73 to obtain the final recognition state;

[0041] Step S75, the automated search algorithm uses a CMA-ES algorithm with preset parameter boundaries. The CMA-ES algorithm starts searching with a preset initial parameter guess and optimizes the objective function in an iterative process until an optimal solution is found.

[0042] A further improvement of the present invention is that in step S71, the objective function calculates the performance score of the recognition state with accuracy and recall, and uses this performance score as an optimization target to improve the recall rate while maintaining a high accuracy rate.

[0043] A further improvement of the present invention is that in step S72, the preset parameter boundary of the automated search algorithm is configured to limit the weight parameter to an open interval between 0 and 1, so as to ensure that the final weighted average comprehensive result is within a reasonable range, and the initial value of the weight parameter is set to 0.5 to serve as the starting point in the search process.

[0044] A further improvement of the present invention is that the secondary discrimination in step S8 specifically includes the following steps:

[0045] Step S81, traverse the recognition result list, use a counter 1 to track the duration of the current continuous charging state 1, and a counter 2 to track the number of tolerated non-charging states;

[0046] Step S82, if the state encountered is charging state 1, counter 1 is incremented, and if counter 2 is greater than 0, that is, there is a disconnected non-event state in the middle of the continuous events, then these non-event states are corrected to event states, that is, 0 is changed to 1;

[0047] Step S83, if the state encountered is the non-charging state 0, then decide whether to regard this 0 as a temporary error according to the relationship between counter 2 and the fault tolerance parameter t, if the count value of counter 2 is less than the fault tolerance parameter t, then temporarily regard it as a small error in the continuous event; if the count value of counter 2 reaches the fault tolerance parameter t, check whether the continuous events including the tolerated non-continuous events so far meet the minimum duration threshold k, if not, reset it to the non-charging state 0;

[0048] Step S84: After the traversal is completed, check whether the last continuous event meets the minimum duration. If not, and the count value of counter 2 does not reach the tolerance parameter t, it is corrected to 0; if the last continuous event plus the number of tolerated errors reaches the minimum duration threshold k, these continuous states are retained and the discontinuous states are corrected to 1.

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

[0050] By combining wavelet transform and harmonic feature analysis, the non-invasive load identification method of the present invention effectively extracts the characteristic information of the electric bicycle charging load; and constructs a hybrid use of the LightGBM model with a custom loss function and the TabNet model, which not only improves the accuracy of non-invasive load identification, but also effectively increases the recall rate, minimizes the risk of missed detection, and ensures comprehensive monitoring of charging events.

[0051] By applying the automatic search of the CMA-ES algorithm, the present invention automatically determines the optimal weights and thresholds, significantly reducing the reliance on empirical judgment and the need for manual parameter selection, taking into account flexibility and user privacy protection, while ensuring a balance between accuracy and recall, and improving practicality and on-site operability.

[0052] The secondary discrimination logic of the present invention significantly enhances the accuracy and robustness of electric vehicle charging identification. By correcting short-term identification errors and implementing fault-tolerant processing, it ensures that only truly continuous charging events are captured, thereby reducing misjudgments. The adjustable parameters provide adaptability to different data environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a flow chart of a non-intrusive load identification method for charging an electric bicycle according to an embodiment of the present invention.

[0054] Figure 2 The following is a time domain analysis waveform diagram of some measured data of the embodiments of the present invention.

[0055] Figure 3 The following are some waveform diagrams of measured data current and label value in the embodiments of the present invention.

[0056] Figure 4 The following is a frequency domain analysis waveform diagram of some measured data of the embodiments of the present invention.

[0057] Figure 5 This is a waveform diagram of the first harmonic and label value of some measured data of the embodiments of the present invention.

[0058] Figure 6 The following is a comparison waveform diagram of some measured data of active power before and after denoising by wavelet transform in an embodiment of the present invention.

[0059] Figure 7 This is a schematic diagram of the LightGBM architecture for customizing the loss function according to an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will disclose the embodiments of the present invention with drawings. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is to say, in some embodiments of the present invention, these practical details are not necessary.

[0061] like Figure 1 As shown, the present invention is a non-intrusive load identification method for charging an electric bicycle, which specifically includes the following steps:

[0062] Step S1: Use a smart meter to non-invasively obtain the user's total electricity consumption information, including current, voltage, active power, and reactive power. The sampling frequency of the electricity consumption information is 0.2 Hz;

[0063] The smart meter used in step S1 is the power consumption data acquisition unit of the present invention, which is deployed on the power supply line of the user's residence to monitor and record various power consumption parameters in real time. The collected data not only includes basic current and voltage values, but also covers more complex power consumption characteristics, such as active power, reactive power, etc., providing comprehensive data support for non-invasive load monitoring. In order to ensure that the time resolution of data acquisition meets the requirements for capturing changes in the charging characteristics of electric bicycles, the sampling frequency is set to 0.2Hz, that is, data is collected every 5 seconds. Such a setting strikes a balance between capturing subtle changes and retaining the integrity of power activity signals. Since the meter adopts a non-invasive design, the installation process does not require changes to the user's existing electrical equipment, which simplifies the deployment work and reduces the installation cost. At the same time, the meter also has a remote data transmission function, which can send the collected power consumption information to the back-end data processing center or cloud platform in real time through a wireless network, which is convenient for data analysis and load monitoring.

[0064] Step S2: performing time-frequency analysis on the total power consumption information of the user obtained in step S1, and selecting appropriate features in combination with the tag information;

[0065] After authorization, more than 50,000 pieces of electricity usage information with training labels were obtained from different users at different times, with a total duration of 70 hours. Figure 2 As shown in FIG. 1 , it is a time domain analysis waveform diagram of part of the measured data of the embodiment of the present invention, which can reflect the change of the time domain characteristics during this period of time; Figure 3 As shown, it is a waveform diagram of the current and label value of some measured data in an embodiment of the present invention, and then different time domain features and label values ​​are compared together, and active power and reactive power are selected as time domain training features of the prediction model.

[0066] like Figure 4 As shown in FIG. 1 , it is a frequency domain analysis waveform diagram of some measured data of an embodiment of the present invention, which can reflect the change of frequency domain characteristics during this period of time; Figure 5 As shown, it is a waveform diagram of the first harmonic and label value of some measured data of an embodiment of the present invention, and then different frequency domain features and label values ​​are compared together, and the first, third, fifth, and seventh harmonics are selected as frequency domain training features of the prediction model.

[0067] Step S3, performing wavelet decomposition and reconstruction on the feature data of step S2, removing noise and enhancing important features in the feature data, such as mutations or discontinuities in the signal;

[0068] Wavelet decomposition is the process of decomposing a signal into different scales or levels through wavelet transform. For a given signal x(t) at its level l, the wavelet decomposition is expressed as:

[0069]

[0070] Among them, a and b are the scale and displacement parameters of the wavelet transform, respectively, ψ(t) is the selected wavelet basis function, t represents the position in time or space, and is the specific point where the wavelet function acts. The integral of all time t represents the integral over the domain of the entire signal. Used to ensure normalization of wavelet transform;

[0071] In the embodiment of the present invention, db4, i.e., Daubechies wavelet, is used, and a 2-layer decomposition is set. In this embodiment, there is no denoising approximation coefficient, i.e., the lowest frequency part, because it usually contains the main information of the signal. The high-frequency coefficient, i.e., the detail part, is subjected to soft threshold denoising using a threshold based on the length of each layer of data. This usually removes noise better while retaining the important features of the signal.

[0072] For each wavelet coefficient c lj , apply soft thresholding:

[0073] c l ' j =sign(c lj )max(c lj -T l |,0)

[0074] like Figure 6As shown, the waveforms of some measured data of active power before and after wavelet transform denoising in the embodiment of the present invention are compared. It can be clearly seen that the processed waveform is smoother than the original data, and the fluctuation of its peak and valley values ​​is significantly reduced, which reflects the effectiveness of wavelet transform denoising technology in reducing random fluctuations in data and highlighting the main trends. The application of this processing technology in the embodiment of the present invention not only enhances the interpretability of the data, but also provides a more stable and clear basis for further prediction model training.

[0075] Step S4, performing feature scaling and normalization processing on the feature data processed in step S3;

[0076] The normalization method used in the embodiment of the present invention is "Min-Max Normalization", also known as "feature scaling", which is a method of scaling the range of data features to a specified maximum and minimum value (usually 1 and 0), which is expressed as follows:

[0077]

[0078] Among them, X is the original data, X max and X min are the minimum and maximum values ​​of the feature in the data set, respectively, norm is the normalized value.

[0079] When processing the characteristic data of the charging load of electric bicycles, such as current, voltage and power, these data have significant differences in dimension, value size and range of variation. If the original data is used directly, the model learning process may be dominated by certain features with larger values, thereby affecting the training effect and the generalization ability of the model. The normalized data in the embodiment of the present invention can accelerate the convergence speed of gradient descent, because it ensures that all features are on the same scale, thereby avoiding certain features from dominating the optimization process. If the numerical range of some features in the data set is much larger than that of other features, then these features may have a greater impact on the results in the learning algorithm without normalization. After normalization, the feature data is effectively standardized, making the model training process smoother, avoiding excessive parameter update steps, helping to shorten the model convergence time, and improving the recognition accuracy and robustness of the model.

[0080] Step S5, construct a LightGBM model and a TabNet model with a custom loss function, and use the custom loss function to improve the recall rate by giving a greater penalty to the misclassification of positive samples;

[0081] like Figure 6As shown, it is a schematic diagram of the LightGBM architecture of the custom loss function according to an embodiment of the present invention. In this architecture, the custom loss function is used to guide the training of the LightGBM model. The loss function imposes a heavier penalty on the misclassification of the positive class. The purpose of this is to improve the recall rate of the model while ensuring the recognition accuracy, which is particularly suitable for the case of unbalanced samples.

[0082] As shown in the figure, the custom loss function is expressed as:

[0083]

[0084] Among them, the residual r i =y true,i -y pred,i , by giving a larger penalty to the misclassification of positive samples to improve the recall rate, when the residual r i When >0, it means that there is a misclassification of the positive sample. At this time, the gradient magnification factor of the positive sample is multiplied by scale to increase the penalty for misclassification of the positive sample.

[0085] Gradient and Hessian are key components for constructing LightGBM tree models and guiding the model training process. Their role is to adjust the model according to the error identified by the current model to improve the performance of the model.

[0086] In the LightGBM model, the gradient is the first-order derivative of the loss function for each sample recognition value. It represents the slope or rate of change of the custom loss function relative to the output of the LightGBM model. In each iteration of the LightGBM model training, the LightGBM model calculates the gradient of the recognition error of the current model for each sample. These gradients reflect the direction and magnitude of the deviation of the model recognition value relative to the true value. The gradient is used to indicate how the LightGBM model parameters are adjusted to reduce the recognition error, that is, it indicates the direction in which the loss function decreases fastest. The corresponding function expression is shown in the following formula:

[0087]

[0088] Among them, the gradient g i Represents the first-order derivative of the loss function with respect to the predicted value of the i-th sample.

[0089] The Hessian matrix is ​​the second-order derivative of the custom loss function for each sample recognition value. It represents the local curvature of the loss function, that is, the speed of gradient change or the sensitivity of model recognition error. In the LightGBM model, the information of the gradient and the Hessian matrix is ​​used to optimize the selection of the split point of the tree and the split value at the split point, ensuring that the TabNet model fits the data more accurately while reducing the loss. By considering the gradient and the Hessian matrix, the LightGBM model processes data with different second-order derivative values ​​to improve the robustness and accuracy of the model. The corresponding function expression is shown in the following formula:

[0090]

[0091] Among them, the Hessian matrix H i Represents the second-order derivative of the loss function with respect to the predicted value of the i-th sample.

[0092] In the loss function design of LightGBM, the gradient is used to indicate the direction of loss reduction, while the Hessian matrix provides information about the speed of loss reduction. The two work together to build the decision tree during model training, helping the model converge faster and improve the performance of the final model, ensuring that this model can improve the recall rate while ensuring the recognition accuracy.

[0093] Step S6: Use the feature data after step S4 to train the LightGBM model and TabNet model in step S5, input the data to be recognized into the trained LightGBM model and TabNet model, and then output the recognition result.

[0094] like Figure 6 As shown in the figure, the preprocessed data is input into the constructed LightGBM and TabNet prediction models, and the recognition results of the two prediction models can be obtained. At the same time, a control group experiment is designed to test the differences in the accuracy and recall rate of LightGBM for electric bicycle load recognition before and after the custom loss function, and analyze the feasibility of the custom loss function. The results are shown in Table 1.

[0095] Table 1 LightGBM recognition results with and without custom loss function

[0096]

[0097] With only a 0.06% loss in accuracy, the recall rate of LightGBM recognition results was greatly improved, indicating that this custom function can improve the recall rate while ensuring accuracy.

[0098] Step S7: weighted fusion is performed on the recognition results of step S6, and the CMA-ES algorithm is used to calculate the optimal fusion weight and decision threshold, so as to improve the recall rate while ensuring the accuracy rate;

[0099] This specific embodiment defines an objective function to perform weighted average fusion of the recognition probability of the LightGBM model and the recognition probability of the TabNet model. The weight and the judgment threshold are used as parameters of the objective function, and the comprehensive performance of the fusion model is optimized by adjusting these two parameters.

[0100] The objective function is expressed as:

[0101] J(w,t)=-(λ·acc+(1-λ)·rec)

[0102] J(w, t) is used to evaluate the performance of weight w and decision threshold t, acc is the accuracy, rec is the recall, and λ is used to balance the accuracy and recall. In the CMA-ES algorithm optimization process, the goal is to minimize J(w, t), which is equivalent to maximizing λ·acc+(1-λ)·rec. By adjusting the value of λ, a trade-off can be made between accuracy and recall. The λ value selected in this embodiment is 2, the purpose of which is to improve the recall while ensuring the accuracy.

[0103] The objective function calculates the recognition probability after weighted average and converts the probability into the final classification result according to the set threshold. Then, the function evaluates the accuracy and recall of the weighted fusion result. The return value of the objective function is -(2*accuracy+recall), where the negative sign is because the CMA-ES algorithm performs minimization optimization by default, and multiplying the accuracy by the hyperparameter 2 is to improve the recall rate while ensuring the accuracy, thereby reducing the occurrence of missed detections.

[0104] When using the CMA-ES algorithm for parameter optimization, we first set the initial guess values ​​and the bounds of the parameters to ensure that the solution is searched within a reasonable range. The algorithm configuration includes bounds and the seed for random number generation to ensure the reproducibility of the results.

[0105] The present invention optimizes the objective function by executing the CMA-ES algorithm to find the best fusion weight and decision threshold. After finding the best parameters, these parameters are used to calculate the accuracy and recall of the final model, as shown in Table 2:

[0106] Table 2 Weighted fusion recognition results based on CMA-ES optimization

[0107]

[0108] In the recognition results obtained after using the CMA-ES algorithm to automatically find the optimal fusion weight and decision threshold, it is obvious that through this method, the present invention can automatically optimize the parameters of the load prediction model and significantly improve the performance of non-invasive electric bicycle charging load identification.

[0109] Step S8: perform secondary discrimination, by traversing the recognition result sequence, using the set threshold k and fault tolerance parameter t to determine the significance and continuity of the state change, and obtain the final recognition result.

[0110] Since the charging of electric bicycles is continuous, if there are non-consecutive 1s in the recognition results, it is very likely that a false detection has occurred. In order to reduce such false alarms and improve the reliability of the recognition method, the present invention adopts a secondary discrimination logic to process these occasional single or short sequences of 1s, ensuring that each identified charging event marked as 1 lasts for at least a certain time threshold. If the duration of a charging event is less than this threshold, we will assume that it is noise and reset it to a non-charging event, marked as 0, and correct a small number of incorrectly identified non-charging states marked as 0 to charging states in the continuous charging states marked as 1.

[0111] The present invention corrects short-term recognition errors by introducing a minimum duration threshold and a fault-tolerant mechanism, and is capable of distinguishing and eliminating short-term signals that do not meet the continuity conditions. This processing method is based on the understanding of the charging behavior of electric bicycles, that is, charging behavior usually occurs over a relatively long continuous period of time, rather than only in a short period of time.

[0112] The step S8 of performing secondary discrimination specifically comprises the following steps:

[0113] Step S81, traverse the recognition result list, use a counter 1 to track the duration of the current continuous charging state 1, and a counter 2 to track the number of tolerated non-charging states;

[0114] Step S82, if the state encountered is charging state 1, counter 1 is incremented, and if counter 2 is greater than 0, that is, there is a disconnected non-event state in the middle of the continuous events, then these non-event states are corrected to event states, that is, 0 is changed to 1;

[0115] Step S83, if the state encountered is the non-charging state 0, then decide whether to regard this 0 as a temporary error according to the relationship between counter 2 and the fault tolerance parameter t, if the count value of counter 2 is less than the fault tolerance parameter t, then temporarily regard it as a small error in the continuous event; if the count value of counter 2 reaches the fault tolerance parameter t, check whether the continuous events including the tolerated non-continuous events so far meet the minimum duration threshold k, if not, reset it to the non-charging state 0;

[0116] Step S84: After the traversal is completed, check whether the last continuous event meets the minimum duration. If not, and the count value of counter 2 does not reach the tolerance parameter t, it is corrected to 0; if the last continuous event plus the number of tolerated errors reaches the minimum duration threshold k, these continuous states are retained and the discontinuous states are corrected to 1.

[0117] In this example, the minimum duration threshold k is selected as 20, and the tolerance parameter t is selected as 4.

[0118] By applying the secondary discrimination method, the present invention can effectively optimize the recognition results and enhance the robustness of the recognition results. The logic ensures that only those state changes that are persistent enough to exceed the threshold k are considered significant and ultimately identified as valid electric bicycle charging events, and the discrete non-events that appear erroneously in continuous events are corrected. This method significantly reduces the impact of accidental errors and random noise, thereby improving the overall performance of the load identification system.

[0119] The present invention effectively improves the accuracy and recall rate of electric bicycle charging behavior identification, and also provides an efficient and reliable load management tool for the power system. By reducing false detections and optimizing the identification process, the present invention contributes to the stable operation of the smart grid and provides an efficient monitoring solution for electric bicycle charging. In addition, the application of the present invention can be extended to other load identification scenarios to provide intelligent and precise load management capabilities, which is of great significance for promoting energy consumption optimization and smart city construction. Therefore, the present invention not only has practical value, but also shows innovation and advancement in the technical field, and has broad market application prospects.

[0120] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A non-intrusive load identification method for electric bicycle charging, characterized in that: The non-intrusive load identification method specifically comprises the following steps: Step S1: Use a smart meter to non-invasively obtain the user's total electricity consumption information, including current, voltage, active power, and reactive power. The sampling frequency of the electricity consumption information is 0.2 Hz. Step S2: performing time-frequency analysis on the total power consumption information of the user obtained in step S1, and selecting appropriate features in combination with the tag information; Step S3, performing wavelet decomposition and reconstruction on the feature data of step S2, removing noise and enhancing important features in the feature data; Step S4, performing feature scaling and normalization processing on the feature data processed in step S3; Step S5, construct a LightGBM model and a TabNet model with a custom loss function, and use the custom loss function to improve the recall rate by giving a greater penalty to the misclassification of positive samples; Step S6: Use the feature data after step S4 to train the LightGBM model and TabNet model in step S5, input the data to be recognized into the trained LightGBM model and TabNet model, and then output the recognition result; Step S7: weighted fusion is performed on the recognition results of step S6, and the CMA-ES algorithm is used to calculate the optimal fusion weight and decision threshold, so as to improve the recall rate while ensuring the accuracy rate; Step S8: perform secondary discrimination, by traversing the recognition result sequence, using the set threshold k and fault tolerance parameter t to determine the significance and continuity of the state change, and obtain the final recognition result.

2. A non-intrusive load identification method for charging an electric bicycle according to claim 1, characterized in that: In step S2, the time-frequency analysis of the total power consumption information of the user is specifically performed as follows: combining the tag information to make time domain waveforms of current, voltage, active power, and reactive power, and selecting the time domain feature that best matches the tag change; using fast Fourier transform to obtain the odd harmonics of the existing power consumption information, and using it as the frequency domain feature, And make a frequency domain waveform diagram.

3. The non-intrusive load identification method for charging an electric bicycle according to claim 1, characterized in that: In step S3, wavelet decomposition is a process of decomposing a signal into different scales or levels by wavelet transform. The wavelet decomposition of a given signal x(t) at level l is expressed as: Among them, a and b are the scale and displacement parameters of the wavelet transform, respectively, ψ(t) is the selected wavelet basis function, t represents the position in time or space, and is the specific point where the wavelet function acts. The integral of all time t represents the integral over the domain of the entire signal. Used to ensure normalization of wavelet transform; For each wavelet coefficient c lj , apply soft thresholding: c l ′ j =sign(c lj )max(c lj -T l |,0)。 4. The non-intrusive load identification method for charging an electric bicycle according to claim 1, characterized in that: In step S4, the feature scaling and normalization processing is performed on the feature data as follows: Among them, X is the original data, X max and X min are the minimum and maximum values ​​of the feature in the data set, respectively, norm is the normalized value.

5. The non-intrusive load identification method for charging an electric bicycle according to claim 1, characterized in that: The step S5 specifically comprises the following steps: Step S51, the custom loss function is expressed as: Among them, the residual r i =y true,i -y pred,i , by giving a larger penalty to the misclassification of positive samples to improve the recall rate, when the residual r i When >0, it means that there is a misclassification of the positive sample. At this time, the gradient magnification factor of the positive sample is multiplied by scale to increase the penalty for misclassification of the positive sample. Step S52, in the LightGBM model, the gradient represents the slope or rate of change of the custom loss function relative to the output of the LightGBM model. In each iteration of the LightGBM model training, the LightGBM model calculates the gradient of the recognition error of the current model for each sample. These gradients reflect the direction and magnitude of the deviation of the model recognition value relative to the true value. The gradient is used to indicate how the LightGBM model parameters are adjusted to reduce the recognition error, that is, it indicates the direction in which the loss function decreases fastest. The corresponding function expression is shown in the following formula: Among them, the gradient g i Represents the first-order derivative of the loss function with respect to the predicted value of the i-th sample. Step S53, the Hessian matrix is ​​the second-order derivative of the custom loss function for each sample recognition value, which represents the local curvature of the loss function, that is, the speed of gradient change or the sensitivity of model recognition error. In the LightGBM model, the information of the gradient and the Hessian matrix is ​​used to optimize the split point selection of the tree and the split value at the split point, ensuring that the TabNet model fits the data more accurately while reducing the loss. By considering the gradient and the Hessian matrix, the LightGBM model processes data with different second-order derivative values ​​to improve the robustness and accuracy of the model. The corresponding function expression is shown in the following formula: Among them, the Hessian matrix H i Represents the second-order derivative of the loss function with respect to the predicted value of the i-th sample.

6. The non-intrusive load identification method for charging an electric bicycle according to claim 1, characterized in that: The step S7 specifically includes the following steps: Step S71, setting an objective function, which takes weight parameters and thresholds as variables, the weights of the LightGBM model and the TabNet model are used to reconcile the recognition results of different prediction models, and the threshold is used to determine the final recognition state; Step S72: finding the optimal solution of the objective function by an automated search algorithm, where the optimal solution determines the optimal weight and optimal threshold for result fusion; Step S73, applying the solved optimal weight to weighted average the recognition results of different prediction models to generate a comprehensive result; Step S74, using the optimal threshold determined in step S72 to perform binarization processing on the comprehensive result of step S73 to obtain the final recognition state; Step S75, the automated search algorithm uses a CMA-ES algorithm with preset parameter boundaries. The CMA-ES algorithm starts searching with a preset initial parameter guess and optimizes the objective function in an iterative process until an optimal solution is found.

7. A non-intrusive load identification method for charging an electric bicycle according to claim 6, characterized in that: In the step S71, the objective function calculates the performance score of the recognition state based on the accuracy and recall rate, and uses the performance score as the optimization target to improve the recall rate while maintaining a high accuracy rate.

8. The non-intrusive load identification method for charging an electric bicycle according to claim 6, characterized in that: In step S72, the preset parameter boundary of the automated search algorithm is configured to limit the weight parameter to an open interval between 0 and 1, so as to ensure that the final weighted average comprehensive result is within a reasonable range. The initial value of the weight parameter is set to 0.5 to serve as the starting point in the search process.

9. The non-intrusive load identification method for charging an electric bicycle according to claim 1, characterized in that: The step S8 of performing secondary discrimination specifically comprises the following steps: Step S81, traverse the recognition result list, use a counter 1 to track the duration of the current continuous charging state 1, and a counter 2 to track the number of tolerated non-charging states; Step S82, if the state encountered is charging state 1, counter 1 is incremented, and if counter 2 is greater than 0, that is, there is a disconnected non-event state in the middle of the continuous events, then these non-event states are corrected to event states, that is, 0 is changed to 1; Step S83, if the state encountered is the non-charging state 0, then decide whether to regard this 0 as a temporary error according to the relationship between counter 2 and the fault tolerance parameter t, if the count value of counter 2 is less than the fault tolerance parameter t, then temporarily regard it as a small error in the continuous event; if the count value of counter 2 reaches the fault tolerance parameter t, check whether the continuous events including the tolerated non-continuous events so far meet the minimum duration threshold k, if not, reset it to the non-charging state 0; Step S84: After the traversal is completed, check whether the last continuous event meets the minimum duration. If not, and the count value of counter 2 does not reach the tolerance parameter t, it is corrected to 0; if the last continuous event plus the number of tolerated errors reaches the minimum duration threshold k, these continuous states are retained and the discontinuous states are corrected to 1.

Citation Information

Cited By

  • Distribution transformer load prediction method based on multi-scale fluctuation mode adaptive decomposition

    CN119740016A

  • Electric bicycle charging monitoring method, system and device and storage medium

    CN120270077A

  • Electric bicycle home-entry charging identification method and system for intelligent electric meter

    CN122185950A

  • An electric bicycle charging identification method and system for a smart meter

    CN122185950B