Harmonic early warning method and device, electronic equipment and storage medium
The harmonic early warning method, which utilizes frequency domain transformation and dimension reduction matrix transformation, solves the problem of high resource investment in power grid harmonic detection, and achieves efficient and low-cost harmonic early warning, applicable to distribution networks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHU POWER SUPPLY COMPANY OF STATE GRID ANHUI ELECTRIC POWER
- Filing Date
- 2025-11-13
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies require significant resources and computational costs to detect harmonics in the power grid, and suffer from false alarms and missed alarms due to intermittent harmonic detection.
By acquiring a current waveform data queue, performing frequency domain transformation and dimensionality reduction matrix transformation, a harmonic early warning model is constructed. The frequency domain value is used for harmonic early warning, reducing computational complexity and hardware requirements.
It enables efficient detection of power grid harmonics with low computational and hardware resource investment, and is suitable for harmonic early warning in distribution networks, reducing false alarms and missed alarms.
Smart Images

Figure CN121878286A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid harmonic analysis technology, and in particular to a harmonic early warning method, device, electronic equipment and storage medium. Background Technology
[0002] Power grid harmonics mainly originate from nonlinear loads, namely electrical equipment where voltage and current are not linearly related. These devices mainly include: power electronic equipment, such as frequency converters and rectifiers (used in charging piles and industrial speed regulation), which convert AC power to DC power or adjust the frequency during operation, generating a large number of high-order harmonics; arc-type equipment, such as welding machines and electric arc furnaces, where the instability of arc combustion leads to current waveform distortion; and nonlinear household appliances, such as air conditioners, microwave ovens, and LED lights.
[0003] Harmonic mitigation typically involves analyzing current waveforms to pinpoint the timing and location of harmonic occurrences, enabling targeted harmonic compensation and mitigation. Currently, the mainstream technique for current waveform analysis utilizes wavelet transform to capture the amplitude, frequency, and timing of harmonic occurrences within the grid current in real time.
[0004] Since harmonics usually occur intermittently and for short periods of time, using the waveform analysis method described above to detect harmonics is characterized by high computational cost and significant hardware investment.
[0005] Therefore, it is necessary to develop and design a harmonic early warning method. Summary of the Invention
[0006] The present invention provides a harmonic early warning method, device, electronic device and storage medium to solve the problem that the detection of harmonics in the power grid requires a lot of resources in the prior art.
[0007] In a first aspect, embodiments of the present invention provide a harmonic early warning method, comprising: Acquire the first current waveform data queue, wherein the first current waveform data queue is obtained based on the current sampling at the feeder and bus connection ends; The first current waveform data queue is transformed in the frequency domain to obtain multiple frequency amplitudes and construct a first amplitude vector, wherein each frequency amplitude corresponds to a frequency; The first magnitude vector is transformed using a dimension reduction matrix to obtain a second magnitude vector, wherein the number of dimensions of the second magnitude vector is less than the number of dimensions of the first magnitude vector. The second amplitude vector is input into the harmonic warning model to obtain a harmonic warning message. The harmonic warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic warning type.
[0008] In one possible implementation, the step of performing a frequency domain transformation on the first current waveform data queue to obtain multiple frequency amplitudes and construct a first amplitude vector includes: Obtain the power frequency of the power grid; Multiple frequency multipliers are generated based on the power frequency, wherein the frequency multipliers are integer multiples of the power frequency; Extract the frequency harmonics sequentially from the plurality of frequency harmonics; The frequency amplitude is obtained by performing a frequency domain transformation on the first current waveform data queue based on the extracted harmonics. Add the frequency amplitude as an element vector to the first amplitude vector; If the traversal of the multiple harmonics is not completed, then proceed to the step of extracting harmonics sequentially from the multiple harmonics.
[0009] In one possible implementation, the step of performing a frequency domain transformation on the first current waveform data queue based on the extracted harmonic to obtain the frequency amplitude includes: The frequency amplitude is obtained by performing a frequency domain transformation on the first current waveform data queue based on the extracted frequency harmonics and the first formula, wherein the first formula is: In the formula, for frequency amplitude of the harmonic. For the first current waveform data queue One data point, It is a natural constant. Pi The power frequency. The imaginary unit, This represents the total number of data items in the first current waveform data queue.
[0010] In one possible implementation, the step of obtaining the dimensionality reduction matrix includes: Multiple first amplitude sample vectors are obtained, wherein the first amplitude sample vectors are constructed based on the first current waveform data sample queue through frequency domain transformation; Each first amplitude sample vector is standardized dimension by dimension to obtain a first standard vector, and a covariance matrix is constructed based on multiple first standard vectors; Solve for multiple eigenvalues and multiple eigenvectors of the covariance matrix, where each eigenvalue corresponds to an eigenvector; Multiple target feature values are selected from the plurality of feature values, wherein the ratio of the sum of the plurality of target feature values to the sum of the plurality of feature values is greater than a ratio threshold, and the minimum value among the plurality of target feature values is greater than or equal to the maximum value among the non-target feature values; The feature vectors corresponding to the multiple target feature values are used as target feature vectors, and a dimensionality reduction matrix is constructed based on the target feature vectors.
[0011] In one possible implementation, the standardization of each first amplitude sample vector dimensionally to obtain a first standard vector, and the construction of a covariance matrix based on multiple first standard vectors, includes: For each first amplitude sample vector, the data is standardized dimension-by-dimensionally using the second formula, and the standardized data is added to the first standard vector. The second formula is: In the formula, For the first The first standard vector of the first standard vector One element, For the first The first magnitude sample vector of the first magnitude sample vector One element, For multiple first magnitude sample vectors The mean of the dimensional data. For multiple first magnitude sample vectors The standard deviation of dimensional data This represents the total number of sample vectors for the first magnitude. The covariance matrix is constructed based on the third formula and multiple first standard vectors, wherein the third formula is: In the formula, Let covariance matrix be the variance matrix. The first row of the covariance matrix is the first... Column elements, For the first standard vector, For the first One first standard vector; The step of performing a dimensionality transformation on the first magnitude vector using a dimensionality reduction matrix to obtain a second magnitude vector includes: The first magnitude vector is transformed in dimension using the fourth formula and a dimension reduction matrix to obtain the second magnitude vector, wherein the fourth formula is: In the formula, This is the second magnitude vector. This is the first magnitude vector. This is a dimension-reduced matrix.
[0012] In one possible implementation, the harmonic early warning model is constructed based on a plurality of second amplitude sample vectors, including: Obtain a fitting equation, multiple second amplitude sample vectors, and multiple first labels. Each second amplitude sample vector corresponds to a first label, and the first label indicates whether the current waveform from which the second amplitude sample vector originates has harmonics. The fitting equation fits the relationship between the second amplitude sample vectors and the first labels. The fitting equation contains multiple first coefficients. The first coefficients of the fitted equation are preset to random values; Substitute the plurality of second amplitude sample vectors into the fitting equation to obtain a plurality of probability estimates, wherein each second amplitude sample vector corresponds to a probability estimate. Substitute the plurality of probability estimates and the plurality of first labels into the first loss function to obtain the model loss; The first coefficients of the fitted equation are optimized with the goal of minimizing the loss until the model loss is less than the loss threshold. The fitted equation is used as the harmonic early warning model.
[0013] In one possible implementation, a first label of 1 indicates the presence of harmonics in the source current waveform, and a first label of 0 indicates the absence of harmonics in the source current waveform. The fitting equation is: In the formula, For the first The probability that the waveform from which the second amplitude sample vector originates contains harmonics. It is a natural constant. As joint variables, For the first The first coefficient, The constant coefficients, For the first The second magnitude sample vector of the first One element, This represents the total number of elements in the second amplitude sample vector. The first loss function is: In the formula, This is the loss value. The number of sample vectors for the second magnitude. For the first The first label corresponding to the second magnitude sample vector It is the natural logarithm function.
[0014] In a second aspect, embodiments of the present invention provide a harmonic early warning device for implementing the harmonic early warning method as described in the first aspect or any possible implementation thereof, the harmonic early warning device comprising: The current data acquisition module is used to acquire a first current waveform data queue, wherein the first current waveform data queue is obtained based on current sampling at the feeder and bus connection ends; The frequency domain transformation module is used to perform frequency domain transformation on the first current waveform data queue, and construct a first amplitude vector from multiple frequency amplitudes, wherein each frequency amplitude corresponds to a frequency; The dimension transformation module is used to perform dimension transformation on the first magnitude vector using a dimension reduction matrix to obtain a second magnitude vector, wherein the number of dimensions of the second magnitude vector is less than the number of dimensions of the first magnitude vector; as well as, The harmonic warning module is used to input the second amplitude vector into the harmonic warning model to obtain a harmonic warning message. The harmonic warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic warning type.
[0015] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation of the first aspect.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect or any possible implementation thereof.
[0017] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: This invention discloses a harmonic early warning method. First, a first current waveform data queue is acquired, which is obtained based on current sampling at the feeder and bus connection terminals. Then, the first current waveform data queue undergoes frequency domain transformation, obtaining multiple frequency amplitudes to construct a first amplitude vector, where each frequency amplitude corresponds to a frequency. Next, the first amplitude vector is dimensionally transformed using a dimensionality reduction matrix to obtain a second amplitude vector, where the number of dimensions of the second amplitude vector is less than that of the first amplitude vector. Finally, the second amplitude vector is input into a harmonic early warning model to obtain a harmonic early warning message. The harmonic early warning model is constructed based on multiple second amplitude sample vectors, with each second amplitude sample vector corresponding to a harmonic early warning type. This invention extracts current waveforms in time periods, obtains frequency domain values through frequency domain transformation, and inputs the dimensionality-reduced multiple frequency domain values into an early warning model, thereby outputting an early warning message indicating the presence of severe harmonics in the current. This method does not require high real-time performance or extensive computation; therefore, under the same conditions, it does not require significant hardware resources and is suitable for power distribution networks. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the harmonic early warning method provided by the embodiments of the present invention; Figure 2 This is a comparison chart of harmonic analysis of different waveforms provided by the embodiments of the present invention; Figure 3 This is a functional block diagram of the harmonic early warning device provided in the embodiments of the present invention; Figure 4 This is a functional block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] In the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0021] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
[0022] The embodiments of the present invention will be described in detail below. This example is implemented based on the technical solution of the present invention, and provides detailed implementation methods and specific operation processes. However, the protection scope of the present invention is not limited to the following embodiments.
[0023] Figure 1 A flowchart of a harmonic early warning method provided for an embodiment of the present invention.
[0024] like Figure 1 As shown, a flowchart illustrating the implementation of the harmonic early warning method provided by an embodiment of the present invention is presented, and is described in detail below: In step 101, a first current waveform data queue is obtained, wherein the first current waveform data queue is obtained based on current sampling at the feeder and bus connection terminals.
[0025] In step 102, the first current waveform data queue is transformed in the frequency domain to obtain multiple frequency amplitudes and construct a first amplitude vector, wherein each frequency amplitude corresponds to a frequency.
[0026] In some implementations, the step of performing a frequency domain transformation on the first current waveform data queue to obtain multiple frequency amplitudes and construct a first amplitude vector includes: Obtain the power frequency of the power grid; Multiple frequency multipliers are generated based on the power frequency, wherein the frequency multipliers are integer multiples of the power frequency; Extract the frequency harmonics sequentially from the plurality of frequency harmonics; The frequency amplitude is obtained by performing a frequency domain transformation on the first current waveform data queue based on the extracted harmonics. Add the frequency amplitude as an element vector to the first amplitude vector; If the traversal of the multiple harmonics is not completed, then proceed to the step of extracting harmonics sequentially from the multiple harmonics.
[0027] In some implementations, the step of performing a frequency domain transformation on the first current waveform data queue based on the extracted harmonics to obtain the frequency amplitude includes: The frequency amplitude is obtained by performing a frequency domain transformation on the first current waveform data queue based on the extracted frequency harmonics and the first formula, wherein the first formula is: In the formula, for frequency amplitude of the harmonic. For the first current waveform data queue One data point, It is a natural constant. Pi The power frequency. The imaginary unit, This represents the total number of data items in the first current waveform data queue.
[0028] For example, the application scenario of this invention is applicable to the feeder end of a power grid, where the feeder is responsible for connecting loads to the bus, thereby enabling power to supply power to multiple loads through the bus. In other words, one end of the feeder is connected to the bus, and the other end is connected to the load. This invention obtains current sampling values based on the end of the feeder connected to the bus, and these sampling values are arranged in chronological order to form a first current waveform data queue.
[0029] Currently, the main method for detecting harmonic currents is through real-time wavelet transform. This is because some occasional and short-lived harmonics may be falsely detected or missed when using Fourier transform.
[0030] like Figure 2 Two extreme cases are illustrated. In the first waveform, harmonics are present throughout the entire time period, as shown by multiple typical first frequency domain amplitudes 201 obtained from frequency domain analysis. In the second waveform, high harmonic content is observed in certain time periods, as shown by multiple typical second frequency domain amplitudes 202 obtained from frequency domain analysis. The two cases are highly similar, making misjudgment very easy. In reality, the second case is more serious than the first, because analysis of the later time periods in the second case reveals that the harmonic amplitudes are much higher than what the frequency domain analysis shows (the second typical frequency domain amplitudes represent the harmonic amplitudes for the entire time period, which are averaged across the entire time period).
[0031] However, upon closer observation, it can be found that after Fourier transform, the latter case, in addition to the typical harmonic amplitude, also contains a low-amplitude atypical frequency domain amplitude 203 (the rectangular part), which does not exist in the former case, or is much smaller than the latter.
[0032] The present invention aims to analyze the severity of harmonics in current by analyzing all frequency domain amplitudes (typical and atypical) and to provide early warning messages.
[0033] The first current waveform data queue corresponds to a time period, which is longer than the period of the supply voltage waveform, typically several times longer. For example, current sampling values of 3-10 periods form a current data queue. This is done because subsequent frequency amplitude can be extracted through frequency domain transformation, and then classified using a harmonic early warning model to determine whether significant harmonics are generated within this time period. This method is more efficient and requires less computational power than current methods using wavelet transform for real-time analysis. Furthermore, when the analysis results show that harmonics occur within this time period, it is entirely feasible to take necessary measures, such as locating the time and location of harmonic generation and implementing mitigation measures. In other words, this invention aims to provide a relatively simple and computationally efficient method for detecting feeder harmonics.
[0034] In terms of frequency domain transformation, this invention first obtains the power grid frequency, generates multiple harmonics from this frequency, and uses each harmonic and a first formula to extract the frequency amplitude from the first current waveform data queue: In the formula, for frequency amplitude of the harmonic. For the first current waveform data queue One data point, It is a natural constant. Pi The power frequency. The imaginary unit, This represents the total number of data items in the first current waveform data queue.
[0035] These magnitudes will eventually be added as elements of the first magnitude vector.
[0036] In step 103, the first magnitude vector is transformed using a dimension reduction matrix to obtain a second magnitude vector, wherein the number of dimensions of the second magnitude vector is less than the number of dimensions of the first magnitude vector.
[0037] In some implementations, the step of obtaining the dimensionality reduction matrix includes: Multiple first amplitude sample vectors are obtained, wherein the first amplitude sample vectors are constructed based on the first current waveform data sample queue through frequency domain transformation; Each first amplitude sample vector is standardized dimension by dimension to obtain a first standard vector, and a covariance matrix is constructed based on multiple first standard vectors; Solve for multiple eigenvalues and multiple eigenvectors of the covariance matrix, where each eigenvalue corresponds to an eigenvector; Multiple target feature values are selected from the plurality of feature values, wherein the ratio of the sum of the plurality of target feature values to the sum of the plurality of feature values is greater than a ratio threshold, and the minimum value among the plurality of target feature values is greater than or equal to the maximum value among the non-target feature values; The feature vectors corresponding to the multiple target feature values are used as target feature vectors, and a dimensionality reduction matrix is constructed based on the target feature vectors.
[0038] In some implementations, the step of standardizing each first amplitude sample vector dimensionally to obtain a first standard vector, and constructing a covariance matrix based on multiple first standard vectors, includes: For each first amplitude sample vector, the data is standardized dimension-by-dimensionally using the second formula, and the standardized data is added to the first standard vector. The second formula is: In the formula, For the first The first standard vector of the first standard vector One element, For the first The first magnitude sample vector of the first magnitude sample vector One element, For multiple first magnitude sample vectors The mean of the dimensional data. For multiple first magnitude sample vectors The standard deviation of dimensional data This represents the total number of sample vectors for the first magnitude. The covariance matrix is constructed based on the third formula and multiple first standard vectors, wherein the third formula is: In the formula, Let covariance matrix be the variance matrix. The first row of the covariance matrix is the first... Column elements, For the first standard vector, For the first One first standard vector; The step of performing a dimensionality transformation on the first magnitude vector using a dimensionality reduction matrix to obtain a second magnitude vector includes: The first magnitude vector is transformed in dimension using the fourth formula and a dimension reduction matrix to obtain the second magnitude vector, wherein the fourth formula is: In the formula, This is the second magnitude vector. This is the first magnitude vector. This is a dimension-reduced matrix.
[0039] For example, to improve the ability to distinguish the presence of harmonics, the frequency amplitude values obtained in the aforementioned steps are usually numerous, such as the 30th harmonic or even more. In reality, these harmonics may contain redundant terms, affecting the model's construction and usage. Therefore, this invention uses a dimensionality reduction matrix to process the first amplitude vector obtained in the aforementioned steps for dimensionality reduction. Specifically, in one scenario, the first amplitude vector is used as a row vector, and the fourth formula is used to convert it into a second amplitude vector: In the formula, This is the second magnitude vector. This is the first magnitude vector. This is a dimension-reduced matrix.
[0040] We can see that the dimensionality reduction matrix is the key factor affecting the dimensionality and the degree of information retention after dimensionality reduction.
[0041] In fact, the dimensionality reduction matrix is constructed from multiple sample vectors. Specifically, multiple first-amplitude sample vectors are first obtained. The method for obtaining the first-amplitude sample vector is the same as that for obtaining the first-amplitude vector, both of which are obtained by frequency domain transformation through a current waveform data sample queue.
[0042] Then, for each element of each first magnitude sample vector, standardization is performed using the second formula: In the formula, For the first The first standard vector of the first standard vector One element, For the first The first magnitude sample vector of the first magnitude sample vector One element, For multiple first magnitude sample vectors The mean of the dimensional data. For multiple first magnitude sample vectors The standard deviation of dimensional data This represents the total number of sample vectors for the first magnitude.
[0043] Standardized data of the same dimension will be added to the same vector, thus forming the first standard vector. In other words, the elements in the first standard vector come from multiple first amplitude sample vectors and correspond to the same dimension of the first amplitude sample vectors, ultimately resulting in a first standard vector with the same number of dimensions as the first amplitude sample vectors.
[0044] Then, the covariance matrix can be constructed using the aforementioned multiple first standard vectors: In the formula, Let covariance matrix be the variance matrix. The first row of the covariance matrix is the first... Column elements, For the first standard vector, For the first The first standard vector.
[0045] Next, the eigenvalues and eigenvectors of the covariance matrix are calculated. The eigenvalues are sorted by value, and the smallest eigenvalues are gradually removed until the ratio of the sum of the remaining eigenvalues to the sum of all eigenvalues is greater than a ratio threshold (e.g., 0.92). At this point, the main eigenvalues have been selected.
[0046] Since there is a one-to-one relationship between eigenvalues and eigenvectors, we can obtain the eigenvectors we want to retain based on the remaining eigenvalues. These eigenvectors will eventually be used as column vectors to construct a dimension-reduced matrix.
[0047] In step 104, the second amplitude vector is input into the harmonic warning model to obtain a harmonic warning message. The harmonic warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic warning type.
[0048] In some implementations, the harmonic early warning model is constructed based on a plurality of second amplitude sample vectors, including: Obtain a fitting equation, multiple second amplitude sample vectors, and multiple first labels. Each second amplitude sample vector corresponds to a first label, and the first label indicates whether the current waveform from which the second amplitude sample vector originates has harmonics. The fitting equation fits the relationship between the second amplitude sample vectors and the first labels. The fitting equation contains multiple first coefficients. The first coefficients of the fitted equation are preset to random values; Substitute the plurality of second amplitude sample vectors into the fitting equation to obtain a plurality of probability estimates, wherein each second amplitude sample vector corresponds to a probability estimate. Substitute the plurality of probability estimates and the plurality of first labels into the first loss function to obtain the model loss; The first coefficients of the fitted equation are optimized with the goal of minimizing the loss until the model loss is less than the loss threshold. The fitted equation is used as the harmonic early warning model.
[0049] In some implementations, a first label of 1 indicates the presence of harmonics in the source current waveform, and a first label of 0 indicates the absence of harmonics in the source current waveform. The fitting equation is: In the formula, For the first The probability that the waveform from which the second amplitude sample vector originates contains harmonics. It is a natural constant. As joint variables, For the first The first coefficient, The constant coefficients, For the first The second magnitude sample vector of the first One element, This represents the total number of elements in the second amplitude sample vector. The first loss function is: In the formula, This is the loss value. The number of sample vectors for the second magnitude. For the first The first label corresponding to the second magnitude sample vector It is the natural logarithm function.
[0050] For example, the present invention inputs the second amplitude vector obtained in the above steps into the harmonic early warning model, which will give the probability that the current waveform contains harmonics. Generally speaking, the output value of the probability model is between 0 and 1. When the output value is higher than 0.5, it means that there are relatively serious harmonics in the current waveform, and the more the value increases, the more serious the harmonic situation becomes. When the output value is lower than 0.5, it means that the harmonic current in the current waveform is small, and the smaller the value, the smaller the proportion of harmonics.
[0051] We can see that this model is key to implementing harmonic warning messages. In fact, this model is a fitting model, and its equation expression is: In the formula, For the first The probability that the waveform from which the second amplitude sample vector originates contains harmonics. It is a natural constant. As joint variables, For the first The first coefficient, The constant coefficients, For the first The second magnitude sample vector of the first One element, This represents the total number of elements in the second amplitude sample vector.
[0052] As can be seen, the model contains multiple coefficients: the first coefficient and the constant coefficient. The appropriateness of the values of these coefficients determines the accuracy of the warning message.
[0053] This invention determines these coefficients using multiple second amplitude sample vectors. Each of these second amplitude sample vectors corresponds to a first label: used to identify whether the current waveform from which the second amplitude sample vector originates has harmonics. These labels are either 1 or 0, representing that the source waveform contains more severe harmonics and that the harmonic current is more acceptable, respectively.
[0054] We pre-define multiple coefficient values and input multiple second-amplitude sample vectors one by one into the equation to obtain multiple probability estimates. These multiple probability estimates and their corresponding first labels are used to calculate the model output loss. This invention applies a first loss function: In the formula, This is the loss value. The number of sample vectors for the second magnitude. For the first The first label corresponding to the second magnitude sample vector It is the natural logarithm function.
[0055] Based on the model loss, we can use an optimization algorithm (such as gradient descent) to optimize multiple preset coefficient values, and repeat the steps of inputting multiple second amplitude sample vectors into the equation one by one until the loss obtained by the first loss function is lower than the threshold. At this point, we can fix the preset coefficient values and use the fitted equation as the harmonic early warning model.
[0056] In other words, the fitting equation fits the relationship between the second amplitude sample vector and the presence of harmonics in the source current waveform. Since the acquisition process of the second amplitude sample vector is the same as that of the second amplitude vector, it has a good early warning effect for determining the presence of harmonics in the current waveform based on the second amplitude vector. Furthermore, we can see that, apart from one exponential operation, the above harmonic early warning model consists of multiplication and summation operations, which is much less computationally intensive than other algorithms (such as artificial neural network algorithms). In other words, it requires less computational resources and the modeling process is relatively simple.
[0057] The implementation method of the harmonic early warning method of this invention first acquires a first current waveform data queue, which is obtained based on current sampling at the feeder and bus connection ends; then, the first current waveform data queue is subjected to frequency domain transformation to obtain multiple frequency amplitudes to construct a first amplitude vector, where each frequency amplitude corresponds to a frequency; next, the first amplitude vector is transformed in dimension using a dimensionality reduction matrix to obtain a second amplitude vector, where the number of dimensions of the second amplitude vector is less than the number of dimensions of the first amplitude vector; finally, the second amplitude vector is input into a harmonic early warning model to obtain a harmonic early warning message, wherein the harmonic early warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic early warning type. This invention extracts current waveforms in time periods, obtains frequency domain values through frequency domain transformation, and inputs multiple frequency domain values into an early warning model after dimensionality reduction, thereby outputting an early warning message indicating whether there are serious harmonics in the current. This method does not require high real-time requirements or a large amount of computation; therefore, under the same conditions, it does not require a large investment of hardware resources and is suitable for distribution networks.
[0058] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0059] The following are embodiments of the apparatus of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.
[0060] Figure 3 This is a functional block diagram of the harmonic early warning device provided in the embodiments of the present invention, with reference to... Figure 3 The harmonic early warning device includes: a current data acquisition module 301, a frequency domain transformation module 302, a dimension transformation module 303, and a harmonic early warning module 304, wherein: The current data acquisition module 301 is used to acquire a first current waveform data queue, wherein the first current waveform data queue is obtained based on current sampling at the feeder and bus connection ends; The frequency domain transformation module 302 is used to perform frequency domain transformation on the first current waveform data queue, and construct a first amplitude vector from multiple frequency amplitudes, wherein each frequency amplitude corresponds to a frequency; The dimension transformation module 303 is used to perform dimension transformation on the first magnitude vector using a dimension reduction matrix to obtain a second magnitude vector, wherein the number of dimensions of the second magnitude vector is less than the number of dimensions of the first magnitude vector; The harmonic warning module 304 is used to input the second amplitude vector into the harmonic warning model to obtain a harmonic warning message. The harmonic warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic warning type.
[0061] Figure 4 This is a functional block diagram of the electronic device provided in an embodiment of the present invention. For example... Figure 4 As shown, the electronic device 4 of this embodiment includes a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can run on the processor 400. When the processor 400 executes the computer program 402, it implements the steps of the various harmonic warning methods and embodiments described above, for example... Figure 1 Steps 101 to 104 are shown.
[0062] For example, the computer program 402 may be divided into one or more modules / units, which are stored in the memory 401 and executed by the processor 400 to complete the present invention.
[0063] The electronic device 4 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The electronic device 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 4 and does not constitute a limitation on electronic device 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 4 may also include input / output devices, network access devices, buses, etc.
[0064] The processor 400 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0065] The memory 401 can be an internal storage unit of the electronic device 4, such as a hard disk or memory. The memory 401 can also be an external storage device of the electronic device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 401 can include both internal and external storage units of the electronic device 4. The memory 401 is used to store the computer program 402 and other programs and data required by the electronic device 4. The memory 401 can also be used to temporarily store data that has been output or will be output.
[0066] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here.
[0067] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0068] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0069] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0070] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0071] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0072] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods and apparatus embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0073] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A harmonic pre-warning method, characterized in that, include: Acquire the first current waveform data queue, wherein the first current waveform data queue is obtained based on the current sampling at the feeder and bus connection ends; The first current waveform data queue is transformed in the frequency domain to obtain multiple frequency amplitudes and construct a first amplitude vector, wherein each frequency amplitude corresponds to a frequency; The first magnitude vector is transformed using a dimension reduction matrix to obtain a second magnitude vector, wherein the number of dimensions of the second magnitude vector is less than the number of dimensions of the first magnitude vector. The second amplitude vector is input into the harmonic warning model to obtain a harmonic warning message. The harmonic warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic warning type.
2. The harmonic pre-warning method according to claim 1, characterized in that, The step of performing a frequency domain transformation on the first current waveform data queue to obtain multiple frequency amplitudes and construct a first amplitude vector includes: Obtain the power frequency of the power grid; Multiple frequency multipliers are generated based on the power frequency, wherein the frequency multipliers are integer multiples of the power frequency; Extract the frequency harmonics sequentially from the plurality of frequency harmonics; The frequency amplitude is obtained by performing a frequency domain transformation on the first current waveform data queue based on the extracted harmonics. Add the frequency amplitude as an element vector to the first amplitude vector; If the traversal of the multiple harmonics is not completed, then proceed to the step of extracting harmonics sequentially from the multiple harmonics.
3. The harmonic warning method of claim 2, wherein, The step of performing frequency domain transformation on the first current waveform data queue based on the extracted harmonics to obtain the frequency amplitude includes: The frequency amplitude is obtained by performing a frequency domain transformation on the first current waveform data queue based on the extracted frequency harmonics and the first formula, wherein the first formula is: In the formula, is the frequency amplitude of the double frequency, is the first current waveform data queue data, is a natural constant, is a natural constant, is the power frequency, is the imaginary unit, is the total number of data in the first current waveform data queue.
4. The harmonic warning method of claim 1, wherein, The steps for obtaining the dimensionality reduction matrix include: Multiple first amplitude sample vectors are obtained, wherein the first amplitude sample vectors are constructed based on the first current waveform data sample queue through frequency domain transformation; Each first amplitude sample vector is standardized dimension by dimension to obtain a first standard vector, and a covariance matrix is constructed based on multiple first standard vectors; Solve for multiple eigenvalues and multiple eigenvectors of the covariance matrix, where each eigenvalue corresponds to an eigenvector; Multiple target feature values are selected from the plurality of feature values, wherein the ratio of the sum of the plurality of target feature values to the sum of the plurality of feature values is greater than a ratio threshold, and the minimum value among the plurality of target feature values is greater than or equal to the maximum value among the non-target feature values; The feature vectors corresponding to the multiple target feature values are used as target feature vectors, and a dimensionality reduction matrix is constructed based on the target feature vectors.
5. The harmonic warning method according to claim 4, characterized in that, The step of standardizing each first amplitude sample vector dimensionally to obtain a first standard vector, and constructing a covariance matrix based on multiple first standard vectors, includes: For each first amplitude sample vector, the data is standardized dimension-by-dimensionally using the second formula, and the standardized data is added to the first standard vector. The second formula is: In the formula, For the first The first standard vector of the first standard vector One element, For the first The first magnitude sample vector of the first magnitude sample vector One element, For multiple first magnitude sample vectors The mean of the dimensional data. For multiple first magnitude sample vectors Standard deviation of dimensional data This represents the total number of sample vectors for the first magnitude. The covariance matrix is constructed based on the third formula and multiple first standard vectors, wherein the third formula is: In the formula, Let covariance matrix be the variance matrix. The first row of the covariance matrix is the first... Column elements, For the first standard vector, For the first A first standard vector; The step of performing a dimensionality transformation on the first magnitude vector using a dimensionality reduction matrix to obtain a second magnitude vector includes: The first magnitude vector is transformed in dimension using the fourth formula and a dimension reduction matrix to obtain the second magnitude vector, wherein the fourth formula is: wherein is a second amplitude vector, is a first amplitude vector, is a dimension reduction matrix.
6. The harmonic warning method according to any one of claims 1 to 5, characterized in that, The harmonic early warning model is constructed based on multiple second amplitude sample vectors, including: Obtain a fitting equation, multiple second amplitude sample vectors, and multiple first labels. Each second amplitude sample vector corresponds to a first label, and the first label indicates whether the current waveform from which the second amplitude sample vector originates has harmonics. The fitting equation fits the relationship between the second amplitude sample vector and the first label. The fitting equation contains multiple first coefficients. The first coefficients of the fitted equation are preset to random values; Substitute the plurality of second amplitude sample vectors into the fitting equation to obtain a plurality of probability estimates, wherein each second amplitude sample vector corresponds to a probability estimate. Substitute the plurality of probability estimates and the plurality of first labels into the first loss function to obtain the model loss; The first coefficients of the fitted equation are optimized with the goal of minimizing the loss until the model loss is less than the loss threshold. The fitted equation is used as the harmonic early warning model.
7. The harmonic warning method according to claim 6, characterized in that, A first label of 1 indicates that the source current waveform contains harmonics, and a first label of 0 indicates that the source current waveform does not contain harmonics. The fitting equation is: In the formula, For the first The probability that the waveform from which the second amplitude sample vector originates contains harmonics. It is a natural constant. As joint variables, For the first The first coefficient, The constant coefficients, For the first The second magnitude sample vector of the first One element, This represents the total number of elements in the second amplitude sample vector. The first loss function is: In the formula, This is the loss value. This represents the number of sample vectors for the second magnitude. For the first The first label corresponding to the second magnitude sample vector It is the natural logarithm function.
8. A harmonic alert device, characterized by For implementing the harmonic early warning method as described in any one of claims 1-7, the harmonic early warning device comprises: The current data acquisition module is used to acquire a first current waveform data queue, wherein the first current waveform data queue is obtained based on current sampling at the feeder and bus connection ends; The frequency domain transformation module is used to perform frequency domain transformation on the first current waveform data queue, and construct a first amplitude vector from multiple frequency amplitudes, wherein each frequency amplitude corresponds to a frequency; The dimension transformation module is used to perform dimension transformation on the first magnitude vector using a dimension reduction matrix to obtain a second magnitude vector, wherein the number of dimensions of the second magnitude vector is less than the number of dimensions of the first magnitude vector; as well as, The harmonic warning module is used to input the second amplitude vector into the harmonic warning model to obtain a harmonic warning message. The harmonic warning model is constructed based on multiple second amplitude sample vectors, and each second amplitude sample vector corresponds to a harmonic warning type.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7 above.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7 above.