A power quality disturbance classification method and system based on TLBO algorithm

By optimizing the power quality disturbance classification method of DAG-SVMS based on the TLBO algorithm, the problem of inaccurate power quality classification in the existing technology is solved, and the rapid and accurate classification of power quality disturbances is achieved, improving the classification precision and accuracy.

CN115374823BActive Publication Date: 2026-01-16STATE GRID HUBEI ELECTRIC POWER CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211019496.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2026-01-16
Estimated Expiration
2042-08-24

AI Technical Summary

Technical Problem

Existing power quality classification methods suffer from defects in feature extraction modules and classifiers, leading to inaccurate classification results. The Hilbert-Huang transform suffers from high computational cost and poor real-time performance. Artificial neural networks suffer from local optima and poor convergence. Expert systems have poor fault tolerance and are prone to combinatorial explosion.

Method used

A power quality disturbance classification method based on TLBO algorithm optimization of DAG-SVMS is adopted. Feature quantities are extracted by discrete wavelet transform, a directed acyclic graph support vector machine model is established, and the kernel function parameters of the classifier are optimized by TLBO algorithm to improve classification accuracy.

Benefits of technology

It enables rapid and accurate classification of power quality disturbances, improves classification precision and accuracy, and avoids economic losses caused by power quality problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115374823B_ABST
    Figure CN115374823B_ABST
Patent Text Reader

Abstract

The application discloses a power quality disturbance classification method and system based on a TLBO algorithm, and the method comprises the following steps: S1, a mathematical model of power quality disturbance is established; S2, a discrete wavelet transform method is used to extract characteristic quantities of power quality disturbance signals; S3, a power quality disturbance database is established and divided into training set data and test set data; S4, a power quality disturbance classification model is established; S5, the training set data is input into the classification model for model training; S6, the test set data is input into the classification model for classification; S7, a TLBO algorithm is used to optimize kernel function parameters of the classifier; and S8, the test set data is input into the optimized classification model to obtain a classification result and form a confusion matrix, and the classification accuracy is obtained. The TLBO algorithm is used for optimization, fast classification and improvement of the accuracy of power quality disturbance classification, and economic losses caused by power quality problems on production are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of power quality analysis, and particularly relates to a power quality disturbance classification method and system based on a TLBO algorithm. BACKGROUND

[0002] An ideal power system should supply power to users at a constant frequency (50 Hz) and a sinusoidal waveform, and at a specified voltage level (nominal voltage). Harmonics, voltage surges, voltage sags, voltage interruptions, etc. can all reduce service quality. In recent years, the rapid application of power electronic devices has led to the widespread diffusion of nonlinear, time-varying loads in distribution networks, resulting in a large number of serious power quality problems. At the same time, the widespread use of precision electronic equipment requires extremely high-quality power supplies. In order to ensure power quality, power disturbance detection and classification also become very important in order to further determine the detection location and the disturbance type.

[0003] The current power quality classification method mainly includes two steps of disturbance feature extraction and disturbance identification classification. Commonly used feature value extraction methods include wavelet transform, Hilbert-Huang transform, S transform, mathematical morphology, instantaneous reactive power theory and fractal analysis method, etc. Common classification methods include fuzzy classification method, artificial neural network, Fisher linear classification method, decision tree, support vector machine and expert system, etc.

[0004] Although the combination of feature extraction and classifier in the power quality identification process has good results for disturbance signal classification, there are still the following problems: 1) some inherent defects of the feature extraction module and the classifier also lead to inaccurate classification results, etc.; 2) the Hilbert-Huang transform in the feature extraction stage has end effect and modal aliasing phenomenon, and the large amount of calculation and poor real-time performance are still problems that cannot be ignored for the S transform; 3) in the classifier stage, artificial neural network has the disadvantages of falling into local optimum and poor convergence, and the expert system does not have learning ability, so all the knowledge and solutions are provided by experts in the field, so the fault tolerance is poor, and as the knowledge increases, the expert system is prone to combinatorial explosion. SUMMARY

[0005] In order to solve the above technical problems, the application provides a power quality disturbance classification method and system based on a TLBO algorithm, which optimizes DAG-SVMS through the TLBO algorithm, quickly classifies power quality disturbances, and improves the accuracy of power quality disturbance classification, thereby avoiding economic losses caused by power quality problems to production.

[0006] The application adopts a technical solution:

[0007] A power quality disturbance classification method, comprising the following steps:

[0008] S1, a mathematical model of power quality disturbance is established, and a plurality of power quality disturbance signals are generated by randomly setting a plurality of times within a parameter limited range;

[0009] S2, a plurality of power quality disturbance signals and a normal power quality signal are respectively subjected to feature extraction and normalization processing by using a discrete wavelet transform method;

[0010] S3, the feature values and category label values obtained after normalization processing of the plurality of power quality disturbance signals and the normal power quality signal are used to establish a power quality disturbance database, and then random sampling is performed and the data of the power quality disturbance database is divided into training set data and test set data in proportion;

[0011] S4, a directed acyclic graph support vector machine (DAG-SVMS) power quality disturbance classification model is established;

[0012] S5, the training set data is input into the DAG-SVMS power quality disturbance classification model for model training;

[0013] S6, the test set data is input into the DAG-SVMS power quality disturbance classification model for classification and to obtain the classification accuracy of the test set data;

[0014] S7, according to the classification accuracy of the test set data, the kernel function parameters of the classifier in the DAG-SVMS are optimized by using a TLBO algorithm, and an optimized DAG-SVMS power quality disturbance classification model is obtained;

[0015] S8, the test set data is input into the optimized DAG-SVMS power quality disturbance classification model to obtain a classification prediction result, a confusion matrix is formed according to the classification prediction result, and the classification prediction accuracy of the optimized DAG-SVMs power quality disturbance classification model is obtained;

[0016] The specific process of steps S6 to S7: the TLB0 algorithm continuously optimizes the kernel function parameters of the classifier in the DAG-SVMS, i.e. the highest term number of the polynomial kernel function, through the teaching stage and the learning stage, wherein the teacher acts as the highest term number of the current optimal polynomial kernel function, and the student acts as the highest term number of the polynomial kernel function, and the specific steps are as follows:

[0017] B, teaching stage:

[0018] In this stage, the teacher is the optimal fitness individual, and the students learn from the teacher, and the teacher tries to improve the average score of the students, i.e. to make all the students reach the level of the teacher in knowledge as much as possible.

[0019] Assume that in the ith iteration, there are m decision variables (i.e. m subjects / objectives), the number of students is k (k = 1, 2,..., n), M j,i is the average value of all students in the decision variable j (j = 1, 2,..., m), and the student k best with the optimal objective function value in the current iteration is recorded as k best (teacher), so the average value of all students in each variable (each subject / objective) and the difference between each variable of the teacher is calculated as follows:

[0020] Difference_Mean j,k,i = r i (X j,kbest,i -TFM j,i ) (10)

[0021] where X j,kbest,i is the jth decision variable of the teacher k best in the ith iteration; r i is a random number between [0, 1]; TF is a teaching factor, whose value is a random number between [1, 2]; and M j,i is the average value of all students in the decision variable j (j = 1, 2,..., m).

[0022] In order to make all students reach the level of the teacher in knowledge as much as possible, it is necessary to update the decision variable value of each student, and the update formula is as follows:

[0023] X′ j,k,i = X j,k,i + Difference_Mean j,k,i (11)

[0024] where X j,k,i is the jth decision variable of the student k in the ith iteration; X′ j,k,i is the updated value of X j,k,i , and if the objective function of the student k is better after updating the decision variable, then X′ j,k,i will be accepted, otherwise X j,k,i will remain unchanged.

[0025] At the end of the teaching phase, the updated decision variable value of each student is retained, which will be used as the input of the learning phase.

[0026] B. Learning Phase

[0027] In the learning phase, students improve their knowledge reserve level by communicating with each other. The communication method is random communication, that is, a student randomly communicates with another student, and if the other student has more knowledge reserve than himself, he will learn new knowledge.

[0028] Assuming the number of students is n, randomly select two students P (a random number between 1 and n) and Q (a random number between 1 and n) from the n students, that is, X' total-P,i ≠ X' total-Q,i , wherein X' total-P,i and X' total-Q,i are the target function values of P and Q respectively. total-P,i and X' total-Q,i are the target function values of P and Q respectively. j,P,i and X' j,P,i are the target function values of P and Q respectively. i and X' j,P,i are the target function values of P and Q respectively. j,Q,i and X' total-P,i are the target function values of P and Q respectively. total-Q,i (12)

[0029] If the optimization problem of the present application is a maximization problem, the decision variable update formula is:

[0030] x" j,P,i = x' j,P,i + r i (x' j,P,i - x' j,Q,i ), X' total-P,i > X' total-Q,i (12)

[0031] x" j,P,i = x' j,P,i + r i (x' j,Q,i - x' j,P,i ), X' total-P,i < X' total-Q,i (13)

[0032] If the target function value of student P after updating the decision variable is larger, then accept x" j,P,i ;

[0033] In summary, formula (10), formula (11), formula (12) and formula (13) show that the update of the highest term degree of the polynomial kernel function of the classifier in DAG-SVMS is affected by the highest term degree of the current optimal polynomial kernel function, so that the highest term degree of the polynomial kernel function moves towards the highest term degree of the current optimal polynomial kernel function, and the optimal target function value is found, that is, the highest term degree of the optimal polynomial kernel function.

[0034] Preferably, the generation of the power quality disturbance signal in step S1 is randomly set within a parameter-limited range, and the formula is as follows:

[0035] rand (1, 1) × (parameter maximum value - parameter minimum value) + parameter minimum value (1)

[0036] The power quality disturbance signals include seven single disturbance signals of voltage sag, voltage swell, harmonic, transient impulse, transient oscillation, voltage interruption and voltage fluctuation, and two composite disturbance signals of voltage sag+harmonic and voltage swell+harmonic.

[0037] Preferably, the step S2 is specifically as follows:

[0038] 1) convolve the input power quality disturbance signals and a normal power quality signal with a wavelet filter, then perform binary decimation, and further obtain the approximation coefficients and the detail coefficients of the power quality disturbance signals and the normal power quality signal;

[0039] 2) calculate the information entropy of the approximation coefficients and the detail coefficients of the power quality disturbance signals and the normal power quality signal respectively;

[0040] 3) calculate the total energy of the detail coefficients of a certain power quality disturbance signal according to the energy formula, which is specifically as follows:

[0041]

[0042] wherein, E x is the total energy of the detail coefficients, x(t) is the detail coefficient of the disturbance signal, |x(t)| 2 is the energy spectrum density of the energy signal, E x represents the total energy of the detail coefficients in the time domain with a width of dt at time t;

[0043] 4) calculate the average energy of the detail coefficients of a certain power quality disturbance signal, i.e. average the total energy of the detail coefficients of the power quality disturbance signal;

[0044] 5) calculate the percentage of the energy of the detail coefficients of a certain power quality disturbance signal in the total energy of the power quality disturbance signals, to obtain the energy percentage of the detail coefficients of the power quality disturbance signal;

[0045] 6) obtain the maximum energy percentage of the detail coefficients according to the energy percentages of the detail coefficients of each power quality disturbance signal obtained in steps 3) to 5);

[0046] 7) calculate the total harmonic distortion of the power quality disturbance signals and the normal power quality signal respectively;

[0047] 8) Select the original signal entropy, the entropy of the approximation coefficient, the entropy of the detailed coefficient, the average energy of the detailed coefficient, the maximum energy percentage of the detailed coefficient and the total harmonic distortion of a plurality of power quality disturbance signals and a power quality normal signal as six characteristic quantities, and set the corresponding class label values respectively;

[0048] 9) The six characteristic quantities are normalized to the range of [0, 1], and the normalization formula is as follows:

[0049]

[0050] Wherein, X is the respective value of the six characteristic quantities, X max is the maximum value of the six characteristic quantities, and X min is the minimum value of the six characteristic quantities.

[0051] Preferably, the training set data and test set data in the step S1 are set to 8:2 or 6:4.

[0052] Preferably, the specific process of the step S4 and the step S5 is as follows:

[0053] 1) The power quality disturbance database includes the characteristic quantity values and the class label values obtained after normalization of a plurality of power quality disturbance signals and a power quality normal signal, and the DAG-SVMS constructs a new SVM classifier for the classes of each two power quality disturbance signals: assuming that there are n classes of power quality disturbances, the support vector machine constructs a rooted binary directed acyclic graph, which has internal decision points (binary support vector machine) and n leaves, which are distributed in an n-layer structure, and each node is a binary support vector machine of the i-th class and the j-th class;

[0054] 2) Set the data set of each support vector machine classifier as:

[0055] (x i , y i ), x i ∈R N , y i ∈{+1,-1}, i=1,2,...,l (4)

[0056] Wherein: x i corresponds to each signal vector in the set; y i is the class label value corresponding to the signal vector x i ;

[0057] 3) The training set data is mapped from the low-dimensional space to the high-dimensional space by the nonlinear mapping φ(x), there is a hyperplane to separate the two classes of samples, and the optimal classification hyperplane is constructed as:

[0058] H:f(x)=sign[ω·φ(x)+b] (5)

[0059] Where ω is the weight coefficient vector (normal vector) of the classification hyperplane in the feature space, and b is the bias coefficient.

[0060] 4) According to the interval maximization principle, the optimal classification function can be obtained by solving the constrained optimization problem:

[0061]

[0062] Where ||ω|| is the Euclidean distance, C is the penalty factor of the error term, and ξ is the relaxation factor.

[0063] 5) Introducing the Lagrange coefficient, converting it into a quadratic programming problem for solving, then:

[0064]

[0065] Where K(x i ·x j ) is the kernel function that satisfies the Mercer condition.

[0066] The final optimal classification decision function based on DAG-SVM is:

[0067]

[0068] In order to avoid the high-dimensional data disaster phenomenon in the mapping conversion, the polynomial kernel function is taken as the kernel function:

[0069] K(x i ·x j )=(a(X i T X j )+b) d , a>0 (9)

[0070] In summary, the DAG-SVM is a DAG-SVM based on the polynomial kernel function K(X i , X j )=(X i T X j +b) d and the training mode is "1-v-1".

[0071] In addition, the application also provides a power quality disturbance classification system based on a TLBO algorithm, comprising a microprocessor and a memory connected to each other, the microprocessor being programmed or configured to perform the steps of the aforementioned power quality disturbance classification method based on the TLBO algorithm.

[0072] Further, the application also provides a computer readable storage medium, which stores a computer program for being executed by a microprocessor to implement the steps of the TLBO algorithm-based power quality disturbance classification method.

[0073] The application has the following advantages:

[0074] 1) By using the TLBO algorithm to optimize the highest term number of the multinomial kernel function of the classifier in the DAG-SVMS, the power quality disturbance can be quickly classified, and the accuracy and precision of the power quality disturbance classification are further improved;

[0075] 2) The smoothness of the classification process is ensured by the set classification system;

[0076] 3) The DAG-SVMS optimized by the TLBO algorithm in the application can accurately detect single and multiple power quality disturbance signals and quickly and accurately identify and classify power quality problem categories. BRIEF DESCRIPTION OF DRAWINGS

[0077] Figure 1 is the basic flowchart of the application;

[0078] Figure 2 is the detailed logic flowchart of the application;

[0079] Figure 3 is a simplified topological structure diagram of the DAG-SVMS power quality disturbance classification model of the application;

[0080] Figure 4 is the flowchart of the DAG-SVMS power quality disturbance classification optimized by the TLBO algorithm in the embodiment;

[0081] Figure 5 is the waveform diagram of one normal sinusoidal power quality signal and nine power quality disturbance signals generated in the embodiment;

[0082] Figure 6 is the schematic diagram of the test set data confusion matrix in the embodiment. DETAILED DESCRIPTION

[0083] In order to more clearly illustrate the technical solutions and advantages of the application, the application is described in detail below in combination with specific embodiments and drawings.

[0084] The term "computer readable storage medium" should be understood to include a single medium or multiple media that store one or more sets of instructions; it should also be understood to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by a processor and causing the processor to perform any one of the methods in the application.

[0085] Embodiment

[0086] As Figures 1 to 6 shown, a power quality disturbance classification method based on TLBO algorithm includes the following steps:

[0087] S1, according to the definition of domestic standard of power quality, the mathematical model of power quality disturbance is established, which includes seven single power quality disturbance mathematical models of voltage sag, voltage swell, voltage interruption, harmonic, transient impulse, transient oscillation, voltage flicker and two composite power quality disturbance mathematical models of harmonic + voltage sag and harmonic + voltage swell:

[0088]

[0089] Table 1 power quality disturbance mathematical model

[0090]

[0091]

[0092] Because the power quality disturbance signal is constantly changing in actual situation, according to formula (1):

[0093] rand(1,1)×(parameter maximum value-parameter minimum value))+parameter minimum value

[0094] Randomly set each power quality disturbance signal within the range of parameters to generate 9 kinds of power quality disturbance signals and 1 kind of normal power quality sinusoidal signal.

[0095] S2, one-dimensional discrete wavelet transform method is used to extract the characteristic quantity of the above 9 kinds of power quality disturbance signals and 1 kind of normal power quality sinusoidal signal respectively and to carry out normalization processing;

[0096] Specifically as follows: 1) convolve 9 kinds of power quality disturbance signals and 1 kind of normal power quality sinusoidal signal with wavelet filter, then perform binary decimation, and then obtain the approximate coefficient and detailed coefficient of each input signal respectively;

[0097] 2) calculate the information entropy through the approximate coefficient and detailed coefficient of each input signal respectively;

[0098] 3) then calculate the corresponding detailed coefficient total energy of a certain power quality disturbance signal according to the energy formula, and the energy formula is as follows:

[0099]

[0100] Among them, E x ​E(t) is the energy spectrum density of the energy signal, E 2 E(t) is the energy spectrum density of the energy signal, E x E(t) is the energy spectrum density of the energy signal, E

[0101] 4) Calculate the average energy of the detailed coefficients of a certain power quality disturbance signal according to the total energy of the detailed coefficients of the power quality disturbance signal, i.e. take the average of the total energy of the detailed coefficients of a certain power quality disturbance signal;

[0102] 5) Calculate the percentage of the detailed coefficient energy of a certain power quality disturbance signal in the total energy of multiple power quality disturbance signals according to the total energy of the detailed coefficients of a certain power quality disturbance signal, and obtain the detailed coefficient energy percentage of a certain power quality disturbance signal;

[0103] 6) Obtain the detailed coefficient energy percentage of each power quality disturbance signal according to the detailed coefficient energy percentage of each power quality disturbance signal obtained in steps 3) to 5), and take the maximum value as the maximum energy percentage of the detailed coefficients;

[0104] 7) Calculate the total harmonic distortion of 9 kinds of power quality disturbance signals and 1 kind of normal power quality signal respectively;

[0105] 8) Select the original signal entropy, the entropy of the approximate coefficients, the entropy of the detailed coefficients, the average energy of the detailed coefficients, the maximum energy percentage of the detailed coefficients, and the total harmonic distortion of 9 kinds of power quality disturbance signals and 1 kind of normal power quality signal as six characteristic quantities, and set the corresponding class label values respectively;

[0106] 9) Normalize the six characteristic quantities to the range of [0, 1], and the normalization formula is as follows:

[0107]

[0108] where X is the respective value of the six characteristic quantities, X max is the maximum value of the six characteristic quantities, and X min is the minimum value of the six characteristic quantities.

[0109] S3, the characteristic quantity values and class label values obtained after normalization of 9 kinds of power quality disturbance signals and 1 kind of normal power quality signal are used to establish a power quality disturbance database, then random sampling is performed and the data of the power quality disturbance database is divided into training set data and test set data according to the ratio of 8:2;

[0110] S4, a directed acyclic graph support vector machine (DAG-SVMS) power quality disturbance classification model is established;

[0111] S5, input the training set data into the DAG-SVMS power quality disturbance classification model for model training;

[0112] The specific process of steps S4 and S5 is as follows:

[0113] 1) The power quality disturbance database includes the characteristic values and category label values of 9 kinds of power quality disturbance signals and 1 kind of normal power quality signal after normalization processing, and DAG-SVMS constructs a new SVM classifier for the categories of each two power quality disturbance signals: assuming that there are n kinds of power quality disturbances, the support vector machine constructs a rooted binary directed acyclic graph, which has internal decision points (binary support vector machine) and n leaves, distributed in an n-layer structure, and each node is a binary support vector machine of the i-th and j-th categories; in this embodiment, 45 binary support vector machines need to be constructed;

[0114] 2) Set the data set of each support vector machine classifier as:

[0115] (x i , y i ), x i ∈R N ,y i ∈{+1,-1},i=1,2,...,l (4)

[0116] wherein x i corresponds to each signal vector in the set; y i is the category label value corresponding to the signal vector x i ;

[0117] 3) The training set data is mapped from the low-dimensional space to the high-dimensional space by the nonlinear mapping φ(x), and there is a hyperplane to separate the two classes of samples, and the optimal classification hyperplane is constructed as:

[0118] H:f(x)=sign[ω·φ(x)+b] (5)

[0119] wherein ω is the weight coefficient vector (normal vector) of the classification hyperplane in the feature space; b is the bias coefficient;

[0120] 4) According to the maximum margin principle, the best classification function can be obtained by solving the constrained optimization problem:

[0121]

[0122] wherein ||ω|| is the Euclidean distance; C is the penalty factor of the error term; ξ is the relaxation factor;

[0123] 5) Introducing the Lagrange coefficient, converting it into a quadratic programming problem for solving, then:

[0124]

[0125] Where K(x) i ·x j () is the kernel function that satisfies the Mercer condition;

[0126] The final optimal classification decision function based on the directed acyclic graph support vector machine is:

[0127]

[0128] To avoid the curse of high-dimensional data during mapping transformation, a polynomial kernel function is used:

[0129] K(x i ·x j )=(a(X i T X j )+b) d ,a>0 (9)

[0130] In summary, the DAG-SVMs described above are based on a kernel function K(X). i X j )=(X i T X j +b) d A polynomial kernel function and a DAG-SVM trained in a "1-v-1" manner.

[0131] S6. Input the above test set data into the DAG-SVMS power quality disturbance classification model for classification and obtain the classification accuracy of the test set data;

[0132] like Figure 3 The diagram shown represents a simplified topology of the DAG-SVMS power quality disturbance classification model. During the testing phase, all trained and optimized binary classifiers are assembled using a directed acyclic graph (DAG) model to classify the test set data.

[0133] For space and simplicity, only a topology diagram of five-class DAG-SVMs is shown: the top layer contains only 1 node, called the root node, the second layer contains 2 nodes, and so on, the i-th layer contains i nodes, and the lowest layer contains n leaf nodes (i.e., n classes), where the i-th node of the j-th layer points to the i-th and i+1-th nodes of the (j+1)-th layer.

[0134] Given a test set of data X, starting from the root node, compute the root decision function value to classify categories 1 through 5:

[0135]

[0136] Then according to the sample classification result, the sample is moved to the left or right binary support vector machine classifier, and other decision nodes also follow the same calculation process, the decision function value of each node is calculated, if it is 1, it enters the next node from the left, if it is -1, it enters the next node from the right, then the value of the next node is calculated, and so on, the output at the last layer leaf node indicates the category to which X belongs.

[0137] S7, according to the classification accuracy of the test set data, the kernel function parameters of the classifier in the DAG-SVMS are optimized by using the TLBO algorithm, and an optimized DAG-SVMS power quality disturbance classification model is obtained;

[0138] Specifically, the specific process of steps S6 to S7 is that the TLB0 algorithm continuously optimizes the kernel function parameters of the classifier in the DAG-SVMS, that is, the highest term number of the polynomial kernel function, through the teaching stage and the learning stage, wherein the teacher acts as the highest term number of the current optimal polynomial kernel function, and the student acts as the highest term number of the polynomial kernel function, and the specific steps are as follows:

[0139] A, teaching stage:

[0140] In this stage, the teacher is the optimal fitness individual, the students learn from the teacher, and the teacher strives to improve the average score of the students, that is, the students try to reach the teacher's level in knowledge as much as possible.

[0141] Assume that in the ith iteration, there are m decision variables (i.e. m subjects / targets), the number of students is k (k = 1, 2,..., n), M j,i is the average value of all students in the decision variable j (j = 1, 2,..., m), and the student k best with the optimal objective function value in the current iteration number is recorded as k best (student k i is regarded as the teacher), so the average value of all students in each variable (each subject / target) and the difference of each variable of the teacher is calculated as follows:

[0142] Difference_Mean j,k,i =r i (X j,kbestt,i -TFM j,i ) (10)

[0143] Where, X j,kbest,i is the jth decision variable of the teacher k best in the ith iteration; r i is a random number between 0 and 1; TF is a teaching factor, and its value is a random number between 1 and 2; Mj,i The average value of the decision variable j (j=1, 2,..., m) of all students.

[0144] In order to make all students reach the level of the teacher in knowledge as far as possible, it is necessary to update the value of the decision variable of each student, and the updating formula is as follows:

[0145] X′ j,k,i =X j,k,i +Difference_Mean j,k,i (11)

[0146] Wherein, X j,k,i is the jth decision variable of the student k in the ith iteration; X′ j,k,i is the updated value of X j,k,i , if the student k is in the decision variable updated objective function is better, then X′ j,k,i will be accepted, otherwise X j,k,i will remain unchanged.

[0147] In the last teaching stage, the updated value of the decision variable of each student is reserved, which will be used as the input of the learning stage.

[0148] B, learning stage

[0149] In the learning stage, students improve the level of knowledge reserve through mutual communication. The communication mode is random communication, that is, a student randomly communicates with another student, and if the other student's knowledge reserve is richer than his own, he will learn new knowledge.

[0150] Suppose the number of students is n, two students P (a random number between 1 and n) and Q (a random number between 1 and n) with different objective function values are randomly selected from the n students, that is, X′ total-P,i ≠X′ total-Q,i , wherein X′ total-P,i and X′ total-Q,i are X″ total-P,i and X″ total-Q,i updated in the teaching stage.

[0151] If the optimization problem of the present application is a maximization problem, the updating formula of the decision variable is as follows:

[0152] x″ j,P,i =x′ j,P,i +r i (x′ j,P,i -x′ j,Q,i ),X′ total-P,i >X′ total-Q,i (12)

[0153] x″ j,P,i=x' j,P,i +r i (x' j,Q,i -x' j,P,i ), X' total-P,i <X' total-Q,i (13)

[0154] If the student P updates the decision variable, the target function value is larger, and x" is accepted j,P,i .

[0155] In the present application, the decision variable is 1, the classification accuracy obtained by inputting the test set data into the DAG-SVMs is taken as the target function, and the optimal student individual finally found is taken as the highest order of the polynomial kernel function.

[0156] In summary, the formulas (10), (11), (12) and (13) show that the update of the highest order of the polynomial kernel function of the classifier in the DAG-SVMs is affected by the highest order of the current optimal polynomial kernel function, so that the highest order of the polynomial kernel function moves towards the highest order of the current optimal polynomial kernel function, and the optimal target function value is found, that is, the highest order of the optimal polynomial kernel function.

[0157] As shown in the flowchart of the algorithm for classifying power quality disturbances by the DAG-SVMs optimized by the TLBO algorithm, the algorithm comprises the following steps: Figure 4

[0158] 1. Initialization of population: initialize the related parameters of the teaching and learning optimization algorithm;

[0159] 2. Input the test set data into the DAG-SVMs for classification, and take the obtained classification accuracy as the target function;

[0160] 3. Initialize the population according to the population size and the decision variable, and calculate the fitness value;

[0161] 4. Enter the teaching stage, and the students improve their knowledge level with the help of the teachers; select the optimal individual therefrom as the teacher individual, and the mathematical expression is

[0162] 5. Perform the learning stage, and the students improve their knowledge through their own efforts and mutual help, and the mathematical expression is:

[0163]

[0164] 6. If the algorithm does not meet the termination condition, go to 3; otherwise, output the best student individual as the highest order of the polynomial kernel function of the DAG-SVMs, and end the algorithm.

[0165] ​S8, input the test set data into the optimized DAG-SVMs power quality disturbance classification model and obtain a classification prediction result, form a confusion matrix according to the classification prediction result, and obtain the optimized DAG-SVMs

[0166] Classification prediction accuracy of the power quality disturbance classification model:

[0167] As shown in the figure, the specific steps are as follows: Figure 5

[0168] ① The test set data includes 9 kinds of power quality disturbance signals and 1 kind of normal power quality sinusoidal signal, a total of 10 kinds of power quality signals, and DAG-SVMs constructs a new SVM classifier for each two signal categories;

[0169] ② A binary classification model is constructed based on the 1st test set data and the 10th test set data, if the model output result is 1, it proves that the characteristic value in the test set data exists in the 2nd to 10th samples; if the model output result is -1, it proves that the characteristic value in the test set data exists in the 1st to 9th samples;

[0170] ③ If the model output result of ② is 1, enter the 2nd classification cycle (left into the next node), construct another binary classification model based on the 2nd test set data and the 10th test set data, if the output result is still 1, it proves that the characteristic value in the sample data exists in the 3rd to 10th samples, if the output result is -1, it proves that the characteristic value in the sample data exists in the 2nd to 9th samples;

[0171] ④ If the model output result of ② is -1, enter the 2nd classification cycle (right into the next node), construct another binary classification model based on the 1st test set data and the 9th test set data, if the output result is still 1, it proves that the characteristic value in the sample data exists in the 2nd to 9th samples, if the output result is -1, it proves that the characteristic value in the sample data exists in the 1st to 8th samples;

[0172] ⑤ Continue to construct the classifier in this way, and the last one left is the category to which the sample belongs, and the classification accuracy is calculated according to the classification result of the final test set data:

[0173]

[0174] The power quality disturbance signals are classified by using the directed acyclic graph support vector machine, the 1-v-1 training mode support vector machine, the 1-v-rest training mode support vector machine and the directed acyclic graph support vector machine optimized by the TLBO algorithm in the application, and the classification accuracy of each is calculated and recorded, and the results are shown in Tables 2-5: ​

[0175] Table 2 DAG-SVM

[0176]

[0177] Table 3 1-v-1 training mode SVM

[0178] Table 4 1-v-rest training mode SVM

[0179]

[0180]

[0181] Table 5 DAG-SVM optimized by TLBO algorithm

[0182]

[0183] As shown in Tables 2-5, the classification accuracies of the DAG-SVM, the 1-v-1 training mode SVM, the 1-v-rest training mode SVM and the DAG-SVM optimized by the TLBO algorithm for the power quality disturbance signals are 96.67%, 93.33%, 98.89% and 99.11% respectively, indicating that the power quality disturbance classification method based on the TLBO algorithm optimized DAG-SVM can improve the classification accuracy of the power quality disturbance.

[0184] The working principle of the present application is as follows: according to the domestic standard definition of power quality, a mathematical model of power quality disturbance is established, 9 kinds of power quality disturbance signals and 1 kind of normal power quality sinusoidal signal are generated; then the discrete wavelet transform method is used to extract relevant features, the extracted feature values and category label values are used to establish a power quality database, random sampling is performed to divide the training set data and the test set data in proportion; the training set data is input into the DAG-SVM classifier for model training, the TLBO algorithm is used to optimize the kernel function parameters of the power quality disturbance classification model of the DAG-SVM, i.e. the highest term number of the multinomial kernel function; after the parameters are optimized, the test set data is substituted into the optimized power quality disturbance classification model of the DAG-SVM for classification, and the final classification accuracy is obtained.

[0185] In addition, the present application also provides a power quality disturbance classification system based on the TLBO algorithm, which comprises a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to perform the steps of the aforementioned power quality disturbance classification method based on the TLBO algorithm.

[0186] In addition, the embodiment further provides a computer readable storage medium, and the computer readable storage medium stores a computer program.

[0187] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer readable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer usable program code. The present application is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, a special purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions, which are executed via the processor of the computer or other programmable data processing apparatus, generate a means for implementing the functions specified in the flowcharts and / or block diagrams of the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 one or more flows and / or blocks

[0188] The above description is only the preferred embodiments of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical solutions falling within the concept of the present application shall be considered as falling within the protection scope of the present application. It should be noted that, for ordinary skilled in the art, some improvements and refinements without departing from the principles of the present application shall also be considered as falling within the protection scope of the present application.

Claims

1. A method for power quality disturbance classification based on TLBO algorithm, characterized in that, It comprises the following steps: S1, a mathematical model of power quality disturbance is established, and a plurality of power quality disturbance signals are generated by randomly setting multiple times within the range of parameter limits; S2, the discrete wavelet transform method is used to extract feature values from a plurality of power quality disturbance signals and a normal power quality signal, and the feature values are normalized; S3, the feature values and category label values obtained after the normalization of the plurality of power quality disturbance signals and the normal power quality signal are used to establish a power quality disturbance database, then the data of the power quality disturbance database are randomly sampled and divided into training set data and test set data according to a proportion; S4, a directed acyclic graph support vector machine (DAG-SVMS) power quality disturbance classification model is established; S5, the training set data is input into the DAG-SVMS power quality disturbance classification model for model training; S6, the test set data is input into the DAG-SVMS power quality disturbance classification model for classification and to obtain the classification accuracy of the test set data; S7, the kernel function parameters of the classifier in the DAG-SVMS are optimized by using the TLBO algorithm according to the classification accuracy of the test set data, and an optimized DAG-SVMS power quality disturbance classification model is obtained; S8, the test set data is input into the optimized DAG-SVMS power quality disturbance classification model to obtain a classification prediction result, a confusion matrix is formed according to the classification prediction result, and the classification prediction accuracy of the optimized DAG-SVMs power quality disturbance classification model is obtained; The specific process of steps S6 to S7 is that the TLB0 algorithm continuously optimizes the kernel function parameters of the classifier in the DAG-SVMS, i.e. the highest term number of the polynomial kernel function, through the teaching stage and the learning stage, wherein the teacher acts as the highest term number of the optimal polynomial kernel function, and the student acts as the highest term number of the polynomial kernel function, and the specific steps are as follows: A, teaching stage: In this stage, the teacher is the optimal fitness individual, and the students learn from the teacher, and the teacher tries to improve the average score of the students, i.e. to make all the students reach the teacher's level in knowledge as much as possible; Assume that in the i-th iteration, there are m decision variables (i.e. m subjects / objectives), the number of students is k (k = 1, 2,..., n), M j,i is the average value of all students in the j-th decision variable (j = 1, 2,..., m), and the student k best with the optimal objective function value in the current iteration is recorded as k best (student k best is regarded as the teacher), so the average value of all students in each variable (each subject / objective) and the difference value of each variable of the teacher are calculated as follows: Difference_Mean j,k,i = r i (X j,kbest,i -TFM j,i ) (10) where X j,kbest,i is the teacher k best is the jth decision variable in the ith iteration; r i is a random number between 0 and 1; TF is a teaching factor, which is a random number between 1 and 2; M j,i is the average of all students in the decision variable j (j = 1, 2,..., m). In order to make all the students reach the teacher's level in knowledge as much as possible, it is necessary to update the decision variable value of each student, and the update formula is as follows: X′ j,k,i = X j,k,i + Difference_Mean j,k,i (11) Among them, X j,k,i Let X′ be the j-th decision variable for student k in the i-th iteration. j,k,i For X j,k,i If the updated value of X′ is better for student k in the objective function after the decision variable update, then X′ j,k,i Only then will it be accepted, otherwise X j,k,i It will remain unchanged; At the end of the teaching stage, the updated decision variable value of each student is retained, which will be used as the input of the learning stage. B, learning stage In the learning stage, the students improve their knowledge reserve level through mutual communication. The communication mode is random communication, i.e. a student randomly communicates with another student, and if the other student has more knowledge reserve than himself, he will learn new knowledge; Assuming there are n students, we randomly select two students, P (a random number between 1 and n) and Q (a random number between 1 and n), from these n students, whose objective function values ​​are different, i.e., X′. total-P,i ≠X′ total-Q,i , where X′ total-P,i and X′ total-Q,i They are X'' total-P,i and X'' total-Q,i The updated objective function value during the teacher phase; Since the optimization problem of the present application is a maximization problem, the decision variable update formula is as follows: x" j,P,i = x' j,P,i + r i (x' j,P,i - x' j,Q,i ), x' total-P,i > x' total-Q,i (12) x" j,P,i = x' j,P,i + r i (x' j,Q,i - x' j,P,i ), x' total-P,i < x' total-Q,i (13) If the student P updates the decision variable, the objective function value is greater, accept x" j,P,i ; In summary, the formula (10), formula (11), formula (12) and formula (13) show that the update of the highest degree of polynomial kernel function of the classifier in DAG-SVMS is affected by the highest degree of the current optimal polynomial kernel function, so that the highest degree of the polynomial kernel function moves towards the highest degree of the current optimal polynomial kernel function, and the optimal highest degree of the polynomial kernel function is found.

2. The TLBO algorithm based power quality disturbance classification method according to claim 1, wherein, The generation of the power quality disturbance signal in the step S1 is randomly set within the range of the parameters, and the formula is as follows: rand(1,1)×(parameter maximum value-parameter minimum value)+parameter minimum value (1) The power quality disturbance signal includes seven single disturbance signals of voltage sag, voltage swell, harmonic, transient impulse, transient oscillation, voltage interruption and voltage fluctuation, and two composite disturbance signals of voltage sag+harmonic and voltage swell+harmonic.

3. The TLBO algorithm based power quality disturbance classification method as claimed in claim 1 wherein, The specific process of the step S2 is as follows: 1) convolve the input multiple power quality disturbance signals and one power quality normal signal with the wavelet filter, then perform binary decimation, and then obtain the approximation coefficients and detailed coefficients of the multiple power quality disturbance signals and one power quality normal signal respectively; 2) calculate the information entropy through the approximation coefficients and detailed coefficients of the multiple power quality disturbance signals and one power quality normal signal respectively; 3) calculate the corresponding detailed coefficient total energy of a certain power quality disturbance signal according to the energy formula, and the energy formula is as follows: where E x is the total energy of the detail coefficients, x(t) is the detail coefficient of the perturbation signal, |x(t)| 2 is the energy spectrum density of the energy signal, E x is expressed as the total energy of the detail coefficients in the time domain with a width of dt at time t; 4) calculate the average energy of the detailed coefficients of a certain power quality disturbance signal, that is, calculate the average value of the detailed coefficient total energy of a certain power quality disturbance signal; 5) calculate the detailed coefficient energy percentage of a certain power quality disturbance signal according to the detailed coefficient total energy of a certain power quality disturbance signal, which is the percentage of the detailed coefficient energy of a certain power quality disturbance signal in the total energy of the multiple power quality disturbance signals; 6) take the maximum value of the detailed coefficient energy percentage of each power quality disturbance signal obtained in steps 3) to 5) as the maximum energy percentage of the detailed coefficients; 7) calculate the total harmonic distortion of the multiple power quality disturbance signals and one power quality normal signal; 8) select the original signal entropy, the entropy of the approximation coefficients, the entropy of the detailed coefficients, the average energy of the detailed coefficients, the maximum energy percentage of the detailed coefficients and the total harmonic distortion of the multiple power quality disturbance signals and one power quality normal signal as six feature quantities, and set the corresponding class label values respectively; 9) normalize the six feature quantities to the range of [0, 1], and the normalization formula is as follows: where X is the respective value of each of the six characteristics, X max is the maximum value of the six characteristics, X min is the minimum value of the six characteristics.

4. The TLBO algorithm based power quality disturbance classification method as claimed in claim 1 wherein, The ratio of the training set data and the test set data in the step S1 is set to 8:2 or 6:

4.

5. The TLBO algorithm based power quality disturbance classification method as claimed in claim 1 wherein, The specific process of the step S4 and the step S5 is as follows: 1) The power quality disturbance database includes a variety of power quality disturbance signals and the characteristic values and category label values obtained after normalization processing of a power quality normal signal, and the DAG-SVMS constructs a new SVM classifier for the categories of each two power quality disturbance signals: assuming that there are n categories of power quality disturbances, the support vector machine constructs a rooted binary directed acyclic graph, which has an internal decision point (a binary support vector machine) and n leaves, which are distributed in an n-layer structure, and each node is a binary support vector machine of the i-th category and the j-th category; 2) set the data set of each support vector machine classifier as: (x i , y i ), x i ∈ R N , y i ∈ {+1,-1}, i = 1,2,...,l (4) where: x i each signal vector in the corresponding set; y i is the signal vector x i the corresponding class label value; 3) the training set data is mapped from the low-dimensional space to the high-dimensional space by the nonlinear mapping φ(x), and there is a hyperplane to separate the two classes of samples, and the optimal classification hyperplane is constructed as: H: f(x) = sign[ω·φ(x) + b] (5) where ω is the weight coefficient vector (normal vector) of the classification hyperplane in the feature space; b is the bias coefficient; 4) According to the principle of interval maximization, the optimal classification function can be obtained by solving the constrained optimization problem: where ||ω|| is the Euclidean distance; C is the penalty factor of the error term; ξ is the relaxation factor; 5) Introducing the Lagrange coefficient, converting it into a quadratic programming problem for solving, then: where K(x i ·x j ) is a kernel function satisfying Mercer's condition. The final optimal classification decision function based on the directed acyclic graph support vector machine is: In order to avoid the high-dimensional data disaster phenomenon in the mapping conversion, the polynomial kernel function is taken as the kernel function: K(x i ·x j ) = (a(X i T X j )+ b) d , a > 0 (9) In summary, the DAG-SVMs are DAG-SVMs based on a polynomial kernel function K(X i , X j ) = (X i T X j + b) d and trained in "1-v-1" fashion.

6. A power quality disturbance classification system based on TLBO algorithm comprising of microprocessor and memory connected to each other characterized in that, The microprocessor is programmed or configured to perform the steps of the power quality disturbance classification method based on the TLBO algorithm in any one of claims 1-5.

7. A computer-readable storage medium having stored therein a computer program, characterized in that, The computer program is used by the microprocessor to perform the steps of the power quality disturbance classification method based on the TLBO algorithm in any one of claims 1-5.