Disclosure of Invention
The technical problem to be solved by the invention is to provide a non-invasive electric bicycle charging load detection and identification method aiming at the defects of the prior art, wherein the load characteristics are classified by extracting the current and voltage of the electric bicycle and other electric appliances, and different load characteristics are identified to distinguish different electric appliances for identification control.
In order to achieve the technical purpose, the technical scheme adopted by the invention is as follows:
the non-invasive electric bicycle charging load detection and identification method comprises the following steps:
step 1: acquiring charging load data of the electric bicycle and other electric appliances connected in parallel with the electric bicycle, and extracting current-voltage characteristics of the acquired data;
step 2: performing time domain simulation on the current and voltage characteristic data in the step 1 to obtain a charging voltage waveform diagram and a current waveform diagram;
and step 3: analyzing the oscillogram in the step (2), judging whether the data have errors, searching and eliminating the error data, preprocessing the data, and obtaining the oscillogram with the error data eliminated;
and 4, step 4: respectively carrying out macroscopic analysis on the charging process and microscopic analysis on the waveform in one second on the waveform diagram obtained in the step 3;
and 5: carrying out frequency domain analysis on the data preprocessed in the step 3 by using a Fourier transform method, and extracting harmonic features;
step 6: and classifying and identifying the harmonic features, and respectively training and testing by using a training set and a testing set.
In order to optimize the technical scheme, the specific measures adopted further comprise:
the preprocessing the data in the step 3 includes:
and (3) eliminating data larger than a threshold value by adopting an interval amplitude limiting method, and identifying various load characteristics by adopting current and voltage waveforms in two states before and during charging.
The macro analysis of step 4 above, comprising:
and respectively analyzing the alternating voltage characteristic data and the current characteristic data, wherein when the current characteristic data are analyzed, the current phase of the electric bicycle is assumed to be equal to the current phase of other electric appliances, and only the waveform analysis is carried out on the magnitude of the current.
The microscopic analysis of the above step 4, comprising: and (3) carrying out microscopic analysis on the current characteristic data, namely selecting two states before and during charging to carry out time domain analysis, comparing current and voltage waveforms of the electric bicycle and other electric appliances, and analyzing the difference of the current and voltage waveforms.
The step 5 of performing frequency domain analysis by using a fourier transform method includes:
and (3) carrying out harmonic feature extraction on the data of the electric bicycle and other electric appliances after the preprocessing in the step (3) by utilizing a Fourier algorithm, wherein the harmonic feature extraction comprises phase frequency analysis and time frequency analysis.
The phase frequency analysis specifically includes: the relation between the phases of the electric bicycle and other electric appliances is analyzed to obtain a current-voltage phase spectrogram, and whether the phases of the electric bicycle and other electric appliances are different in current-voltage phase is analyzed.
The amplitude-frequency analysis specifically includes: the method includes the steps of discussing odd harmonics of electric bicycles and other electric appliances, obtaining values of 1, 3, 5, 7 and 9 harmonics by conversion, simulating three stages of charging before charging, namely charging, to obtain a single-side frequency spectrogram, and obtaining harmonic content distribution of each stage from the single-side frequency spectrogram.
In the above step 6, the harmonic features extracted by the frequency domain analysis in the step 5 are classified and identified by using a naive bayes classification method, and whether the harmonic features belong to the features of the electric bicycle or the features of other electric appliances are judged, specifically:
obtaining training samples according to the determined characteristic attributes, calculating each sample, solving each characteristic attribute, calculating the conditional probability of all the partitions, calculating P (yi) P (x | yi) of each class, and taking the P (yi) P (x | yi) as the maximum item of the class to which x belongs if P (y)k|x)=max{P(y1|x),P(y2|x),…,P(yn| x) }, then x ∈ yk;
Respectively selecting 30s-290s of data information for the electric bicycle and other electric appliances, wherein the data contents are 1, 3, 5, 7 and 9 harmonic amplitudes, merging and randomly disordering, dividing the data contents into a test set and a training set according to the ratio of 3:7, and training a classifier model by using the training set, wherein the model belongs to the electric bicycle 1, and the other electric appliances are 0;
and finally, testing by using the test set, and observing whether the test result meets the actual condition.
The invention has the following beneficial effects:
the extraction features and the extraction method of the electric bicycle and other electric appliances are discussed from the aspects of time domain, frequency domain and the like, the extraction features are mainly the harmonic characteristics of the load, the extraction method is Fourier transform, and the identification method is determined according to the requirement of load identification. Unilateral frequency spectrums of the electric bicycle and other electric appliances are analyzed according to three aspects of charging before, charging and charging, load modes are distinguished according to harmonic wave characteristics, and meanwhile, a harmonic wave characteristic statistical table of the electric bicycle and other electric appliances is constructed, and support is provided for load identification. The method comprises the steps of adopting naive Bayesian classification to identify loads, carrying out Fourier transform on data of each second of the load data in charging, selecting 1, 3, 5, 7 and 9-order harmonic features, randomly disordering the features, dividing the features into a test set and a training set according to the ratio of 3:7, training model parameters of the training set, and testing results by using the test set. By the methods, the load type can be known through the load characteristic value, different electrical appliance loads can be identified and classified, and the method has universality. Compared with the prior art, the method can better process a large number of various characteristics or variables and has higher accuracy.
Detailed Description
Embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
Referring to fig. 15, the non-intrusive electric bicycle charging load detection and identification method of the present invention includes:
step 1: acquiring charging load data of the electric bicycle and other electric appliances connected in parallel with the electric bicycle, and extracting current-voltage characteristics of the acquired data;
step 2: performing time domain simulation on the current and voltage characteristic data in the step 1 to obtain a primary charging voltage and current oscillogram;
and step 3: analyzing the oscillogram in the step (2), judging whether the data have errors, searching and eliminating the error data, preprocessing the data, and obtaining the oscillogram with the error data eliminated;
and 4, step 4: respectively carrying out macroscopic analysis on the charging process and microscopic analysis on the waveform in one second on the waveform diagram obtained in the step 3;
and 5: carrying out frequency domain analysis on the data preprocessed in the step 3 by using a Fourier transform method, and extracting harmonic features;
step 6: and classifying and identifying the harmonic features, and respectively training and testing by using a training set and a testing set.
In the embodiment, the step 2-4 is a step of time domain simulation analysis, specifically:
performing time domain simulation according to a macroscopic angle and a microscopic angle, wherein the macroscopic angle is the whole charging process, and the microscopic angle is a one-second charging process;
the voltage and current waveforms of the two are analyzed in macroscopic analysis, and the two states before and after charging are analyzed in microscopic analysis. The current-voltage waveform diagrams having the abnormal waveforms shown in fig. 6 and 7 were obtained.
In an embodiment, the preprocessing the data in step 3 includes:
and (3) adopting an interval amplitude limiting method, eliminating data larger than a threshold value, and simultaneously adopting current and voltage waveforms in two states before and during charging, current spectrums in three states (10 th, 25 th and 100 th) and other various load characteristics to simultaneously identify.
In an embodiment, the macro analysis of step 4 comprises:
analyzing the alternating voltage characteristic data: because the electric bicycle and other electric appliances are in a parallel connection relationship, the obtained voltage data are almost equal in size because the amplitude and the phase are the same. So that the characteristics of the electric bicycle cannot be analyzed manually from the voltage of the electric bicycle. However, in order to ensure the accuracy of the results, voltage analysis of electric bicycles and other electric appliances is still required.
Analyzing the current characteristic data: due to the phase considerations in ac circuits, the currents are not all equal, and it may happen that the current of the branch is larger than the total current.
In order to simply and visually display the characteristics of the current, the current phase of the electric bicycle is assumed to be equal to the current phase of other electric appliances, only the waveform analysis is carried out on the magnitude of the current, two states before and during charging are selected for time domain analysis, data processing is carried out, and a current-voltage waveform diagram is made.
In an embodiment, the microscopic analysis of step 4 comprises:
microscopic analysis was performed on the current characteristic data: two states before and during charging are selected for time domain analysis, and the current and voltage waveforms of the electric bicycle and other electric appliances are compared and the difference is analyzed.
In an embodiment, the step 5 uses a fourier transform method to perform frequency domain analysis, and expresses the time domain function as f (w) integral of the function in the frequency domain, and for the forward transform process, the syntropy is also an integral form of the frequency domain function f (w) and the time domain function f (t). Generally, the function f (t) is an original function, and the function f (w) can be equivalently regarded as a corresponding image function after fourier transform, and the original function can form a transform pair with the image function.
The DTFT in the time domain is generally discrete and the DTFT in the frequency domain is generally periodic. DTFT is typically used for spectral analysis of discrete time signals. It is also the inverse of the fourier series.
The fourier transform, which is a corresponding discrete form in both the time and frequency domains, can convert the time domain results of the corresponding signal into frequency domain samples of the DTFT.
Generally, in terms of form, time-domain and frequency-domain corresponding sequences are limited, and often, after a discrete signal with a limited length is applied after fourier transform, the equivalent of the discrete signal can also be regarded as a corresponding change in a period extension process after fourier transform, and in a subsequent practical process, DFT calculation is often obtained through FFT calculation.
Fast fourier transform is a better calculation method for discrete fourier transform of sequence, which can decompose the matrix into products of sparse factors by means of DFT, and then realize fast operation, and for this reason, the complexity in the calculation process is mainly determined by reducing N2 defined by DFT to N log N. The inverse DFT process can also be expressed by DFT.
The harmonic wave of the power system is generally defined by means of fourier series, and the periodic non-sinusoidal electric quantity is also decomposed, and the result obtained after the decomposition contains a plurality of parts larger than the fundamental frequency component besides the part with the same fundamental frequency of the power grid, so that the part is called as a harmonic wave signal. Depending on how many times the frequency is the fundamental, this part of the harmonics can also be divided into spurious and even harmonics. The invention mainly discusses the odd harmonics of electric bicycles and other electric appliances.
The step 5 specifically comprises the following steps:
carrying out harmonic feature extraction including phase frequency analysis and time frequency analysis on the data of the electric bicycle and other electric appliances after the preprocessing in the step 3 by utilizing a Fourier algorithm;
analyzing the phase relation between the electric bicycle and other electrical appliances through phase frequency analysis to obtain a current-voltage phase spectrogram and analyzing whether the electric bicycle and the other electrical appliances are different in the phase of current and voltage;
through amplitude-frequency analysis, odd harmonics of the electric bicycle and other electric appliances are discussed, values of 1, 3, 5, 7 and 9 harmonics are obtained through conversion, a unilateral frequency spectrogram is obtained by simulating three stages of charging before charging, namely charging, and harmonic content distribution of each stage is obtained from the unilateral frequency spectrogram.
In the embodiment, in step 6, the harmonic features extracted through the frequency domain analysis in step 5 are classified and identified by using a naive bayes classification method, and it is determined whether the harmonic features belong to features of the electric bicycle or features of other electric appliances, specifically:
obtaining training samples according to the determined characteristic attributes, calculating each sample, solving each characteristic attribute, calculating the conditional probability of all the partitions, calculating P (yi) P (x | yi) of each class, and taking the P (yi) P (x | yi) as the maximum item of the class to which x belongs if P (y)k|x)=max{P(y1|x),P(y2|x),…,P(yn| x) }, then x ∈ yk;
Respectively selecting 30s-290s of data information for the electric bicycle and other electric appliances, wherein the data contents are 1, 3, 5, 7 and 9 harmonic amplitudes, merging and randomly disordering, dividing the data contents into a test set and a training set according to the ratio of 3:7, and training a classifier model by using the training set, wherein the model belongs to the electric bicycle 1, and the other electric appliances are 0;
and finally, testing by using the test set, and observing whether the test result meets the actual condition.
Examples
The comprehensive analysis of the amplitude-frequency characteristics of alternating current is the basis of analyzing the harmonic phenomenon, time domain data are converted into a frequency domain through fast Fourier transform, the Nyquist sampling law shows that the sampling frequency is generally half of the maximum frequency, the maximum frequency is 6400hz, symmetrical images can be presented at 3200hz in a spectrogram, and therefore only the analysis of a unilateral spectrogram is carried out.
It can be seen from fig. 1 that the fundamental amplitude of the electric bicycle current is the highest for the electric bicycle itself, and as the number of stages increases, the odd harmonic amplitudes decrease. For other electric appliances, although the amplitude of the fundamental wave is the largest, the descending trend amplitude of the odd harmonics is much larger than that of the electric bicycle along with the increase of the frequency, and the current amplitude is close to 0A from the fifth harmonic. From the voltage perspective, the voltage spectrum characteristics of the electric bicycle are almost consistent with those of other electric appliances, only fundamental waves are present, and higher harmonics are not present.
After the harmonic analysis is carried out on the whole charging state, in order to clear the harmonic change modes of the electric bicycle and other electric appliances at each stage, frequency domain analysis is respectively carried out on three states of charging starting, charging to be started and charging according to the harmonic characteristics of the current of the electric bicycle and other electric appliances, and unilateral frequency spectrograms in the three states are obtained. As can be seen from fig. 2, the electric bicycle does not have any wave generation at the time of starting charging. As charging is about to start, the electric bicycle generates fundamental waves, odd harmonics, and many inter-harmonics. When the state of charging is reached, the inter-harmonics disappear, only the fundamental and odd harmonics remain, and the odd harmonic amplitude gradually decreases as the frequency increases. For other electric appliances, the charging is started without generating harmonics as in the electric bicycle, but the odd harmonics gradually decrease in magnitude as the frequency increases. The initial state of charge is nearly the same as the initial state of charge and shows a decreasing trend. When the charge is in the charging process, except that the fundamental wave and the third harmonic are obvious, other odd harmonics are not obvious, and even do not appear in a single-side frequency spectrum diagram.
Then, the phase relationship between the electric bicycle and other electrical appliances is explored through phase frequency analysis, as shown in fig. 3, real domain data of the electric bicycle and other electrical appliances are converted into complex frequency domain data through fourier transform, and the phases of the real part and the imaginary part are solved through the phase solution method, so that the phases of the real part and the imaginary part are consistent whether the voltage is the current or the current is the voltage.
The load characteristics of the electric bicycle and other electric appliances are extracted and researched from the aspect of harmonic characteristics through alternating current harmonic analysis and phase frequency analysis, and the characteristic relation of the load is determined through extracting harmonic components of the electric bicycle and other electric appliances and analyzing the harmonic times or the harmonic amplitudes, so that the requirement on the characteristic extraction of the electric bicycle and other electric appliances is met.
In order to explore the relationship between the voltage and the current of the electric bicycle and other electric appliances, time domain simulation is respectively carried out on the electric bicycle and the other electric appliances, and firstly, the charging waveform in the whole process is obtained.
Analysis from the voltage side:
by comparing fig. 4 and 5, it is found that the voltage waveform of the electric bicycle is almost identical to the voltage waveform of other electric appliances. The amplitudes are not completely consistent considering that the data are not measured under ideal conditions, and factors such as wire impedance interfere with the results, but slight differences do not affect the final conclusion.
As can be seen from fig. 4, the charging period of the electric bicycle is approximately between 30s and 480s, the waveform of the electric bicycle is regular, the waveform of the other electrical appliance is irregular, and the current waveform of the other electrical appliance is greatly different from the current waveform of the electric bicycle. The reason for the exploration is that the irregular charging waveform is presented because the loads of other electrical appliances are of a plurality of types, the charging time is not uniform, the charging power and the current are not consistent, and the like; the electric bicycle has a continuous regular waveform when the current is unchanged in the charging time period.
Analysis from the aspect of current:
the abnormal values of the current oscillograms of the electric bicycle and other electrical appliances are found by observing the waveforms, and abnormal data need to be removed to obtain a more accurate oscillogram.
By the interval amplitude limiting method, the abnormal data is eliminated, and the modified oscillogram is obtained. As can be seen from fig. 8, the waveform diagram after data preprocessing is very beautiful, and the difference between the two currents can be visually seen.
Fig. 9 to 12 are microscopic time domain simulations of the electric bicycle and other electric appliances at different stages, and for example, a state of 9 to 10 seconds is selected for simulation in a state before charging. The state during charging is selected to 259-260 s for simulation. Through comparison, the charging current waveform of the electric bicycle during charging is more uniform and clearer than that of the electric bicycle before charging, the positive and negative alternation of the waveform is more regular, the waveform amplitude is larger and is close to 20A, and the current of the electric bicycle before charging is less than 0.5A. Comparing fig. 11 and fig. 12, it is found that the current waveforms of other electrical appliances during charging are sawtooth triangular waves, which are completely different from the waveforms of the electric bicycle, and the waveforms are relatively uniform and clear. The current waveform before charging is relatively scattered and the amplitude is relatively small by comprehensively comparing the current waveform before charging with the current waveform during charging. The current waveform in charging is more regular and clearer, and the charging current amplitude is more stable and cannot be suddenly changed.
The time domain voltage and current data of the electric bicycle and other electrical appliances are converted into the frequency domain voltage and current data through the fast Fourier transform, and the whole process is subjected to frequency domain simulation, as shown in FIG. 13, the energy is almost concentrated around the fundamental wave in the whole process, and the amplitude is reduced along with the increase of the frequency. It should be noted that the harmonic feature table mentioned above is a rough analysis of the electric bicycle and other electric appliances according to the frequency spectrum diagram, and it is not mentioned that an odd harmonic does not exist, but its amplitude is lower and is not easily seen in the frequency spectrum diagram.
The embodiment of the invention also performs frequency domain simulation on the electric bicycle and other electric appliances in three states, takes one second in each state to perform Fourier transform to obtain a spectrogram in one second, and respectively takes the 10 th s, the 25 th s and the 100 th s to perform frequency spectrum simulation, as shown in fig. 14, because the frequency spectrums in the three states are analyzed, the frequency spectrum simulation is not described here.
The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above-mentioned embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may be made by those skilled in the art without departing from the principle of the invention.