Electric energy quality early warning method, electronic equipment and storage medium

By processing the power signal of the power grid running state and the K-center point cluster algorithm processing, dynamically update the early warning value, solve the problem that the fixed threshold cannot adapt to the status of different grids, and achieve flexible and accurate electrical energy quality warning.

CN119337164APending Publication Date: 2025-01-21HEBEI EXPRESSWAY GRP LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411421496.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the fixed power quality threshold cannot adapt to different power grid states, resulting in the inability to timely warning of power quality problems in some states.

Method used

By obtaining multiple power signal samples under the current operating status, wavelet transform is performed to extract frequency domain features, and the K-center point clustering algorithm is used to divide the signals into normal and abnormal classes, and the early warning values ​​are dynamically updated to achieve flexible power quality early warning. .

Benefits of technology

Improve the flexibility and accuracy of the power quality warning, avoid problems that fixed thresholds are not applicable in different grids, and realize the timely update and timely warning of the threshold.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337164A_ABST
    Figure CN119337164A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an electric energy quality early warning method, electronic equipment and a storage medium, and relates to the field of electric energy quality early warning. The method comprises the steps that a plurality of electric energy signal samples in a current operation state are acquired, and each electric energy signal sample comprises a voltage amplitude and a phase; forming a time domain waveform by the voltage amplitude and the phase of each electric energy signal sample, and performing wavelet transform on each time domain waveform to obtain a frequency domain feature of each electric energy signal sample; clustering each frequency domain feature by using a K-center point clustering algorithm, and dividing the plurality of electric energy signals into a normal type and an abnormal type; taking the voltage amplitude of the normal sample farthest from the normal clustering center as an early warning value in the current operation state; and when the monitored voltage is greater than the early warning value, sending out an electric energy quality early warning. According to the embodiment of the invention, the dynamic setting of the threshold value in different operation states is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of power quality early warning, and in particular to a power quality early warning method, electronic equipment and storage medium. Background Art

[0002] The quality of power not only affects the safety, stability and economic operation of the power grid, but also directly affects the normal operation of the power equipment on the user side. With the widespread application of nonlinear, impact, unbalanced and other interference loads in the power grid, as well as sensitive loads, the problem of power quality is becoming increasingly serious, and the prediction and early warning of power quality are becoming more and more important.

[0003] In the prior art, a fixed power quality threshold is usually set, and an early warning is issued when the monitoring signal is greater than the threshold. However, the power quality status under different power grid conditions is different, and the fixed threshold is not applicable to all conditions or all time periods. For example, when the power grid load is small, if the threshold is too high, it is impossible to issue a timely early warning for power quality problems, and a smaller threshold should be set. How to set reasonable thresholds under different conditions to achieve timely early warnings under different conditions is an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present invention provide a power quality early warning method, an electronic device and a storage medium to solve the above technical problems.

[0005] In a first aspect, an embodiment of the present invention provides a power quality early warning method, comprising:

[0006] S110, acquiring a plurality of electric energy signal samples in a current operating state, wherein each electric energy signal sample includes a voltage amplitude and a phase;

[0007] S120, forming a time domain waveform from the voltage amplitude and phase of each electric energy signal sample, and performing wavelet transform on each time domain waveform to obtain a frequency domain feature of each electric energy signal sample;

[0008] S130, clustering each frequency domain feature using a K-center point clustering algorithm, and dividing the multiple power signals into two categories: normal and abnormal;

[0009] S140, taking the voltage amplitude of the normal sample farthest from the normal cluster center as the warning value under the current operating state;

[0010] S150, when the monitored voltage is greater than the warning value, issuing a power quality warning;

[0011] S160, when the current operating state changes, obtain multiple new power signal samples under the new current operating state, and re-execute the operations of S120-S160 according to the voltage amplitude and phase of each new power signal sample, dynamically update the warning value, and perform power quality warning according to the dynamically updated warning value. In a second aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0012] one or more processors;

[0013] a memory for storing one or more programs,

[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement the power quality early warning method described in any embodiment.

[0015] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the power quality early warning method described in any embodiment.

[0016] The embodiment of the present invention provides a power quality early warning method, which independently decomposes the power signal under the current operating state through discrete wavelet transform, decomposes and reconstructs the wavelet, and extracts the signal feature quantity; and uses the K-center value clustering algorithm to find the alarm threshold under the current operating state, and issues an early warning when the power quality reaches the threshold, thereby improving the flexibility and practicality of the early warning threshold. At the same time, this embodiment uses whales to optimize power signals, construct a prediction model for power quality problem types, and uses the model to further predict the type of abnormal voltage problems, so that monitoring personnel can obtain valuable analysis and solutions for possible power quality problems in advance and in a targeted manner. It is particularly suitable for power quality early warning on highways where the load is random and the alarm threshold is difficult to set due to large fluctuations. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 is a flow chart of a power quality early warning method provided by an embodiment of the present invention;

[0019] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0021] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0022] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0023] Figure 1 is a flow chart of a power quality early warning method provided by an embodiment of the present invention. The method is executed by an electronic device, such as Figure 1 As shown, the specific steps include:

[0024] S110. Acquire multiple electric energy signal samples in the current operating state, wherein each electric energy signal sample includes a voltage amplitude and a phase.

[0025] The current operating state refers to a relatively stable operating state of the power grid in the current period of time. Optionally, the operating state of the power grid is related to at least one of the actual weather, user behavior, date and equipment usage, and is often a comprehensive reflection of these factors. In this embodiment, a plurality of electric energy signal samples under the current operating state are first extracted as the data source of the entire method.

[0026] Optionally, the electric energy signal here may be a voltage signal, and each electric energy signal sample includes a voltage amplitude and a phase.

[0027] S120 , forming a time domain waveform from the voltage amplitude and phase of each electric energy signal sample, and performing wavelet transform on each time domain waveform to obtain a frequency domain feature of each electric energy signal sample.

[0028] This step extracts the frequency domain features of each electric energy signal sample to mine the frequency domain characteristics of the data. Optionally, the voltage amplitude and phase in any electric energy signal sample can be expanded along the time axis to obtain the voltage time domain waveform within a period of time; the voltage time domain waveform is subjected to wavelet decomposition and reconstruction to obtain the frequency domain features of the electric energy signal sample.

[0029] S130 , clustering each frequency domain feature using a K-medoid clustering algorithm, and dividing the multiple electric energy signals into two categories: normal and abnormal.

[0030] In this step, the K-center clustering algorithm is used to classify the frequency domain features of all samples. The number of classifications K=2, corresponding to the abnormal class C1 and the normal class C2 respectively.

[0031] In a specific implementation, the classification process may include the following steps:

[0032] Step 1: Calculate the Euclidean distance between each frequency domain feature, and divide the frequency domain features with similar distance into one category (for example, frequency domain features with a distance less than 5 are divided into one category) according to the set distance threshold, and divide them into L categories in total, where L is a natural number. It should be emphasized that the L category here has no necessary connection with the K category in K=2.

[0033] Step 2: Select two frequency domain features as two initial cluster centers, and determine the distance from the two initial cluster centers and the class center where the largest frequency domain feature is located as the new abnormal cluster center; use the zero matrix as the new normal cluster center, classify according to the two new cluster centers, and calculate the first classification error. Specifically, select two objects from each frequency domain feature as the initial cluster center points Z1 and Z2, and calculate the distance between each type of frequency domain feature and the two initial cluster centers, and use the center of the class (one of the L classes) where the distance and the largest frequency domain feature are located as the center point of the new abnormal class, which remains unchanged during the entire classification process. Use the zero matrix with zero voltage amplitude and phase as the center of the new normal class, classify each frequency domain feature according to the two cluster centers at this time, and calculate the absolute classification error E0.

[0034] Step 3: Traverse each category of L frequency domain features and perform the following operations in sequence:

[0035] S1. The center of the current class frequency domain feature is used as another new normal cluster center; according to the new normal cluster center and the new abnormal cluster center, each frequency domain feature is reclassified, and the second classification error is calculated. Specifically, one class is selected from classes 1 to L as the cluster center of the normal class, that is, Z2 = x i , i = 1, 2, ..., L, after selection, calculate the distance dist(x) from the remaining classes to the two cluster centers j ,Z1)、dist(x j ,x i ), if dist(x j ,Z1)<dist(x j ,x i ), then x j Add to C1, otherwise x j Add to C2; calculate the absolute error E of the classification at this time abs .

[0036] S2. If the second classification error E abs If the error E0 is less than the first classification error E0, the new normal cluster center re-determined in this operation is used, the classification sets C1 and C2 at this time are used as the initial sets for the next round of operations, and the second classification error and the first classification error are used as the new first classification error to enter the operation on the next type of frequency domain features; otherwise, the normal cluster center and classification set before the start of this round of operations are restored, and the operation on the next type of frequency domain features is entered.

[0037] Step 4: After the traversal is completed, a classification set with the minimum classification error can be finally obtained as the classification of the multiple electric energy signals.

[0038] It should be noted that, after the traditional K-center clustering algorithm preliminarily determines two cluster centers (normal class and abnormal class), it usually calculates the distance between each data point (that is, the frequency domain feature in this embodiment) and each cluster center, and updates the two cluster centers according to the calculated distance. However, after determining the two cluster centers, the present embodiment first divides the frequency domain features with similar distances into one category according to the distance threshold, and obtains a total of K categories (these K categories are irrelevant to the normal class and the abnormal class), and then only calculates the distance between the K class centers and the two cluster centers, thereby replacing the traditional calculation of the distance between each frequency domain feature and the two cluster centers, which can greatly reduce the amount of calculation and improve the classification efficiency. In addition, the traditional K-center clustering algorithm will continuously update the normal class center and the abnormal class center during the cluster update process, while in this embodiment, after determining the abnormal class where the variance maximum value is located according to the preliminary cluster center, the abnormal class center remains unchanged, and only the normal class center is updated in the subsequent cluster update process. This is because abnormal data is diverse, such as voltage distortion data, low voltage data, voltage drop data, voltage interruption data, harmonic data, etc. It is very difficult to group these data into one category and use the single cluster center as the basis for judging all abnormal problems in subsequent operations. The characteristics of normal data are similar, and it is easier to group them into one category as the judgment standard for normal data. Data points outside the normal category are all abnormal data. Therefore, this embodiment does not update the abnormal cluster center, but continuously updates the normal category center, which also greatly improves clustering accuracy and efficiency.

[0039] The above specific implementation method improves the execution steps of the K-center clustering algorithm. In another specific implementation method, the distance calculation method in the K-center clustering algorithm can also be improved. Optionally, the distance between each frequency domain feature and each category center can be calculated according to the following formula:

[0040]

[0041] In the formula, represents the center of any category (including the clustering centers of normal and abnormal classes, and the center of each class in K classes), Y i represents the i-th dimension of any frequency domain feature, and n represents the number of frequency domain dimensions, that is, With Y i dimension; k is a limit variable, S represents the relationship between any frequency domain feature Y and any category center The method modifies the distance measurement method in the K-center clustering algorithm, which can increase the weight of the long-distance component, so that the distance between data points (frequency domain features and category centers) is more focused on the measurement of the long-distance component, thereby improving the clustering accuracy of long-distance points. More specifically, in this embodiment, k is taken as an limiting variable approaching infinity, so that the calculated distance S is the Chebyshev distance. The Chebyshev distance is mainly used to measure the maximum value of the distance between two points in each dimension. The use of the Chebyshev distance in the clustering algorithm can reduce the difference between points that are far away from the category center (called long-distance points) and those that are close to the category center (referred to as other points) to a certain extent, making these long-distance points easier to cluster successfully. This is very important for the situation where sample data is relatively precious in this application, and can avoid many long-distance points from being discarded due to unsuccessful clustering, wasting sample data.

[0042] Of course, in another specific implementation, the execution steps and distance calculation method of the K-center clustering algorithm can also be improved. That is, the K-center clustering algorithm is executed through the above steps 1 to 3, and in steps 2 and 3, the distance between each frequency domain feature and each category center is calculated using formula (1). When calculating the Euclidean distance between each frequency domain feature in step 1, the formula (1) is replaced by The related variable of is replaced by the related variable of another frequency domain feature involved in distance calculation, and the distance calculated by formula (1) is used instead of the Euclidean distance.

[0043] S140, taking the voltage amplitude of the normal sample farthest from the normal cluster center as the warning value under the current operating state. In this embodiment, the threshold is called the objective threshold. Optionally, on the basis of the objective threshold, the subjective threshold given by expert opinions can also be comprehensively considered, combined with the objective threshold, and a more reasonable warning threshold is obtained by using a proportional weighting method.

[0044] S150: When the monitored voltage is greater than the warning value, a power quality warning is issued.

[0045] When the amplitude of the monitoring voltage is greater than the warning value, it is determined that the monitoring voltage is abnormal.

[0046] Furthermore, for abnormal voltage, its power quality problem type and warning level can be further determined, wherein the power abnormality problem type may include voltage distortion, voltage too low, voltage drop, voltage interruption, harmonics, etc., and the warning level is used to characterize the urgency of the power quality problem. Optionally, a time domain waveform can be formed by the amplitude and phase of the monitoring voltage, and the time domain waveform can be subjected to wavelet transformation to obtain the frequency domain characteristics of the monitoring voltage; the frequency domain characteristics are input into the power quality problem prediction model to obtain the power quality problem type and warning level of the monitoring voltage.

[0047] In a specific implementation, the construction of the power quality problem prediction model may include the following steps:

[0048] Step A: Acquire multiple abnormal samples of electric energy signals, and determine the type of power quality problem and warning level of each abnormal sample.

[0049] Step B: forming an abnormal time domain waveform from the voltage amplitude and phase of each abnormal sample, and performing wavelet transform on each abnormal time domain waveform to obtain the frequency domain characteristics of each abnormal sample.

[0050] Step C, fit the data relationship between the power quality problem type and warning level of each abnormal sample and its frequency domain characteristics, and use the fitted multivariate linear regression model as the power quality problem prediction model. Optionally, first construct a multivariate linear regression model with the frequency domain characteristics of the abnormal power signal as the independent variable and the power quality type and warning level of the abnormal power signal as the dependent variable. At this time, the parameters in the model are pending. Then, substitute the data of each abnormal sample into the multivariate linear regression model, fit the model parameters, and calculate the least squares error of each abnormal sample according to the fitted model, and record the best least squares error. Next, randomly update some abnormal samples according to the whale optimization algorithm: in, Represents the encirclement step length in the whale optimization algorithm, which are all pre-set parameters of the whale optimization algorithm. Recalculate the frequency domain features of the updated abnormal sample set, substitute the new frequency domain features into the current multivariate linear regression model to refit the multivariate linear regression model, recalculate the least squares error, and update the best least squares error; repeat this cycle until the maximum number of iterations is reached. The multivariate linear regression model corresponding to the best least squares error at this time is used as the final power quality problem prediction model.

[0051] S160. When the current operating state changes, obtain multiple new electric energy signal samples under the new current operating state, and re-execute the operations of S120-S160 according to the voltage amplitude and phase of each new electric energy signal sample, dynamically update the warning value, and issue a power quality warning according to the dynamically updated warning value.

[0052] In the case where the current operating state changes, the warning value obtained in S140 is no longer applicable to the new current operating state. At this time, return to S110, obtain multiple new electric energy signal samples under the new current operating state, form a new time domain waveform from the voltage amplitude and phase of each new electric energy signal sample, and perform wavelet transform on each new time domain waveform to obtain the frequency domain characteristics of each new electric energy signal sample; cluster each new frequency domain feature using the K-center point clustering algorithm, and divide the multiple new electric energy signals into two new normal and abnormal categories; use the voltage amplitude of the new normal sample farthest from the new normal clustering center as the new warning value under the new current operating state; in the case where the new current operating state has not changed, when the monitored voltage is greater than the new warning value, issue a power quality warning; in the case where the new current operating state has changed, return to S110 to obtain multiple new electric energy signal samples under the updated current operating state, and re-execute the operations of S120-S160 according to the voltage amplitude and phase of each updated electric energy signal sample. This cycle repeats itself, and the warning value is dynamically updated according to the latest operating status, and power quality warnings are issued based on the dynamically updated warning value.

[0053] In summary, the embodiment of the present invention provides a power quality early warning method, which independently decomposes the power signal in the current operating state through discrete wavelet transform, decomposes and reconstructs the wavelet, thereby extracting the signal feature; and uses the K-center value clustering algorithm to find the alarm threshold in the current operating state, and issues an early warning when the power quality reaches the dynamic threshold, thereby improving the flexibility and practicality of the early warning threshold. In this way, the problem that the fixed threshold in the traditional method is not applicable to all power grid states or all time periods can be avoided. For the same power grid, when the power grid load is small, a smaller threshold will be obtained according to the current load data; when the power grid load is large, a larger threshold will be obtained according to the current load data, realizing the dynamic update of the threshold with the power grid data, and performing dynamic early warning according to the dynamically updated threshold, thereby improving the accuracy of the early warning. At the same time, this embodiment uses whales to optimize power signals, construct a prediction model for the type of power quality problems, and uses the model to further predict the type of abnormal voltage problems, so that monitoring personnel can obtain valuable analysis and solutions for possible power quality problems in advance and in a targeted manner, which is particularly suitable for power quality early warning of highways where the load is random and the alarm threshold is difficult to set.

[0054] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the device includes a processor 60, a memory 61, an input device 62 and an output device 63; the number of processors 60 in the device can be one or more. Figure 2A processor 60 is taken as an example; the processor 60, the memory 61, the input device 62 and the output device 63 in the device can be connected by a bus or other means. Figure 2 The example of connecting through bus is taken in the following.

[0055] The memory 61 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the power quality early warning method in the embodiment of the present invention. The processor 60 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 61, that is, realizing the above-mentioned power quality early warning method.

[0056] The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 61 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 61 may further include a memory remotely arranged relative to the processor 60, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0057] The input device 62 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 63 may include a display device such as a display screen.

[0058] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the power quality early warning method of any embodiment is implemented.

[0059] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0060] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0061] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0062] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A power quality early warning method, characterized in that: include: S110, acquiring a plurality of electric energy signal samples in a current operating state, wherein each electric energy signal sample includes a voltage amplitude and a phase; S120, forming a time domain waveform from the voltage amplitude and phase of each electric energy signal sample, and performing wavelet transform on each time domain waveform to obtain a frequency domain feature of each electric energy signal sample; S130, clustering each frequency domain feature using a K-center point clustering algorithm, and dividing the multiple power signals into two categories: normal and abnormal; S140, taking the voltage amplitude of the normal sample farthest from the normal cluster center as the warning value under the current operating state; S150, when the current operating state does not change and the monitored voltage is greater than the warning value, issuing a power quality warning; S160. When the current operating state changes, obtain multiple new electric energy signal samples under the new current operating state, and re-execute the operations of S120-S160 according to the voltage amplitude and phase of each new electric energy signal sample, dynamically update the warning value, and issue a power quality warning according to the dynamically updated warning value.

2. The method according to claim 1, characterized in that The current operating state is related to at least one of actual weather, user behavior, date, and device usage.

3. The method according to claim 1, characterized in that The voltage amplitude and phase of each electric energy signal sample form a time domain waveform, and each time domain waveform is subjected to wavelet transformation to obtain the frequency domain characteristics of each electric energy signal sample, including: The voltage amplitude and phase in any electric energy signal sample are expanded into a voltage time domain waveform over a period of time; The voltage time domain waveform is subjected to wavelet decomposition and reconstruction to obtain the frequency domain characteristics of the electric energy signal sample.

4. The method according to claim 1, characterized in that: The method of clustering the frequency domain features using the K-center point clustering algorithm to divide the multiple electric energy signals into two categories: normal and abnormal, includes: Let K=2 in the K-center point clustering algorithm, corresponding to the normal class and the abnormal class respectively; according to the set distance threshold, the frequency domain features with similar distances are divided into one class, and a total of L classes are divided, where L is a natural number; Select two frequency domain features as two initial cluster centers, determine the distance from the two initial cluster centers and the class center where the largest frequency domain feature is located as the new abnormal cluster center; use the zero matrix as the new normal cluster center, classify each frequency domain feature according to the two new cluster centers, and calculate the first classification error; Traverse each category of L frequency domain features and perform the following operations in sequence: S1, taking the center of the current class frequency domain feature as another new normal cluster center; reclassifying each frequency domain feature according to the another new normal cluster center and the new abnormal cluster center, and calculating the second classification error; S2. If the second classification error is less than the first classification error, adopt the yet new normal cluster center and classification, and use the second classification error and classification as the new first classification error, and enter the operation of the next type of frequency domain features; otherwise, restore the normal cluster center and classification before the start of the round of operation, and enter the operation of the next type of frequency domain features; The final classification is used as the classification of the multiple electric energy signals.

5. The method according to claim 1, characterized in that When the monitored voltage is greater than the warning value, issuing a power quality warning includes: When the amplitude of the monitoring voltage is greater than the warning value, determining that the monitoring voltage is abnormal; A time domain waveform is formed by the amplitude and phase of the monitoring voltage, and the time domain waveform is subjected to wavelet transformation to obtain a frequency domain feature of the monitoring voltage; The frequency domain characteristics are input into a power quality problem prediction model to obtain the power quality problem type and warning level of the monitored voltage.

6. The method according to claim 5, characterized in that Before inputting the frequency domain features into the power quality problem prediction model to obtain the power quality problem type and warning level of the monitored voltage, the method further includes: Acquire abnormal samples of multiple power signals, and determine the type of power quality problem and warning level of each abnormal sample; The voltage amplitude and phase of each abnormal sample form an abnormal time domain waveform, and each abnormal time domain waveform is subjected to wavelet transformation to obtain the frequency domain characteristics of each abnormal sample; The data relationship between the power quality problem type and warning level of each abnormal sample and its frequency domain characteristics is fitted, and the fitted multivariate linear regression model is used as the power quality problem prediction model.

7. The method according to claim 6, characterized in that The data relationship between the power quality problem type and warning level of each abnormal sample and its frequency domain characteristics is fitted, and the multivariate linear regression model obtained by fitting is used as a power quality problem prediction model, including: A multivariate linear regression model is constructed with the frequency domain characteristics of abnormal power signals as independent variables and the power quality type and warning level of abnormal power signals as dependent variables; Substituting the data of each abnormal sample into the multivariate linear regression model, and calculating the least squares error of each abnormal sample; Randomly update some abnormal samples according to the whale optimization algorithm, and refit the multivariate linear regression model according to the updated abnormal sample set; repeat the cycle until the maximum number of iterations is reached; The model with the best least squares error is selected as the power quality problem prediction model.

8. The method according to claim 1, characterized in that In the K-medoid clustering algorithm, the following formula is used to calculate the distance between each frequency domain feature and each category center: In the formula, represents the i-th dimension of the center of any category, Y i represents the i-th dimension of any frequency domain feature, n represents the dimension of the frequency domain feature, k is a limit variable, and S represents the distance between any frequency domain feature and the center of any category.

9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the power quality early warning method described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the power quality early warning method described in any one of claims 1-8 is implemented.