Power grid safety and stability control system defect identification method, device and equipment based on PSO-HMM

By combining the particle swarm optimization algorithm and the hidden Markov model, a method for identifying defects in the power grid security and stability control system is established, which solves the problems of low recognition efficiency and low accuracy in the existing technology and realizes real-time and accurate identification of defects in the power grid security and stability control system.

CN120804626APending Publication Date: 2025-10-17GUO JIA DIAN WANG YOU XIAN GONG SI XI NAN FEN BU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510910480.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively identify defects in power grid security and stability control systems. They mainly rely on manual judgment, which is inefficient and inaccurate. In addition, existing methods are difficult to apply to complex security and stability control systems.

Method used

A method based on particle swarm optimization algorithm and hidden Markov model (PSO-HMM) is adopted to collect and preprocess the defect feature vectors of the safety and stability control system, and a defect recognition library is established by clustering and training the hidden Markov model to achieve real-time identification of defects in the power grid safety and stability control system.

Benefits of technology

It achieves accurate identification of defects in the power grid safety and stability control system, improves identification efficiency and real-time performance, and meets the rapid diagnosis needs of power grid monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804626A_ABST
    Figure CN120804626A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power system safety guarantee and control, in particular to a power grid safety and stability control system defect identification method, device and equipment based on PSO-HMM (Particle Swarm Optimization-Hidden Markov Model). Multi-dimensional features are constructed for different defect working condition data to form defect feature vectors, so that the completeness of defect characterization is ensured; clustering processing is adopted to carry out dimension reduction optimization on the preprocessed defect feature vectors, and the quality of mining of the corresponding relation between the defect features and the defect working conditions is improved; hidden Markov model parameters are optimized through global search capability of a particle swarm optimization algorithm, so that the model has time sequence mode mining capability and dynamic adaptability, and the optimized hidden Markov model is trained aiming at different defect working conditions and is used for collecting defect feature vectors to be diagnosed for matching, so that the diagnosis accuracy is improved. The rapid diagnosis of defect working conditions is realized, and the real-time and effective identification of the defects of the power grid safety and stability control system is better realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of power system security and control technology, in particular to a power grid security and stability control system defect identification method, device and equipment based on PSO-HMM. BACKGROUND

[0002] With the accelerated energy transformation in China, the scale of cross-regional long-distance power transmission continues to grow, and new energy such as wind power and photovoltaic power is continuously connected, which has gradually formed an AC-DC hybrid power grid pattern, and the requirements for safe operation of the power grid have reached an unprecedented height. The power grid security and stability control system can maintain system stability, avoid accident expansion and prevent system collapse through automatic load shedding, automatic rapid control, low-frequency low-voltage load shedding and other measures, and is an important support for the safe operation of the power grid.

[0003] However, the current defect identification of the security and stability control system mainly relies on the experience and knowledge of the operating personnel to make judgments. Due to the low efficiency and low accuracy of manual processing, the reliability of the security and stability control system and the safety and stability of the power grid are seriously threatened. Existing research mainly focuses on defect phenomenon analysis and defect module division, and lacks quantitative security and stability control defect identification. There have been many studies on defect identification of power equipment, mainly including mathematical model analysis, signal processing and expert system methods. Mathematical model analysis obtains fault information through mathematical models to achieve defect identification, but the structure of the security and stability control device is complex and interconnected, making it difficult to establish a single mathematical model. The signal processing method identifies defects by analyzing the characteristics of the device fault signals, but the security and stability control system has multiple state signals and mutual interference. The expert system method establishes an association rule between the alarm information and the defects in the historical defect database to achieve defect identification, but the security and stability control system has less historical defect data and complex device logic functions, making it difficult to establish an association rule.

[0004] In addition, existing defect identification methods are mainly aimed at primary equipment, and the composition and operation principle of the security and stability control system are different from those of primary equipment. The defect identification method for primary equipment cannot be directly applied to the security and stability control system. Existing defect identification methods for secondary equipment such as relay protection mainly focus on single components or devices and concentrate on device defect identification, without fully considering the correlation between devices, making it difficult to apply to the security and stability control system. The security and stability control system has a complex structure and complex coupling relationships between devices, making it difficult to mine defect features.

[0005] Therefore, it is urgent to seek new defect identification technology for the security and stability control system of the power grid, which can combine the unique characteristics of the security and stability control system itself, establish a perfect defect identification model for the security and stability control system, and realize real-time and effective identification of defects in the security and stability control system of the power grid. SUMMARY

[0006] In order to solve the above technical problems, the application adopts the following technical solutions:

[0007] In order to solve the above technical problems, the application adopts the following technical solutions:

[0008] In the first aspect, the application provides a power grid safety and stability control system defect identification method based on PSO-HMM, comprising the following steps:

[0009] S101, collecting defect feature vectors of different defect conditions in the communication link, measurement link, setting value link and strategy link of the safety and stability control system;

[0010] S102, preprocessing the collected defect feature vectors of different defect conditions;

[0011] S103, clustering the preprocessed defect feature vectors of different defect conditions to establish observation feature vectors of different defect conditions;

[0012] S104, training the hidden Markov model using the particle swarm optimization algorithm and the observation feature vectors of different conditions to obtain the trained hidden Markov model of different defect conditions as a safety and stability control system defect identification library;

[0013] S105, using the trained hidden Markov model of different defect conditions to identify the defect feature vectors collected in real-time operation of the safety and stability control system to be diagnosed, and outputting the defect condition identification result of the safety and stability control system.

[0014] As a preferred solution, in step S101, the defect conditions of the safety and stability control system include normal condition, communication abnormality, sampling abnormality, setting value overrun and operation strategy mismatch;

[0015] The defect feature vectors of the safety and stability control system are composed of multiple defect feature components, and the defect feature components include synchronization time difference, whole group action time, device temperature, device humidity, frequency measurement error, switch value collection accuracy, DC loop power and AC loop power.

[0016] As a preferred solution, in step S102, each defect feature vector of the safety and stability control system is preprocessed according to the following method:

[0017]

[0018] In the formula, x' i,jRepresents the collected i-th defect feature vector x i The j-th defect characteristic component x in i,j The normalized preprocessing result value, x i ={x i,1 ,x i,2 ,…,x i,j ,…,x i,n}, n represents the number of types of defect feature components contained in the defect feature vector; x j,min 、x j,max They represent the lower limit and upper limit of the j-th defect characteristic component respectively; the i-th defect characteristic vector after preprocessing is represented as x′ i , and x′ i ={x′ i,1 ,x′ i,2 ,…,x′ i,j ,…,x′ i,n}.

[0019] As a preferred solution, in step S103, the observation feature vector corresponding to the defect feature vector is established as follows:

[0020] The K-means clustering algorithm is used to cluster the defect feature components in the defect feature vectors of different defect conditions after preprocessing. After clustering, the defect feature components in each defect feature vector are recombined and arranged according to the preset cluster arrangement order to obtain the observation feature vector corresponding to the defect feature vector;

[0021] The clustering objective function of the K-means clustering algorithm is:

[0022]

[0023] Where x′ i,j Represents the i-th defect feature vector x′ after processing i The j-th defect characteristic component in μ k represents the cluster center of the kth cluster, M k represents the set of defect feature components belonging to the kth cluster, k = 1, 2, ..., K, K represents the number of clusters; Represents the trap feature component x′ belonging to the kth cluster i,j To the cluster center μ of this cluster k The sum of the Euclidean distances;

[0024] The specific method of clustering the defect feature components in the preprocessed defect feature vector using the K-means clustering algorithm is as follows:

[0025] S1031. Initialize the cluster centers of K clusters, marked as {μ1,μ2,…,μk ,…,μ K};

[0026] S1032. For all defect feature components in the defect feature vectors of different defect conditions after preprocessing, calculate the Euclidean distance between each feature component and each cluster center; wherein, any i-th defect feature vector x′ after preprocessing i The j-th defect characteristic component x′ in i,j and the cluster center μ of the kth cluster k The Euclidean distance d ijk The calculation formula is d ijk =||x′ i,j -μ k ||;

[0027] S1033: For any pre-processed defect feature component x′ i,j , compare the Euclidean distance values ​​with each cluster center, and use the Euclidean distance d ijk The cluster with the smallest value is marked as the defect feature component x′ i,j The cluster to which it belongs; thus, the characteristic components x′ of each defect are determined respectively i,j The cluster to which it belongs, determines the set M of defect feature components of each cluster k , k=1,2,…,K;

[0028] S1034. Update the cluster centers of the K clusters according to the following formula:

[0029]

[0030] Among them, |M k | represents the set M of defect feature components of the kth cluster k The number of defect characteristic components contained in ;

[0031] Then, each cluster center μ is judged separately k Whether there is any change between the updated and the updated centers; if the cluster centers of all K clusters do not change after the update, then execute step S1035; if the cluster center of any cluster changes after the update, then return to execute step S1032;

[0032] S1035: Output the division results of K clusters as the clustering result;

[0033] Then, for any preprocessed defect feature vector x′ i ={x′ i,1 ,x′ i,2 ,…,x′ i,j ,…,x′ i,n}, and rearrange the defect feature components according to the preset cluster arrangement order to obtain the defect feature vector x′ i Corresponding observation feature vectors; in this way, the observation feature vectors corresponding to all defect feature vectors of different defect conditions are obtained respectively.

[0034] As a preferred solution, in step S104, the defect recognition library of the safety and stability control system is determined by the following method:

[0035] S1041. Optimizing the initial parameters of the hidden Markov model using a particle swarm optimization algorithm;

[0036] S1042. Use the observed characteristic vectors of different defective working conditions to train the model parameters of the optimized hidden Markov model through the Baum-Welch algorithm, establish the hidden Markov recognition models corresponding to the different defective working conditions of the safety and stability control system, and complete the establishment of the defect recognition library of the safety and stability control system.

[0037] As a preferred solution, in step S1041, the particle swarm optimization algorithm is used to optimize the initial observation probability matrix B in the model parameter λ of the hidden Markov model, specifically:

[0038] Each possible initial observation probability matrix B is used as a particle in the solution space of the particle swarm optimization algorithm, and the Forward-Backwards algorithm in the defect recognition model is selected as the fitness function for optimization. The fitness value of each particle is obtained by calculating the probability log(P(O|λ)), and the optimization is updated according to the fitness value of each particle. The particle fitness value calculation formula is:

[0039]

[0040] Where P(·|λ) represents the likelihood probability value under the model parameter λ, λ=(A,B,π), A represents the hidden state probability matrix, B represents the observation probability matrix, and π represents the initial probability distribution of the hidden state; log(P(O|λ)) represents the log-likelihood probability value under the model parameter λ when the observation feature vector O is given; α t (i) represents the forward variable in hidden state i at time t under the model parameters λ when the observed feature vector O is given. It is calculated by the forward algorithm in Forward-Backwards, t = 1, 2, ..., T, i = 1, 2, ..., N, T represents the total number of time moments, and N represents the number of possible hidden states; o1, ..., o t and o t+1 Represents the observed eigenvalues ​​at the first t moments and the observed eigenvalues ​​at the t+1th moment in the observed eigenvector O; i t represents the hidden state at time t, qi q (i) represents the i-th possible hidden state in the hidden state space i ; a t+1 (j) represents the forward variable at time t+1 in hidden state j given the model parameters λ, calculated by the forward algorithm in the Forward-Backwards algorithm ij a j (j) represents the transition probability from hidden state i to hidden state j t+1 (j) represents the probability of observing feature value o t+1 in hidden state j

[0041] The specific steps of optimizing the initial observation probability matrix B in the model parameters λ of the hidden Markov model by using the particle swarm optimization algorithm include: first, randomly generating a plurality of initial observation probability matrices B; then, updating the position and velocity of each particle, and the updated particle corresponds to a new observation probability matrix B; in each iteration optimization process, the individual optimal position and the global optimal position of the particle swarm are updated according to the fitness value, and then the position of the entire particle swarm is updated according to the updated velocity; thus, the iteration is continuously carried out until the fitness value change meets the threshold condition or the iteration number reaches the upper limit, so as to obtain the optimal initial observation probability matrix B; wherein the position and velocity of the particle are updated according to the following method:

[0042] v i (t+1) = c1m1(sBest i (t) - x i (t)) + c2m2(sBest(t) - x i (t)) + ωv i (t);

[0043] x i (t+1) = x i (t) + v i (t+1);

[0044] wherein x i (t) and x i (t+1) are the positions of the particle at time t and time t+1 respectively, v i (t) and v i (t+1) are the velocities of the particle at time t and time t+1 respectively; sBest i(t) represents the best position searched by the i-th particle at time t, sBest(t) represents the global best position searched by all particles at time t; ω is an inertia weight; c1 and c2 are acceleration factors for adjusting the step length of the particle to its own best position and the step length of the global search to the best position, respectively; m1 and m2 are random numbers between 0 and 1.

[0045] As a preferred solution, in step S1042, the security and stability control system defect identification library is established by the following method:

[0046] An observation feature vector of a defect working condition is used to train and update the model parameters of the optimized hidden Markov model by the Baum-Welch algorithm to obtain a hidden Markov identification model corresponding to the defect working condition; in this way, the hidden Markov identification models corresponding to different defect working conditions are trained by using the observation feature vectors of the different defect working conditions respectively, and the establishment of the security and stability control system defect identification library is completed.

[0047] The update function of the model parameter λ is The calculation formula is:

[0048]

[0049] In the formula, is the updated model parameter; represents the log-likelihood probability value when the model parameter is given for the observation feature vector O and the hidden state space S; represents the probability value of being in the hidden state i1 at the initial time; represents the transition probability from the hidden state i t to the hidden state i t+1 ; b j (o t+1 ) represents the probability of the observation feature value o t when the hidden state is i t .

[0050] As a preferred solution, step S105 is specifically:

[0051] The defect feature vector collected in the real-time operation of the security and stability control system to be diagnosed is preprocessed and clustered to generate an observation feature vector to be diagnosed, which is input into the hidden Markov models of different defect working conditions in the security and stability control system defect identification library for identification to obtain the log-likelihood probability values output by the hidden Markov models of different defect working conditions; then, the defect working condition corresponding to the hidden Markov model with the maximum log-likelihood probability value is selected as the defect working condition of the security and stability control system defect identification result, and the defect identification result is displayed.

[0052] In a second aspect, the present application further provides a power grid safety and stability control system defect identification device based on PSO-HMM, comprising:

[0053] An acquisition module is configured to collect defect feature vectors in communication, measurement, setting value and strategy links of the safety and stability control system.

[0054] A first calculation module is configured to pre-process the collected defect feature vectors.

[0055] A second calculation module is configured to cluster the pre-processed defect feature vectors to establish observation feature vectors.

[0056] A third calculation module is configured to train a hidden Markov model using a particle swarm optimization algorithm and the observation feature vectors to obtain a trained hidden Markov model as a safety and stability control system defect identification library.

[0057] A comparison module is configured to identify defect feature vectors collected in real-time operation of the safety and stability control system to be diagnosed using the trained hidden Markov models of different defect conditions to output a defect condition identification result of the safety and stability control system.

[0058] In a third aspect, the present application further provides a power grid safety and stability control system defect identification device based on PSO-HMM, comprising a processor and a storage medium; the storage medium is configured to store a computer program; the processor is connected to the storage medium and is configured to execute the computer program stored in the storage medium to enable the power grid safety and stability control system defect identification device based on PSO-HMM to execute the above-mentioned power grid safety and stability control system defect identification method based on PSO-HMM.

[0059] Compared with the prior art, the present application has the following beneficial effects:

[0060] The application is based on a power grid safety and stability control system defect identification method based on PSO-HMM, in the feature extraction dimension, the defect feature vector collection of the safety and stability control system in the communication, measurement, setting value, strategy four key links is comprehensively covered, combined with the construction of multi-dimensional feature for different defect working condition data to form a defect feature vector, to ensure the integrity of the defect characterization; at the same time, the clustering processing is used to reduce the dimension optimization of the preprocessed defect feature vector, and the observation feature vector with discrimination is formed, and the quality of the corresponding relationship between the defect feature and the defect working condition is improved; in the model construction dimension, the global search ability of particle swarm optimization algorithm (PSO) is used to optimize the parameters of hidden Markov model (HMM), so that the model has time sequence pattern mining ability and dynamic adaptability, and the optimized hidden Markov model is trained for different defect working conditions, and a safety and stability control system defect identification library is established, which is used to match the collected defect feature vector of the to-be-diagnosed implementation, realize the rapid diagnosis of the defect working condition, ensure the accuracy of the defect identification, and better meet the real-time requirement of the power grid monitoring. BRIEF DESCRIPTION OF DRAWINGS

[0061] In order to make the purpose, technical scheme and advantages of the application clearer, the application will be further described in detail below with reference to the drawings, in which:

[0062] Figure 1 The flow chart of the power grid safety and stability control system defect identification method based on PSO-HMM of the application;

[0063] Figure 2 The test results of the test sample set of the safety and stability control system based on the particle swarm optimization algorithm and the hidden Markov model in the embodiment of the application;

[0064] Figure 3 The test results of the test sample set of the safety and stability control system based on the hidden Markov model in the embodiment of the application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical scheme and advantages of the embodiment of the application clearer, the technical scheme in the embodiment of the application will be clearly and completely described below with reference to the drawings in the embodiment of the application. Obviously, the described embodiment is a part of the embodiments of the application, rather than all the embodiments. The components of the embodiments of the application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the application provided in the drawings is not intended to limit the scope of the claimed application, but only represents selected embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.

[0066] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.

[0067] To achieve real-time and effective identification of defects in power grid security and stability control systems, the following two issues need to be addressed:

[0068] (1) How to sort out typical defect types and causes in safety and stability control systems, and extract corresponding defect features from historical defects in safety and stability control systems to characterize the operating status of safety and stability control systems;

[0069] (2) How to establish an effective safety and stability control system defect identification model to accurately explore the correspondence between the defect characteristics and defect types of the safety and stability control system, thereby achieving effective identification of safety and stability control system defects.

[0070] In order to solve the above two problems, the present invention starts from each operating link of the safety and stability control system, sorts out possible defective operating conditions, and extracts defect feature data that can reflect different defective operating conditions to accurately characterize them; at the same time, the particle swarm optimization algorithm (PSO) and the hidden Markov model (HMM) are combined to establish a defect recognition model for the safety and stability control system, and realize the mining of the corresponding relationship between the defect characteristics of the safety and stability control system and the defective operating conditions, so as to improve the real-time performance and effectiveness of the defect recognition of the safety and stability control system.

[0071] Based on the above ideas, the present invention provides the following technical solutions.

[0072] In the first aspect, the present invention provides a method for identifying defects in a power grid security and stability control system based on PSO-HMM. The specific process is as follows: Figure 1 As shown, the following steps are included:

[0073] S101, collecting defect feature vectors in different defect conditions in the communication link, measurement link, setting link, and strategy link of the safety and stability control system;

[0074] S102, preprocessing the collected defect feature vectors of different defect conditions;

[0075] S103, clustering the pre-processed defect feature vectors of different defect conditions to establish observation feature vectors of different defect conditions;

[0076] S104, using the particle swarm optimization algorithm and the observation feature vector under different working conditions, training the hidden Markov model to obtain the trained hidden Markov model of different defect working conditions of the security and stability control system as a defect identification library of the security and stability control system;

[0077] S105, using the trained hidden Markov model of different defect working conditions, identifying the defect feature vector collected in real-time operation of the security and stability control system to be diagnosed, and outputting the defect working condition identification result of the security and stability control system.

[0078] The power grid security and stability control system defect identification method based on PSO-HMM comprehensively covers the defect feature vector collection of the security and stability control system in the communication, measurement, setting value and strategy four key links in the feature extraction dimension, constructs a multi-dimensional feature to form a defect feature vector for different defect working conditions, to ensure the completeness of the defect representation. At the same time, the dimension reduction optimization of the preprocessed defect feature vector is performed by using clustering processing to form an observation feature vector with discrimination, and the quality of the corresponding relationship between the defect feature and the defect working condition is improved. In the model construction dimension, the global search ability of the particle swarm optimization algorithm (PSO) is used to optimize the hidden Markov model (HMM) parameters, so that the model has time sequence pattern mining ability and dynamic adaptability. The optimized hidden Markov model is trained for different defect working conditions, and a security and stability control system defect identification library is established to match the collected defect feature vector to be diagnosed, realize the rapid diagnosis of the defect working condition, ensure the accuracy of the defect identification, and better meet the real-time requirement of the power grid monitoring.

[0079] In the implementation, in step S101, after the possible defect working conditions of the communication link, the measurement link, the setting value link and the strategy link of the security and stability control system are combed, the possible defect working conditions are mined, including: normal working condition, communication abnormality, sampling abnormality, setting value overrun and operation strategy mismatch, a total of five different defect working conditions. Correspondingly, in order to accurately represent the above five different defect working conditions, the defect feature components corresponding to the five different defect working conditions are mined to form the defect feature vector of the security and stability control system. These defect feature components include: synchronization time difference, whole group action time, device temperature, device humidity, frequency measurement error, switch value collection accuracy, DC loop power and AC loop power. That is, when collecting the defect feature data of different running links of the security and stability control system, these different defect feature components need to be collected to form a set of defect feature vectors for subsequent data analysis and processing and defect identification.

[0080] The application takes the synchronous time difference, the whole group action time, the device temperature, the device humidity, the frequency measurement error, the switch value collection accuracy, the direct current loop power and the alternating current loop power data of the collected security and stability control system as the security and stability control system defect characteristic components, and analyzes the security and stability control system operation into the defect identification model, so that the quantitative modeling of the defect characteristic vector data is realized, the defect characteristic information of the security and stability control system real-time operation data is effectively mined, and the defect working conditions existing in the communication, measurement, setting value and strategy links of the security and stability control system are accurately identified in the subsequent period.

[0081] In the implementation, in step S102, since the dimensions, measurement standards and meanings of the original defect characteristic components are inconsistent, and the numerical change ranges are large, the training and identification effects of the defect identification model can be affected, so that the normalization preprocessing is needed to eliminate the influence of the different dimensions of the defect characteristic components on the identification results and improve the convergence speed and identification precision of the model. Therefore, in step S102, for each defect characteristic vector of the security and stability control system, the following method is used for preprocessing:

[0082]

[0083] In the formula, x′ i,j represents the normalization preprocessing result value of the jth defect characteristic component x i in the ith collected defect characteristic vector x i,j , x i ={x i,1 ,x i,2 ,…,x i,j ,…,x i,n}, n represents the type number of the defect characteristic components contained in the defect characteristic vector; x j,min and x j,max respectively represent the lower limit value and the upper limit value of the jth defect characteristic component; the preprocessed ith defect characteristic vector is represented as x′ i , and x′ i ={x′ i,1 ,x′ i,2 ,…,x′ i,j ,…,x′ i,n}.

[0084] Through the normalization preprocessing, the values of various characteristic components are normalized to the [0, 1] interval, the quantitative dimensions are unified, the influence of the different dimensions of the defect characteristic components on the identification results is eliminated, and the convergence speed and identification precision of the model are improved.

[0085] In the implementation, in step S103, the following method is used to establish the observation characteristic vector corresponding to the defect characteristic vector:

[0086] The K-means clustering algorithm is used to cluster the defect feature components in the preprocessed defect feature vectors of different defect conditions, and after clustering, each defect feature component in each defect feature vector is recombined and arranged according to a preset cluster arrangement order to obtain an observation feature vector corresponding to the defect feature vector;

[0087] The clustering objective function of the K-means clustering algorithm is:

[0088]

[0089] In the formula, x′ i,j represents the jth defect feature component in the ith processed defect feature vector x′ i ; μ k represents the clustering center of the kth cluster, M k represents a set of defect feature components belonging to the kth cluster, k = 1, 2, …, K, and K represents the number of clusters. represents the sum of the Euclidean distances from the defect feature components x′ i,j belonging to the kth cluster to the clustering center μ k of the cluster.

[0090] The specific way of using the K-means clustering algorithm to cluster the defect feature components in the preprocessed defect feature vectors is as follows:

[0091] S1031, initialize the clustering centers of K clusters, marked as {μ1, μ2, …, μ k , μ K};

[0092] S1032, for all defect feature components in the preprocessed defect feature vectors of different defect conditions, calculate the Euclidean distance of each feature component from each clustering center; wherein the Euclidean distance d ijk between the jth defect feature component x′ i,j in any ith processed defect feature vector x′ i and the clustering center μ k of the kth cluster is calculated according to the formula d ijk = ||x′ i,j - μ k ||.

[0093] S1033, for any one preprocessed defect feature component x′ i,j , compare the Euclidean distance values of each clustering center, and mark the cluster with the smallest Euclidean distance d ijk value as the defect feature component x′ i,jthe cluster to which the defect feature component belongs; thus, the defect feature component x' of each different defect feature component is determined i,j the cluster to which the defect feature component belongs; thus, the defect feature component x' of each different defect feature component is determined k , k = 1, 2, …, K;

[0094] S1034, the clustering centers of the K clusters are updated according to the following formula:

[0095]

[0096] wherein, |M k | represents the number of defect feature components contained in the defect feature component set M k of the kth cluster;

[0097] Then, it is respectively judged whether the clustering center μ k is changed after the update; if the clustering centers of all the K clusters are not changed after the update, step S1035 is executed; if the clustering center of any cluster is changed after the update, step S1032 is returned to be executed;

[0098] S1035, the division result of the K clusters is output as the clustering result;

[0099] Then, for any one preprocessed defect feature vector x' i = {x' i,1 , x' i,2 , …, x' i,j , …, x' i,n}, each defect feature component in it is recombined and arranged according to the preset cluster arrangement order, so as to obtain the observation feature vector corresponding to the defect feature vector x' i . In this way, the observation feature vector corresponding to each defect feature vector of each different defect condition is obtained respectively.

[0100] After obtaining the observation feature vectors of all the different defect conditions, the defect training set and the defect test set can be divided from the observation feature vectors of each defect condition, which are respectively used for subsequent mode training and testing of each defect condition.

[0101] In specific implementation, in step S104, the defect identification library of the safety and stability control system is determined according to the following method:

[0102] S1041, the initial parameters of the hidden Markov model are optimized by using the particle swarm optimization algorithm.

[0103] The step is mainly to optimize the initial observation probability matrix B in the model parameter λ of the hidden Markov model by using the particle swarm optimization algorithm. Specifically, each possible initial observation probability matrix B is taken as a particle in the solution space of the particle swarm optimization algorithm, and the Forward-Backwards algorithm in the defect identification model is selected as the fitness function for optimization. The fitness value of each particle is obtained by calculating the probability log(P(O| λ)), and each particle is updated and optimized according to the fitness value of each particle. The particle fitness value calculation formula is:

[0104]

[0105] In the formula, P(·| λ) represents the likelihood probability value under the model parameter λ, λ=(A, B, π), A represents the hidden state probability matrix, B represents the observation probability matrix, and π represents the initial probability distribution of the hidden state. log(P(O| λ)) represents the log-likelihood probability value under the model parameter λ given the observation feature vector O; α t (i) represents the forward variable of time t in the hidden state i under the model parameter λ given the observation feature vector O, which is calculated by the forward algorithm in the Forward-Backwards, t=1, 2, …, T, i=1, 2, …, N, T represents the total time, and N represents the number of possible hidden states; o t , …, o t+1 represent the observation feature values of the first t time and the observation feature value of the t+1 time in the observation feature vector O; i t represents the hidden state at time t, q i represents the i-th possible hidden state in the hidden state space q i ; α t+1 (j) represents the forward variable of time t+1 in the hidden state j under the model parameter λ given the observation feature vector O, which is calculated by the forward algorithm in the Forward-Backwards; a ij represents the transition probability from the hidden state i to the hidden state j; b j (o t+1 ) represents the probability of the observation feature value o t+1 when the hidden state is j.

[0106] The specific steps of optimizing the initial observation probability matrix B in the model parameter λ of the hidden Markov model by using the particle swarm optimization algorithm include: firstly, randomly generating a plurality of initial observation probability matrices B; then, updating the position and speed of each particle, and the updated particle corresponds to a new observation probability matrix B; in each iteration optimization process, updating the individual optimal position and the global optimal position of the particle swarm according to the fitness value, adjusting the position and speed of the particle, and then updating the position of the entire particle swarm according to the updated speed; thus, continuously iterating until the fitness value change meets the threshold condition or the iteration number reaches the upper limit, so as to obtain the optimal initial observation probability matrix B.

[0107] The position and speed of the particle are updated according to the following method:

[0108] v i (t+1) = c1m1(sBest i (t) - x i (t)) + c2m2(sBest(t) - x i (t)) + ωv i (t);

[0109] x i (t+1) = x i (t) + v i (t+1);

[0110] In the formula, x i (t) and x i (t+1) are the positions of the particle at time t and time t+1 respectively, v i (t) and v i (t+1) are the speeds of the particle at time t and time t+1 respectively; sBest i (t) represents the best position searched by the i-th particle at time t, and sBest(t) represents the global best position searched by all particles at time t; ω is an inertia weight; c1 and c2 are acceleration factors for adjusting the step length of the particle to the best position searched by itself and the step length of the global search to the best position respectively; m1 and m2 are random numbers between 0 and 1.

[0111] In the present application, the particle swarm optimization algorithm is introduced to optimize the selection of the initial observation probability matrix B, solve the problem that the model parameters are prone to fall into local optimum in the training process, improve the training speed of the model, and optimize the detection capability of the defect recognition model.

[0112] S1042. Use the observed characteristic vectors of different defective working conditions to train the model parameters of the optimized hidden Markov model through the Baum-Welch algorithm, establish the hidden Markov recognition models corresponding to the different defective working conditions of the safety and stability control system, and complete the establishment of the defect recognition library of the safety and stability control system.

[0113] In this step, the safety and stability control system defect identification library is established according to the following method:

[0114] Using the observed characteristic vector of a defective working condition, the model parameters of the optimized hidden Markov model are trained and updated through the Baum-Welch algorithm to obtain the hidden Markov recognition model corresponding to the defective working condition; in this way, the observed characteristic vectors of different defective working conditions are used to train the hidden Markov recognition models corresponding to different defective working conditions, and the establishment of the defect recognition library of the safe and stable control system is completed.

[0115] Among them, the update function of the model parameter λ is The calculation formula is:

[0116]

[0117] Where, are the updated model parameters; Represents the model parameters when given the observation feature vector O and the hidden state space S The log-likelihood probability value under ; Represents the probability value of being in the hidden state i1 at the initial moment; Represents the hidden state i t Transfer to hidden state i t+1 The transition probability of b j (o t+1 ) represents the hidden state i t When the observed characteristic value is o t probability.

[0118] That is to say, corresponding to the specific defective working condition types of the present application solution, in the specific implementation:

[0119] Using the observed feature vector data set under normal working conditions, the model parameters of the optimized hidden Markov model are trained and updated to obtain the corresponding hidden Markov recognition model under normal working conditions;

[0120] The observed feature vector dataset under abnormal communication defect conditions is used to train and update the model parameters of the optimized hidden Markov model, and the corresponding hidden Markov recognition model under abnormal communication defect conditions is obtained.

[0121] The model parameters of the optimized hidden Markov model are trained and updated by using the observation feature vector data set under the sampling abnormal defect working condition, to obtain the corresponding hidden Markov identification model under the sampling abnormal defect working condition.

[0122] The model parameters of the optimized hidden Markov model are trained and updated by using the observation feature vector data set under the fixed value overrun defect working condition, to obtain the corresponding hidden Markov identification model under the fixed value overrun defect working condition.

[0123] The model parameters of the optimized hidden Markov model are trained and updated by using the observation feature vector data set under the running strategy mismatch defect working condition, to obtain the corresponding hidden Markov identification model under the running strategy mismatch defect working condition.

[0124] Therefore, the corresponding hidden Markov identification model under the normal working condition, the corresponding hidden Markov identification model under the communication abnormal defect working condition, the corresponding hidden Markov identification model under the sampling abnormal defect working condition, the corresponding hidden Markov identification model under the fixed value overrun defect working condition, and the corresponding hidden Markov identification model under the running strategy mismatch defect working condition are constructed as a defect identification library of the safety and stability control system, which is used for subsequent defect identification.

[0125] In specific implementation, step S105 specifically includes: performing preprocessing and clustering processing on the defect feature vector collected in real-time operation of the safety and stability control system to be diagnosed, to generate an observation feature vector to be diagnosed, and inputting the observation feature vector to be diagnosed into hidden Markov models of different defect working conditions in the defect identification library of the safety and stability control system to obtain log-likelihood probability values output by the hidden Markov models of different defect working conditions; then, selecting a defect working condition corresponding to a hidden Markov model with the maximum log-likelihood probability value as a defect working condition of the defect identification result of the safety and stability control system, and showing the defect identification result.

[0126] In this step, the defect feature vector collected in real-time operation of the safety and stability control system to be diagnosed is preprocessed and clustered in the same manner as the aforementioned preprocessing and clustering of the defect feature vector, to convert the defect feature vector into an observation feature vector, and then output log-likelihood probability values through hidden Markov models of different defect working conditions, and the defect working condition corresponding to the maximum log-likelihood probability value is regarded as the identified defect working condition result.

[0127] In a second aspect, the present application further provides a power grid safety and stability control system defect identification device based on PSO-HMM, which comprises an acquisition module, a first calculation module, a second calculation module, a third calculation module, and a comparison module.

[0128] The acquisition module is configured to collect a defect feature vector in a communication link, a measurement link, a setting link, and a strategy link of the security and stability control system.

[0129] The first calculation module is configured to pre-process the collected defect feature vector.

[0130] The second calculation module is configured to cluster the pre-processed defect feature vector to establish an observation feature vector.

[0131] The third calculation module is configured to train a hidden Markov model by using a particle swarm optimization algorithm and the observation feature vector, to obtain a trained hidden Markov model as a security and stability control system defect identification library.

[0132] The comparison module is configured to identify a defect feature vector collected in real-time operation of the security and stability control system to be diagnosed by using the trained hidden Markov models of different defect conditions, and output a defect condition identification result of the security and stability control system.

[0133] The power grid security and stability control system defect identification device based on PSO-HMM is designed to execute the power grid security and stability control system defect identification method based on PSO-HMM provided in the present application, and has the corresponding technical advantages of the method.

[0134] In a third aspect, the present application further provides a power grid security and stability control system defect identification device based on PSO-HMM, which comprises a processor and a storage medium; the storage medium is configured to store a computer program; the processor is connected to the storage medium and is configured to execute the computer program stored in the storage medium, so that the power grid security and stability control system defect identification device based on PSO-HMM executes the power grid security and stability control system defect identification method based on PSO-HMM provided in the present application.

[0135] The storage medium 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 include an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or apparatus.

[0136] The code for a computer program to perform the procedures of the present application can be written in any of a number of programming languages or combinations thereof including object oriented programming languages such as Java, Smalltalk, C++, as well as conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network or a wide area network, or the connection can be made to an external computer.

[0137] Embodiment:

[0138] To verify the effectiveness of the method of the present application, the following examples are used to analyze and verify the solutions of the present application.

[0139] Taking the power grid safety and stability control system of a certain region as an example, according to the online operation monitoring data of the safety and stability control system, the actual operation experience data statistics of the device, the device historical operation database, the actual service life test of the device, and the standard manual of reliability data, the synchronous time difference, the whole group action time, the device temperature, the device humidity, the frequency measurement error, the switch value acquisition accuracy, the direct current loop power and the alternating current loop power of the safety and stability control system in the communication link, the measurement link, the setting value link and the strategy link in the historical defect data are counted in step S101 to form a defect feature vector; the collected defect feature vector data is preprocessed in step S102; the defect feature vector data after preprocessing is clustered by using the K-means clustering algorithm to obtain an observation feature vector in step S103; the above values are taken as the safety and stability control system fault feature quantities and are one-to-one corresponding to the defect working conditions to form a safety and stability control system historical defect sample library. 2500 sample data under 5 kinds of defect working conditions including normal working condition, communication abnormality, sampling abnormality, setting value overrun and operation strategy mismatch are collected, in the data under each state, 80% of the data are randomly selected as the training set, and the remaining 20% of the data are randomly selected as the test set. When the safety and stability control system has a defect, part of the defect feature components will have obvious differences from the defect feature components under the normal state.

[0140] The safety and stability control system defect working conditions and the sample numbers of each type of training set and test set are shown in Table 1.

[0141] Table 1 Defect information and sample number

[0142]

[0143] According to the training data set of each defect condition, the hidden Markov model is trained to obtain the safety and stability control system defect identification model corresponding to each of the five defect conditions of normal state, communication abnormality, sampling abnormality, value limit and operation strategy mismatch, as a safety and stability control system defect identification library. Then, 25 sample data of each defect condition in the test sample set are input into the hidden Markov model library of the five different defect conditions to perform defect identification. According to the principle of maximum output likelihood probability value, the defect identification result of the test sample is determined, as shown in Figure 2 The identification result shows that when the defect identification model trained by the particle swarm optimization algorithm and the hidden Markov model is used to identify defects by using test sample data, each type of test sample data obtains the maximum log-likelihood probability value under the hidden Markov model corresponding to the defect condition, and the result shows that the identification model trained based on the particle swarm optimization algorithm and the hidden Markov model can effectively identify the defect condition of the safety and stability control system, and no error occurs.

[0144] The safety and stability control system communication link defect sample identification result based on the hidden Markov model is shown in Figure 3 The identification result shows that the 10th group of data of the communication link sample has an identification error, and the communication abnormality is misidentified as the normal state. At the same time, the defect identification model has better identification effect on the normal state, the measurement link defect, the value link defect and the measurement link defect, and the identification accuracy reaches 100%, which indicates the feasibility of the selected safety and stability control system defect feature components. The defect identification result shows that the safety and stability control system defect identification model based on PSO-HMM proposed in the present application can well extract defect feature information from system real-time operation data for defect identification. At the same time, the defect identification result shows that under the condition of small sample features of safety and stability control system historical defect data, the defect identification method based on the particle swarm optimization algorithm and the hidden Markov model proposed in the present application can well mine the safety and stability control system defect features and quickly and effectively identify the defect condition of the test sample.

[0145] In summary, compared with the prior art, the present application has the following technical advantages:

[0146] The power grid safety and stability control system defect identification method based on the PSO-HMM, in the feature extraction dimension, comprehensively covers the defect feature vector collection of the safety and stability control system in the four key links of communication, measurement, setting value and strategy, combines the multi-dimensional feature to constitute the defect feature vector for different defect working condition data, to ensure the integrity of the defect representation; at the same time, the clustering processing is used to reduce the dimension optimization of the preprocessed defect feature vector, to form the observation feature vector with the discrimination degree, to improve the quality of the corresponding relationship mining between the defect feature and the defect working condition; in the model construction dimension, the global search ability of the particle swarm optimization algorithm (PSO) is used to optimize the hidden Markov model (HMM) parameters, so that the model has the time sequence pattern mining ability and dynamic adaptability, and the optimized hidden Markov model is trained for different defect working conditions, and the safety and stability control system defect identification library is established, to match the defect feature vector collected by the implementation to be diagnosed, to realize the rapid diagnosis of the defect working condition, to ensure the accuracy of the defect identification, and to better meet the real-time requirement of the power grid monitoring, and has good technical application popularization value.

[0147] Finally, it should be noted that the above examples are only used to illustrate the technical solutions of the present application, but not to limit the technical solutions, and those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the present application, which should be covered in the scope of the claims of the present application.

Claims

1. A method for identifying defects in a power grid security and stability control system based on PSO-HMM, characterized in that: The steps include: S101, collecting defect feature vectors in different defect conditions in the communication link, measurement link, setting link, and strategy link of the safety and stability control system; S102, preprocessing the collected defect feature vectors of different defect conditions; S103, clustering the pre-processed defect feature vectors of different defect conditions to establish observation feature vectors of different defect conditions; S104, using a particle swarm optimization algorithm and the observed characteristic vectors under the different working conditions to train a hidden Markov model, to obtain trained hidden Markov models of different defect working conditions as a defect recognition library for a safety and stability control system; S105 , using the trained hidden Markov models of different defect conditions, identifying defect feature vectors collected during the real-time operation of the safety and stability control system to be diagnosed, and outputting defect condition identification results of the safety and stability control system.

2. The method for identifying defects in a power grid security and stability control system based on PSO-HMM according to claim 1 is characterized in that: In step S101, the defective operating conditions of the safety and stability control system include: normal operating conditions, communication abnormalities, sampling abnormalities, set value exceeding the limit, and operation strategy mismatch; The defect characteristic vector of the safety and stability control system is composed of multiple defect characteristic components, and the defect characteristic components include: synchronization time difference, whole group action time, device temperature, device humidity, frequency measurement error, switch quantity acquisition accuracy, DC circuit power and AC circuit power.

3. The PSO-HMM-based defect identification method for power grid security and stability control system according to claim 1 is characterized in that: In step S102, each defect feature vector of the safety and stability control system is preprocessed according to the following method: Where x′ i,j Represents the collected i-th defect feature vector x i The j-th defect characteristic component x in i,j The normalized preprocessing result value, x i ={x i,1 ,x i,2 ,…,x i,j ,…,x i,n }, n represents the number of types of defect feature components contained in the defect feature vector; x j,min 、x j,max They represent the lower limit and upper limit of the j-th defect characteristic component respectively; the i-th defect characteristic vector after preprocessing is represented as x′ i , and x′ i ={x′ i,1 ,x′ i,2 ,…,x′ i,j ,…,x′ i,n }.

4. The method for identifying defects in a power grid security and stability control system based on PSO-HMM according to claim 1 is characterized in that: In step S103, the observation feature vector corresponding to the defect feature vector is established as follows: The K-means clustering algorithm is used to cluster the defect feature components in the defect feature vectors of different defect conditions after preprocessing. After clustering, the defect feature components in each defect feature vector are recombined and arranged according to the preset cluster arrangement order to obtain the observation feature vector corresponding to the defect feature vector; The clustering objective function of the K-means clustering algorithm is: Where x′ i,j Represents the i-th defect feature vector x′ after processing i The j-th defect characteristic component in ; μ k represents the cluster center of the kth cluster, M k represents the set of defect feature components belonging to the kth cluster, k = 1, 2, ..., K, K represents the number of clusters; Represents the trap feature component x′ belonging to the kth cluster i,j To the cluster center μ of this cluster k The sum of the Euclidean distances; The specific method of clustering the defect feature components in the preprocessed defect feature vector using the K-means clustering algorithm is as follows: S1031. Initialize the cluster centers of K clusters, marked as {μ1,μ2,…,μ k ,…,μ K }; S1032. For all defect feature components in the defect feature vectors of different defect conditions after preprocessing, calculate the Euclidean distance between each feature component and each cluster center; wherein, any i-th defect feature vector x′ after preprocessing i The j-th defect characteristic component x′ in i,j and the cluster center μ of the kth cluster k The Euclidean distance d ijk The calculation formula is d ijk =||x′ i,j -μ k ||; S1033: For any pre-processed defect feature component x′ i,j , compare the Euclidean distance values ​​with each cluster center, and use the Euclidean distance d ijk The cluster with the smallest value is marked as the defect feature component x′ i,j The cluster to which it belongs; thus, the characteristic components x′ of each defect are determined respectively i,j The cluster to which it belongs, determines the set M of defect feature components of each cluster k , k=1,2,…,K; S1034. Update the cluster centers of the K clusters according to the following formula: Among them, |M k | represents the set M of defect feature components of the kth cluster k The number of defect characteristic components contained in ; Then, each cluster center μ is judged separately k Whether there is any change between the updated and the updated centers; if the cluster centers of all K clusters do not change after the update, then execute step S1035; if the cluster center of any cluster changes after the update, then return to execute step S1032; S1035: Output the division results of K clusters as the clustering result; Then, for any preprocessed defect feature vector x′ i ={x′ i,1 ,x′ i,2 ,…,x′ i,j ,…,x′ i,n }, and rearrange the defect feature components according to the preset cluster arrangement order to obtain the defect feature vector x′ i Corresponding observation feature vectors; in this way, the observation feature vectors corresponding to all defect feature vectors of different defect conditions are obtained respectively.

5. The method for identifying defects in a power grid security and stability control system based on PSO-HMM according to claim 1 is characterized in that: In step S104, the defect recognition library of the safety and stability control system is determined by the following method: S1041. Optimizing the initial parameters of the hidden Markov model using a particle swarm optimization algorithm; S1042. Use the observed characteristic vectors of different defective working conditions to train the model parameters of the optimized hidden Markov model through the Baum-Welch algorithm, establish the hidden Markov recognition models corresponding to the different defective working conditions of the safety and stability control system, and complete the establishment of the defect recognition library of the safety and stability control system.

6. The PSO-HMM-based defect identification method for power grid security and stability control system according to claim 5 is characterized in that: In step S1041, the particle swarm optimization algorithm is used to optimize the initial observation probability matrix B in the model parameter λ of the hidden Markov model, specifically: Each possible initial observation probability matrix B is used as a particle in the solution space of the particle swarm optimization algorithm, and the Forward-Backwards algorithm in the defect recognition model is selected as the fitness function for optimization. The fitness value of each particle is obtained by calculating the probability log(P(O|λ)), and the optimization is updated according to the fitness value of each particle. The particle fitness value calculation formula is: Where P(·|λ) represents the likelihood probability value under the model parameter λ, λ=(A,B,π), A represents the hidden state probability matrix, B represents the observation probability matrix, and π represents the initial probability distribution of the hidden state; log(P(O|λ)) represents the log-likelihood probability value under the model parameter λ when the observation feature vector O is given; α t (i) represents the forward variable in hidden state i at time t under the model parameters λ when the observed feature vector O is given. It is calculated by the forward algorithm in Forward-Backwards, t = 1, 2, ..., T, i = 1, 2, ..., N, T represents the total number of time moments, and N represents the number of possible hidden states; o1, ..., o t and o t+1 Represents the observed eigenvalues ​​at the first t moments and the observed eigenvalues ​​at the t+1th moment in the observed eigenvector O; i t represents the hidden state at time t, q i represents the i-th possible hidden state q in the hidden state space i ; α t+1 (j) represents the forward variable in hidden state j at time t+1 under the model parameters λ when the observed feature vector O is given, and is calculated by the forward algorithm in Forward-Backwards; a ij represents the transition probability from hidden state i to hidden state j; b j (o t+1 ) indicates that the observed feature value is o when the hidden state j is t+1 probability; The specific steps of optimizing the initial observation probability matrix B in the model parameter λ of the hidden Markov model using the particle swarm optimization algorithm include: first, randomly generating a number of initial observation probability matrices B; then, updating the position and velocity of each particle, and the updated particle corresponds to a new observation probability matrix B; in each iterative optimization process, updating the individual optimal position and global optimal position of the particle swarm according to the fitness value, adjusting the position and velocity of the particle, and then updating the position of the entire particle swarm according to the updated velocity; thus, iterating continuously until the fitness value change meets the threshold condition or the number of iterations reaches the upper limit, thereby obtaining the optimal initial observation probability matrix B; wherein the update of the particle position and velocity is determined by the following method: v i (t+1)=c1m1(sBest i (t)-x i (t))+c2m2(sBest(t)-x i (t))+ωv i (t); x i (t+1)=x i (t)+v i (t+1); Where x i (t) and x i (t+1) are the positions of the particle at time t and time t+1, respectively, v i (t) and v i (t+1) are the velocities of the particle at time t and time t+1 respectively; sBest i (t) represents the best position searched by the i-th particle at time t, sBest(t) represents the global best position searched by all particles at time t; ω is the inertia weight; c1 and c2 are acceleration factors, which are used to adjust the step size of the particle in the direction of searching for its own best position and the step size of the global search for the best position respectively; m1 and m2 are random numbers between [0,1].

7. The method for identifying defects in a power grid security and stability control system based on PSO-HMM according to claim 6 is characterized in that: In step S1042, a safety and stability control system defect identification library is established according to the following method: Using the observed feature vector of a defective working condition, the model parameters of the optimized hidden Markov model are trained and updated using the Baum-Welch algorithm to obtain the hidden Markov recognition model corresponding to the defective working condition. In this way, the observed feature vectors of different defective working conditions are used to train the hidden Markov recognition models corresponding to different defective working conditions, completing the establishment of a defect recognition library for the safety and stability control system. Among them, the update function of the model parameter λ is The calculation formula is: Where, are the updated model parameters; Represents the model parameters when given the observation feature vector O and the hidden state space S The log-likelihood probability value under ; Represents the probability value of being in the hidden state i1 at the initial moment; Represents the hidden state i t Transfer to hidden state i t+1 The transition probability of b j (o t+1 ) represents the hidden state i t When the observed characteristic value is o t probability.

8. The method for identifying defects in a power grid security and stability control system based on PSO-HMM according to claim 1 is characterized in that: Step S105 is specifically as follows: The defect feature vectors collected during the real-time operation of the safety and stability control system to be diagnosed are preprocessed and clustered to generate observation feature vectors to be diagnosed, which are respectively input into the hidden Markov models of different defect conditions in the safety and stability control system defect identification library for identification, and the log-likelihood probability values ​​output by the hidden Markov model of different defect conditions are obtained; then, the defect condition corresponding to the hidden Markov model with the largest log-likelihood probability value is selected, and determined as the defect condition of the safety and stability control system defect identification result, and the defect identification result is displayed.

9. A PSO-HMM-based power grid security and stability control system defect identification device, characterized in that: include: The acquisition module is used to collect defect feature vectors in the communication link, measurement link, setting link, and strategy link of the safety and stability control system; A first calculation module is used to preprocess the collected defect feature vectors; The second calculation module is used to cluster the pre-processed defect feature vectors and establish observation feature vectors; A third computing module is used to train the hidden Markov model using a particle swarm optimization algorithm and the observed feature vector to obtain a trained hidden Markov model as a defect identification library for a safety and stability control system; The comparison module is used to use the trained hidden Markov models of different defect conditions to identify the defect feature vectors collected during the real-time operation of the safety and stability control system to be diagnosed, and output the defect condition identification results of the safety and stability control system.

10. A PSO-HMM-based power grid security and stability control system defect identification device, characterized in that: The invention comprises a processor and a storage medium; the storage medium is used to store a computer program; the processor is connected to the storage medium and is used to execute the computer program stored in the storage medium, so that the PSO-HMM-based power grid security and stability control system defect identification device performs the PSO-HMM-based power grid security and stability control system defect identification method according to any one of claims 1 to 8.