A power grid operation mode extraction method and device, a terminal device, and a storage medium
By employing automated time-series feature extraction, dimensionality reduction, and clustering methods, the problem of coarseness in manual extraction of power grid operation modes was solved, achieving accurate extraction and improved precision of power grid operation modes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG POWER GRID CO LTD
- Filing Date
- 2024-09-11
- Publication Date
- 2026-06-09
AI Technical Summary
In the current technology, the extraction of power grid operation modes mainly relies on manual methods, which lack a unified and scientific extraction standard, resulting in a relatively crude classification and difficulty in representing complex power grid operation scenarios.
By acquiring power operation data, extracting time series features, performing dimensionality reduction optimization and clustering, and utilizing sliding window, information gain, shape factor transformation, kernel principal component analysis and reinforcement learning methods, combined with Bayesian scoring values, the power grid operation mode is automatically extracted.
It enables precise extraction of power grid operation modes, reduces manual intervention, adapts to complex power grid scenarios, and improves extraction accuracy and precision.
Smart Images

Figure CN119249183B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system technology, and in particular to a method, apparatus, terminal equipment, and storage medium for extracting power grid operation modes. Background Technology
[0002] In recent years, with the rapid development of the intelligent era, the power industry, as a fundamental energy support sector for the nation, has accelerated its entry into the big data era, leading to significant changes in the production and operation of my country's power system. Improvements in science and technology and the deepening of power system reforms have continuously improved my country's power grid structure and operation control methods, ensuring the safe and stable operation of the grid. However, with the large-scale integration of new energy sources such as wind and solar power, and the rapid advancement of ultra-high voltage and regional power grid interconnection, while enhancing the safety and stability of the power grid, it has also led to more complex and variable power grid operation modes, demanding more refined management. Traditional methods of extracting power grid operation modes rely primarily on manual extraction, relying on the operational experience of operators and historical operational databases. This lacks unified and scientific extraction standards and is highly subjective. Furthermore, limitations imposed by the management capabilities of operators result in relatively crude classifications, making it difficult to characterize the complex operational scenarios in large-scale interconnected power systems. Summary of the Invention
[0003] This invention provides a method, apparatus, terminal equipment, and storage medium for extracting power grid operation modes, which can effectively solve the problem that existing technologies mainly rely on manual extraction of power grid operation modes and lack unified and scientific extraction standards.
[0004] One embodiment of the present invention provides a method for extracting the power grid operation mode, comprising:
[0005] Acquire the power operation data of the power grid to be extracted; the power operation data includes: generator output data, cross-sectional power flow data, and load data;
[0006] Based on the power operation data, time series features are extracted to obtain power time series features;
[0007] Dimensionality reduction optimization is performed based on the power time series characteristics to obtain the target power time series characteristics;
[0008] The target power time-series features are clustered to obtain the final power data clustering results;
[0009] The cluster centers corresponding to the final power data clustering results are used as the power grid operation modes of the power grid to be extracted.
[0010] Further, based on the power operation data, time series features are extracted to obtain power time series features, including:
[0011] Based on the power operation data and the preset sliding window length, several subsequences of power operation data are found by sliding.
[0012] Based on the power operation data and several power operation data subsequences, the distance value between the power operation data and each power operation data subsequence corresponding to the power operation data is calculated.
[0013] Based on the power operation data, several power operation data subsequences, the distance value, and a preset distance threshold, the power time series characteristics are obtained.
[0014] Further, based on the power operation data, several power operation data subsequences, the distance value, and a preset distance threshold, power time-series characteristics are obtained, including:
[0015] The information gain is calculated based on several subsequences of power operation data, the distance value, and a preset distance threshold.
[0016] When the information gain is maximized, the breakout point corresponding to the maximum information gain is taken as the target breakout point.
[0017] Based on the target separation point and several power operation data subsequences, the power operation data subsequences that satisfy the target separation point are determined as the target time series;
[0018] Based on the target time series and the power operation data, shape factor transformation is performed to extract power time series features.
[0019] Furthermore, dimensionality reduction optimization is performed based on the power time-series characteristics to obtain the target power time-series characteristics, including:
[0020] Based on the power time series characteristics and the preset kernel function, the power time series characteristics are mapped to a high-dimensional space, and principal component analysis is performed on the mapped power time series characteristics in the high-dimensional space to obtain preliminary dimensionality-reduced time series characteristics;
[0021] The initial dimensionality-reduced temporal features are randomly divided into an action set and an environment state set;
[0022] Based on the action set and the environment state set, iterative optimization is repeatedly performed until the current cumulative reward value is less than the previous cumulative reward value, thus obtaining the final action set and the final environment state set.
[0023] The target power timing characteristics are determined based on the final set of actions and the final set of environmental states.
[0024] The iterative optimization includes:
[0025] The Q-value table is updated based on the current action set and the current environment state set; the current action set and the current environment state set during the initial iteration optimization are the action set and the environment state set, respectively.
[0026] Calculate the current cumulative reward value based on the current set of actions and the set of environmental states;
[0027] Compare the current cumulative reward value with the previous cumulative reward value;
[0028] If it is determined that the current cumulative reward value is less than the previous cumulative reward value, the current action set and the current environment state set are used as the final action set and the final environment state set.
[0029] If the current cumulative reward value is determined to be greater than the previous cumulative reward value, the Q-value table is updated according to the cumulative reward value; and the current action set and the current environment state set are updated according to the updated Q-value table.
[0030] Furthermore, the target power time-series features are clustered to obtain the final power data clustering results, including:
[0031] Based on the target power time series characteristics, several target power time series characteristics are randomly selected as initial cluster centers;
[0032] Based on the initial cluster centers and the target power time series characteristics, the clustering operation is repeated until the preset cost function converges, and the final power data clustering result is obtained.
[0033] The clustering operation includes:
[0034] Based on the current cluster center and the target power time series characteristics, the target power time series characteristics are assigned to the nearest current cluster center to obtain several time series characteristic clusters;
[0035] Several time-series feature clusters are used as the current power data clustering results; the current cluster center when the clustering operation is performed for the first time is the initial cluster center;
[0036] The cost function is calculated based on the current cluster center corresponding to the current power data clustering results and the target power time series characteristics.
[0037] When determining the convergence of the cost function, the current power data clustering result is taken as the final power data clustering result;
[0038] When the cost function is determined to be non-convergent, the Bayesian score is calculated based on the number of several time-series feature clusters, the number of target power time-series features, and the preset likelihood function; and the number of current cluster centers is updated based on the Bayesian score and the preset score threshold.
[0039] Update the current cluster centers based on the current number of cluster centers and several temporal feature clusters.
[0040] Furthermore, before extracting time series features from the power operation data to obtain power time series features, the method further includes: preprocessing the power operation data to obtain the final power operation data;
[0041] The power operation data is preprocessed to obtain the final power operation data, including:
[0042] The missing values in the power operation data are processed to obtain the power operation data after removing the missing values.
[0043] Anomalies are identified based on the power operation data after removing missing values and the preset anomaly threshold to obtain abnormal power operation values.
[0044] Based on abnormal power operation values and a preset linear interpolation function, power operation correction values are calculated.
[0045] The power operation correction value is filled into the power operation data after removing missing values to obtain the final power operation data.
[0046] As an improvement to the above solution, another embodiment of the present invention provides a device for extracting the power grid operation mode, comprising:
[0047] The power data acquisition module is used to acquire the power operation data of the power grid to be extracted; the power operation data includes: generator output data, cross-sectional power flow data, and load data;
[0048] The power time series feature extraction module is used to extract time series features based on the power operation data to obtain power time series features.
[0049] The feature dimensionality reduction module is used to perform dimensionality reduction optimization based on the power time series features to obtain the target power time series features;
[0050] The power data clustering module is used to cluster the target power time-series features to obtain the final power data clustering result;
[0051] The operation mode extraction module is used to take the cluster centers corresponding to the final power data clustering results as the power grid operation mode of the power grid to be extracted.
[0052] Furthermore, it also includes: a data preprocessing module, used to preprocess the power operation data to obtain the final power operation data;
[0053] The power operation data is preprocessed to obtain the final power operation data, including:
[0054] The missing values in the power operation data are processed to obtain the power operation data after removing the missing values.
[0055] Anomalies are identified based on the power operation data after removing missing values and the preset anomaly threshold to obtain abnormal power operation values.
[0056] Based on abnormal power operation values and a preset linear interpolation function, power operation correction values are calculated; these correction values are then filled into the power operation data after removing missing values to obtain the final power operation data.
[0057] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a method for extracting a power grid operation mode as described in the above embodiments.
[0058] Another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power grid operation mode extraction method described in the above embodiment.
[0059] By implementing this invention, at least the following beneficial effects are achieved:
[0060] This invention provides a method, apparatus, terminal device, and storage medium for extracting power grid operation modes. The method acquires power operation data of the power grid to be extracted. The power operation data includes generator output data, cross-sectional power flow data, and load data. Time series features are extracted from the power operation data to obtain power time-series features. Dimensionality reduction optimization is performed on the power time-series features to obtain target power time-series features. The target power time-series features are clustered to obtain the final power data clustering result. The cluster centers corresponding to the final power data clustering result are used as the power grid operation mode of the power grid to be extracted. By extracting time-series features from the power grid's operation data, we obtain power time-series features that reflect the dynamic characteristics of the power grid's operation, providing more accurate time-series features for subsequent power grid operation mode extraction. Then, we perform dimensionality reduction optimization on the power time-series features to adapt to the complex operation scenarios of large-scale power grid systems, avoiding the limitations of power grid operation mode extraction and improving the accuracy of power grid operation mode extraction. After clustering the target power time-series features, we use the cluster centers corresponding to the power data clustering results as the power grid operation modes, reducing manual intervention. By forming a complete chain from time-series feature extraction, dimensionality reduction, and clustering, we gradually extract the power grid operation modes, improving the accuracy of power grid operation mode extraction. Attached Figure Description
[0061] Figure 1 This is a flowchart illustrating a method for extracting power grid operation modes according to an embodiment of the present invention;
[0062] Figure 2 This is a schematic diagram of the structure of a power grid operation mode extraction device provided in an embodiment of the present invention;
[0063] Figure 3 This is another flowchart illustrating a method for extracting power grid operation modes according to an embodiment of the present invention. Detailed Implementation
[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0065] See Figure 1 This is a flowchart illustrating a method for extracting power grid operation modes according to an embodiment of the present invention, comprising:
[0066] S1. Obtain the power operation data of the power grid to be extracted; the power operation data includes: generator output data, cross-sectional power flow data, and load data;
[0067] S2. Extract time series features from the power operation data to obtain power time series features;
[0068] S3. Perform dimensionality reduction optimization based on the power time series characteristics to obtain the target power time series characteristics;
[0069] S4. Cluster the target power time-series features to obtain the final power data clustering result;
[0070] S5. The cluster centers corresponding to the final power data clustering results are used as the power grid operation modes of the power grid to be extracted.
[0071] Specifically, power operation data includes numerous parameters, such as generator output data, cross-sectional power flow data, load data, transformer tap positions, and compensator engagement levels. If all power operation data were indiscriminately used as characteristic variables representing the power grid's operation mode, it would result in a large amount of redundant data. In this embodiment, power operation data includes generator output data, cross-sectional power flow data, and load data. As the source of the entire power production system, the generator side's generator start-up combination and operation mode affect the overall power grid operation mode. Especially with the rapid development of distributed generation and the continuous integration of new energy sources, the impact of generator operation on the overall power grid operation mode is becoming increasingly significant. On the one hand, the rapid development of distributed generation has affected the system's demand for centralized power plants and long-distance transmission lines, gradually transforming the power grid from a radial grid to a network distributed across power sources and interconnected with users, making the power grid's operation mode more complex. On the other hand, new energy power generation, mainly wind and solar, is greatly affected by environmental factors, exhibiting significant volatility and randomness. The integration of new energy sources easily leads to frequent changes in power flow, making voltage regulation and protection configuration of the power system increasingly difficult, posing challenges to the safe and stable operation of the power system. Among the many influencing factors, the output of generator sets has the most significant impact on the power grid operation mode. Therefore, when selecting attribute variables that characterize the power grid operation mode, the output data of generator sets on the generation side should be taken into account.
[0072] Cross-sectional power flow data directly reflects the power flow in specific areas of the power grid. By analyzing this data, it's possible to determine if the grid experiences overload, power backflow, or other irrational phenomena, providing data support for adjusting operational modes. Secondly, the safety and reliability of the power grid directly affect the stability of power supply and the user experience. Cross-sectional power flow data can reveal weak links and potential risks in the grid, such as overload risks on critical lines and voltage stability issues, allowing for targeted development of safety strategies and emergency measures to improve the grid's resilience and recovery capabilities. Furthermore, cross-sectional power flow data provides fundamental information for the economic dispatch and optimized operation of the power grid. By analyzing cross-sectional power flow, grid structure can be optimized, generation output adjusted, load balancing achieved, network losses reduced, and energy utilization efficiency improved, thereby achieving economical operation. Therefore, cross-sectional power flow data is irreplaceable for assessing the current operating status of the power grid, planning future power supply schemes, and ensuring the safe, reliable, and economical operation of the power grid.
[0073] The operating characteristics of the power grid under various load conditions are a crucial aspect of power grid operation mode research and analysis. From the perspective of load level, its intensity directly determines the output level of generator units on the system's generating side, thus affecting the power flow distribution. From the perspective of load type, different types of loads have different impacts on the power grid. For example, the startup of equipment such as electric locomotives, large generators, and electric arc furnaces can generate impact loads and harmonics, affecting the stable operation of transmission equipment and the system. Therefore, load data is an important attribute variable in extracting power grid operation modes.
[0074] In a preferred embodiment of the present invention, after acquiring the power operation data of the power grid to be extracted, time series features are extracted based on the power operation data to obtain power time series features. Power time series features represent features describing the temporal changes of power extracted from the time series data (power operation data) of the power grid. By identifying unique shape segments in the time series, subtle and crucial change patterns in power grid operation can be captured, providing a more detailed pattern recognition capability than traditional statistical features. Then, dimensionality reduction optimization is performed based on the power time series features to obtain target power time series features. Next, the target power time series features are clustered to obtain the final power data clustering result. Finally, the cluster centers corresponding to the final power data clustering result are used as the power grid operation mode of the power grid to be extracted.
[0075] Existing methods for extracting power grid operation modes primarily rely on manual extraction, depending on the operator's experience, relevant national industry regulations, and historical operation databases. This manual extraction lacks unified and scientific standards, is highly subjective, and is limited by management and scientific levels, resulting in a crude classification of operation modes that fails to represent the complex operational scenarios arising from the integration of new energy systems and power market reforms in large-scale interconnected power systems. This invention combines time series feature analysis, dimensionality reduction, and clustering techniques to form a complete analytical chain from feature extraction to identification, enabling rapid extraction of power grid operation modes.
[0076] Preferably, time series features are extracted from the power operation data to obtain power time series features, including:
[0077] Based on the power operation data and the preset sliding window length, several subsequences of power operation data are found by sliding.
[0078] Based on the power operation data and several power operation data subsequences, the distance value between the power operation data and each power operation data subsequence corresponding to the power operation data is calculated.
[0079] Based on the power operation data, several power operation data subsequences, the distance value, and a preset distance threshold, the power time series characteristics are obtained.
[0080] Preferably, power time-series characteristics are obtained by identifying the power operation data, several power operation data subsequences, the distance value, and a preset distance threshold, including:
[0081] The information gain is calculated based on several subsequences of power operation data, the distance value, and a preset distance threshold.
[0082] When the information gain is maximized, the breakout point corresponding to the maximum information gain is taken as the target breakout point.
[0083] Based on the target separation point and several power operation data subsequences, the power operation data subsequences that satisfy the target separation point are determined as the target time series;
[0084] Based on the target time series and the power operation data, shape factor transformation is performed to extract power time series features.
[0085] In a preferred embodiment of the present invention, the power operation data is a time series arranged in chronological order, that is, the power operation data can be regarded as a time series T = t1, t2, ..., t MA set of M real-valued data points arranged in chronological order, where adjacent data points t1, t2, ..., t... M The time intervals are equal. Given a time series T of length M and a user-defined subsequence of length l, the subsequence can be found using a sliding window of length l. This subsequence defined by the sliding window is represented as... Here, the superscript l represents the length of the subsequence, and the subscript p represents the starting position of the sliding window. The set of all subsequences of length l in T is defined as S. l (T), which refers to several subsequences of power operation data.
[0086] The power operation data subsequence can also be viewed as a continuous sequence segment S of length l (l≤M) on the time series T, i.e., S=t p ,t p+1 ,...,t p+l-1 Where 1≤p≤M-l+1. SubDist(T,S) is a function that calculates the distance d (d≥0) between time series T and subsequence S. Then, based on the power operation data and several power operation data subsequences, the distance value between the power operation data and each corresponding power operation data subsequence is calculated. Next, based on several power operation data subsequences, the distance value, and a preset distance threshold, the information gain is calculated. When the information gain is maximized, the separation point corresponding to the maximum information gain is taken as the target separation point. A certain subsequence S and its corresponding distance value d are used. th The dataset D can be divided into two classes, D1 and D2, which must satisfy the following condition: Each time series T in D1 1,i Satisfying SubDist(T) 1,i ,S)<d th Meanwhile, each time series T in D2 2,i , satisfying SubDist(T 2,i ,S)≥d th Among them, T 1,i Let T represent the i-th time series in D1 (1≤i≤|D1|), where T is the time series in D1. 2,i Let |D1| and |D2| represent the i-th time series in D2 (1≤i≤|D2|), where |D1| and |D2| are the number of time series in classes D1 and D2, respectively. The target separation point is relative to any other threshold d. t ' h All satisfy: Gain(S,d) OSP(D,S) )≥Gain(S,d t ' hThis yields the target time series where the distance value is greater than the distance value corresponding to the target separation point. Finally, shapelet transformation is performed on the target time series and the power operation data to extract the power time series features. The target time series and its corresponding distance value satisfy the following for all other subsequences S:
[0087] Gain(Shapelet(D),d OSP(D,Shapelet(D)) )≥Gain(S,d OSP(D,S) In this context, Shapelet(D) represents the shapelet in dataset D, i.e., the target time series. Shapelet transformation refers to transforming the target time series shapelet into vector space. Shapelets are features; let the selected shapelet set be {shapelet}, and the time series S transformed by {P} take the form T. transformed :
[0088] T transformed ={SubDist(shapelet1,T),SubDist(shapelet2,T),...,SubDist(shapelet |shapelet| ,T)}, where |shapelet| is the number of shapelets in {shapelet}. The Shapelet method can capture subtle and critical change patterns in power grid operation by identifying unique shape segments in time series, providing more detailed pattern recognition capabilities than traditional statistical features.
[0089] Specifically, dimensionality reduction optimization is performed based on the power time-series characteristics to obtain the target power time-series characteristics, including:
[0090] Based on the power time series characteristics and the preset kernel function, the power time series characteristics are mapped to a high-dimensional space, and principal component analysis is performed on the mapped power time series characteristics in the high-dimensional space to obtain preliminary dimensionality-reduced time series characteristics;
[0091] The initial dimensionality-reduced temporal features are randomly divided into an action set and an environment state set;
[0092] Based on the action set and the environment state set, iterative optimization is repeatedly performed until the current cumulative reward value is less than the previous cumulative reward value, thus obtaining the final action set and the final environment state set.
[0093] The target power timing characteristics are determined based on the final set of actions and the final set of environmental states.
[0094] The iterative optimization includes:
[0095] The Q-value table is updated based on the current action set and the current environment state set; the current action set and the current environment state set during the initial iteration optimization are the action set and the environment state set, respectively.
[0096] Calculate the current cumulative reward value based on the current set of actions and the set of environmental states;
[0097] Compare the current cumulative reward value with the previous cumulative reward value;
[0098] If it is determined that the current cumulative reward value is less than the previous cumulative reward value, the current action set and the current environment state set are used as the final action set and the final environment state set.
[0099] If the current cumulative reward value is determined to be greater than the previous cumulative reward value, the Q-value table is updated according to the cumulative reward value; and the current action set and the current environment state set are updated according to the updated Q-value table.
[0100] In a preferred embodiment of the present invention, Kernel Principal Component Analysis (KPCA) is a kernel-based approach to principal component analysis (PCA). This method is more suitable for nonlinearly separable problems and can also provide reasonable feature extraction operations for a series of nonlinearly separable problems. KPCA, as an extension of PCA in the nonlinear domain, applies the method to PCA and then performs PCA transformations in a high-dimensional space. Assume a D (D>d) dimensional vector ω... i (i = 1, ..., d) are eigenvectors in the high-dimensional space, λ i (i = 1, ..., d) are the corresponding eigenvalues. The principal component analysis in high-dimensional space is as follows: ω i =λ i ω i ; the eigenvector ω i (i = 1, ..., d) can be linearly represented using the sample set φ(X) as follows: Then, put ω i Substituting (i = 1, ..., d) into the above formula, we get the following form: Then multiply both sides of the equation by the left side. The formula is obtained as follows: The right side of the equation stems from the properties of kernel functions, including linear kernel functions, Gaussian kernel functions, polynomial kernel functions, Laplace kernel functions, Cosine kernel functions, and Sigmoid kernel functions. Therefore, the formula is transformed into the solution formula: Kα = λ iα, in the formula, means finding the eigenvectors corresponding to the largest eigenvalues of K. Since K is a pre-defined symmetric matrix, the resulting solution vectors are necessarily orthogonal to each other. However, α here is only an eigenvector of K, not the eigenvector ω in the higher-dimensional space. ω should be further derived from α. A set of basis vectors in the higher-dimensional space ω i (i = 1, ..., d) can form a subspace, and the vector after dimensionality reduction is the test sample χ. te Linear representation in this subspace: Therefore, based on the power time series characteristics and the preset kernel function, the power time series characteristics are mapped to a high-dimensional space, and principal component analysis is performed on the mapped power time series characteristics in the high-dimensional space to obtain preliminary dimensionality-reduced time series characteristics.
[0101] Q-learning is a reinforcement learning method that uses a value-based iterative approach to learn a table called Q-values to guide an agent in making decisions within its environment. Q-learning assumes that the agent's interactions (actions) with the environment influence the next state, and that the choice of different actions is influenced by the policy and the accumulated reward value. The action set is represented as A = {a1, a2, ..., a...}. n The set of environmental states is represented as S = {s1, s2, ..., s}. n Let the reward be denoted as r and the policy as π. In each iteration, the agent acquires information by perceiving the current environmental state s∈S, and based on the current policy π, assigns an action a∈A to influence the environment, thereby causing the environmental state to enter the next state s′∈S. Simultaneously, the agent receives a reinforcement signal (reward) r(s,a) as feedback. Based on this reward, the agent adjusts its policy and proceeds to the next iteration. Through continuous feedback learning, the Q-function is optimized. The process of optimizing the Q-function enables the agent to train the optimal policy π for each state. * (s t )∈A, thus approximating the goal of maximizing the long-term cumulative reward value, which is reflected in the formula: Where: V π (s) represents the cumulative reward value that can be obtained in state s when taking policy π, called the state value function; s represents the state at time t; π(s) t ) represents the strategy adopted at time t; γ represents the importance of the future cumulative reward compared to the current reward, called the time discount factor constant, ranging from (0,1). The maximum value of the cumulative reward can be obtained according to the Bellman optimality criterion, as shown in the following equation: Where R(s,a) is the mathematical expectation of taking action a in state s at different times; P s,s′(a) represents the transition probability of state s′ when action a is taken. Q-learning finds the optimal control policy π. * The idea is to associate each pair (s, a) under the control policy π with a Q-value, that is, to associate the reward for taking action a in state s with the Q-value. Efficient Q-value iteration satisfies the following formula: Then we get π. * (s)=argmaxQ * (s,a), Q passes through Q(s,a)=max{Q(s,a) next The iterative rules defined in )} are used to obtain Q. * (s,a):
[0102] Q t+1 (s,a)=(1-α)Q t (s,a)+α(r t +γmaxQ t (s′,a′)), where α is the learning rate, ranging from (0,1], calculated as the reciprocal of the total number of times (s,a) is accessed + 1. As t gradually increases, the Q-value of each pair (s,a) undergoes multiple updates. The Q-value table is updated based on the cumulative reward value, and the current action set and current environment state set are updated based on the updated Q-value table. The learning rate α gradually decreases. When the learning rate α decreases to 0, Q... t (s,a) converges to the optimal value. The initial dimensionality-reduced time series features are randomly divided into an action set and an environment state set. Iterative optimization is repeatedly performed based on the action set and the environment state set until the current cumulative reward value is less than the previous cumulative reward value, resulting in the final action set and the final environment state set. The target power time series features are determined based on the final action set and the final environment state set. The iterative optimization includes: updating the Q-value table based on the current action set and the current environment state set; the current action set and the current environment state set at the time of the initial iteration are the action set and the environment state set, respectively; calculating the current cumulative reward value based on the current action set and the environment state set; comparing the current cumulative reward value with the previous cumulative reward value; if the current cumulative reward value is less than the previous cumulative reward value, using the current action set and the current environment state set as the final action set and the final environment state set; if the current cumulative reward value is greater than the previous cumulative reward value, updating the Q-value table based on the cumulative reward value; and updating the current action set and the current environment state set based on the updated Q-value table. At this point, the derived policy is the optimal policy π. *The target power time series characteristics are defined as follows: Q-learning leverages its efficient exploration and utilization capabilities in complex environments to ensure precise optimization of the fit between the characteristics of each data subset and the kernel function. Subsequently, the power time series characteristics are divided into six sub-subsets, each corresponding to a most suitable kernel function. Dimensionality reduction is then performed using the optimal kernel function for each subset: these include a basic linear kernel, a Gaussian kernel (excellent at handling nonlinear relationships), a highly flexible polynomial kernel, a Laplace kernel (emphasizing local similarity), a cosine kernel (measuring directional similarity), and a Sigmoid kernel (simulating the decision boundary of a neural network). This yields the target power time series characteristics. Q-learning's improved KPCA intelligently selects the most suitable kernel function for the data characteristics, dynamically adapting to the complex data structure of the power grid, avoiding the limitations of a single kernel function selection, and improving the flexibility and efficiency of dimensionality reduction.
[0103] Preferably, the target power time-series features are clustered to obtain the final power data clustering result, including:
[0104] Based on the target power time series characteristics, several target power time series characteristics are randomly selected as initial cluster centers;
[0105] Based on the initial cluster centers and the target power time series characteristics, the clustering operation is repeated until the preset cost function converges, and the final power data clustering result is obtained.
[0106] The clustering operation includes:
[0107] Based on the current cluster center and the target power time series characteristics, the target power time series characteristics are assigned to the nearest current cluster center to obtain several time series characteristic clusters;
[0108] Several time-series feature clusters are used as the current power data clustering results; the current cluster center when the clustering operation is performed for the first time is the initial cluster center;
[0109] The cost function is calculated based on the current cluster center corresponding to the current power data clustering results and the target power time series characteristics.
[0110] When determining the convergence of the cost function, the current power data clustering result is taken as the final power data clustering result;
[0111] When the cost function is determined to be non-convergent, the Bayesian score is calculated based on the number of several time-series feature clusters, the number of target power time-series features, and the preset likelihood function; and the number of current cluster centers is updated based on the Bayesian score and the preset score threshold.
[0112] Update the current cluster centers based on the current number of cluster centers and several temporal feature clusters.
[0113] In a preferred embodiment of the present invention, the Bayesian score is the BIC score. The K-means clustering algorithm is an iterative machine learning analysis algorithm that divides sample data into different types based on the similarity of features among samples in a known dataset. Several target power time-series features are randomly selected as initial cluster centers based on the target power time-series features, denoted as... x i Let c be the time series feature of the i-th target power. i For x i The cluster to which it belongs Let M be the center point corresponding to the cluster, and M be the total number of target power time-series features. Let t = 0, 1, 2, ..., n be the number of iteration steps, and repeat the following process until the preset cost function J converges: Based on the current cluster center and the target power time-series features, assign the target power time-series features to the nearest current cluster center. Several temporal feature clusters are obtained. The current cluster center when the clustering operation is first performed is the initial cluster center. For each cluster center K, the center of that cluster is recalculated. Based on the current cluster centers corresponding to the current power data clustering results and the target power time series characteristics, calculate the cost function: When the cost function converges, the current power data clustering result is used as the final power data clustering result. The K-Means algorithm requires manual pre-determination of the initial K value, but this value may not accurately reflect the actual data distribution. The BIC criterion is used to determine the number of clusters in the K-Means algorithm. A BIC-KMeans algorithm is constructed to mine patterns in the uncertainty parameters of SWMM. When the cost function fails to converge, a Bayes score is calculated based on several time-series feature clusters, the number of target power time-series features, and a preset likelihood function. The number of current cluster centers is updated based on the Bayes score and a preset scoring threshold, avoiding the influence of subjective human selection of the K value on the clustering results. The BIC-KMeans algorithm comprehensively considers model complexity and accuracy issues in machine learning, avoiding overfitting and underfitting problems. The BIC score calculation formula is: B = mlnn - 2lnL, where B is the BIC score, m is the current number of cluster centers, n is the total number of target power time-series features, L is the likelihood function, and mlnn is the penalty term. A smaller BIC value indicates better K-means algorithm quality. Finally, the current cluster centers are updated based on the current number of cluster centers and several temporal feature clusters. BIC-KMeans can automatically determine the optimal number of clusters, reducing manual intervention and ensuring that the clustering results are neither overly subdivided nor excessively merged, thus improving the accuracy and practicality of clustering.
[0114] Schematic, before extracting time series features from the power operation data to obtain power time series features, the method further includes: preprocessing the power operation data to obtain the final power operation data;
[0115] The power operation data is preprocessed to obtain the final power operation data, including:
[0116] The missing values in the power operation data are processed to obtain the power operation data after removing the missing values.
[0117] Anomalies are identified based on the power operation data after removing missing values and the preset anomaly threshold to obtain abnormal power operation values.
[0118] Based on abnormal power operation values and a preset linear interpolation function, power operation correction values are calculated.
[0119] The power operation correction value is filled into the power operation data after removing missing values to obtain the final power operation data.
[0120] In a preferred embodiment of the present invention, generator output data, cross-sectional power flow data, and load data are meticulously screened. First, unreasonable data is eliminated to ensure accuracy and consistency. Duplicate generator names and load nodes are removed to prevent information redundancy. Then, records that are consistently zero, have extremely small values, or are highly inconsistent with the main data throughout the observation period are identified and removed. Outliers in the data are located using box plot analysis and reasonably corrected using linear interpolation techniques to restore data continuity and rationality. To further standardize the data, the Min-max standardization method is used to unify the measurement scale and range of all data. This reduces the interference caused by differences in data types and significant numerical variations in subsequent analysis, improves the accuracy and efficiency of calculations, and ensures the depth and reliability of the analysis results.
[0121] In another preferred embodiment of the present invention, attribute variables that can characterize the power grid operation mode are first determined, such as... Figure 3 The generator output data, cross-sectional power flow data, and load data are shown. Then, the dataset of operating scenarios, composed of candidate variables for clustering, undergoes data preprocessing and standardization. Next, the shapelet time series method is used to extract features under time series conditions that significantly distinguish different categories, and based on this, Q-learning-improved KPCA technology is used for dimensionality reduction. Finally, the BIC-KMeans clustering method is used to obtain clustering results, and the cluster center of each class is selected as a typical scenario of power grid operation.
[0122] Existing technologies utilize time-series memory and the nonlinear capabilities of autoencoders for time-series feature extraction, suitable for time-series data. They can effectively cluster data even with slight shifts in the time axis. However, these methods are computationally expensive on large-scale datasets, involve complex matching processes, and are sensitive to parameter selection; for example, the window size directly affects the matching results. This invention proposes a method to find several subsequences of power operation data through sliding, enabling time-series feature extraction from both linear and nonlinear data. It also boasts low computational cost, a simple subsequence extraction process that eliminates the need for complex matching, and the sliding window size does not affect the matching results. Existing technologies use clustering algorithms (such as K-means, hierarchical clustering, DBSCAN, Gaussian mixture models, etc.) to group power grid operating parameters, grouping similar operating conditions together to extract typical operating modes. However, this method requires pre-setting the number of clusters, and improper selection may affect classification results. Furthermore, it is sensitive to noise, and the initial point selection may affect the stability of the final results. It performs best for convex data distributions and has limited processing capabilities for non-convex datasets. This invention can determine the clustering effect based on Bayesian scoring values and then update the current number of cluster centers. It is not limited by a pre-set number of clusters, reducing the intervention of manually setting the number of clusters and ensuring that the clustering results are neither overly subdivided nor excessively merged, thus improving the accuracy and practicality of clustering. Existing technologies reduce data dimensionality by extracting the main features (i.e., principal components) from the data while preserving as much information as possible from the original data. In extracting power grid operation modes, PCA analysis is performed on the feature variables, and principal components with a cumulative contribution rate exceeding a certain threshold are selected as feature variables to extract typical power grid operation modes. This method mainly focuses on the direction of maximum variance, which may ignore small-variance features that have a significant impact on certain specific operation modes, and is also sensitive to outliers, which may lead to biased results. This invention can select the most suitable kernel function based on a preset kernel function, dynamically adapting to the complex data structure of the power grid, avoiding the limitations of a single kernel function selection, and improving the flexibility and efficiency of dimensionality reduction processing. Furthermore, it performs dimensionality reduction on all power time-series features, without primarily focusing on the direction of maximum variance, enabling overall dimensionality reduction of power time-series feature data.
[0123] This embodiment acquires power operation data of the power grid to be extracted. The power operation data includes generator output data, cross-sectional power flow data, and load data. Time series features are extracted from the power operation data to obtain power time-series features. Dimensionality reduction optimization is performed on the power time-series features to obtain target power time-series features. The target power time-series features are clustered to obtain power data clustering results. The cluster centers corresponding to the power data clustering results are used as the power grid operation mode to be extracted. By extracting time series features from the power grid's power operation data, power time-series features reflecting the dynamic characteristics of power grid operation are obtained, providing more accurate time-series features for subsequent power grid operation mode extraction. Then, dimensionality reduction optimization is performed on the power time-series features to adapt to the complex operating scenarios of large-scale power systems, avoiding the limitations of power grid operation mode extraction and improving the accuracy of power grid operation mode extraction. After clustering the target power time-series features, the cluster centers corresponding to the power data clustering results are used as the power grid operation mode, reducing manual intervention. A complete chain is formed from time series feature extraction, dimensionality reduction, and clustering to gradually extract the power grid operation mode, improving the accuracy of power grid operation mode extraction.
[0124] See Figure 2 This is a schematic diagram of a power grid operation mode extraction device according to an embodiment of the present invention, comprising:
[0125] The power data acquisition module is used to acquire the power operation data of the power grid to be extracted; the power operation data includes: generator output data, cross-sectional power flow data, and load data;
[0126] The power time series feature extraction module is used to extract time series features based on the power operation data to obtain power time series features.
[0127] The feature dimensionality reduction module is used to perform dimensionality reduction optimization based on the power time series features to obtain the target power time series features;
[0128] The power data clustering module is used to cluster the target power time-series features to obtain power data clustering results;
[0129] The operation mode extraction module is used to take the cluster centers corresponding to the power data clustering results as the power grid operation mode of the power grid to be extracted.
[0130] Preferably, it further includes: a data preprocessing module, used to preprocess the power operation data to obtain the final power operation data;
[0131] The power operation data is preprocessed to obtain the final power operation data, including:
[0132] The missing values in the power operation data are processed to obtain the power operation data after removing the missing values.
[0133] Anomalies are identified based on the power operation data after removing missing values and the preset anomaly threshold to obtain abnormal power operation values.
[0134] Based on abnormal power operation values and a preset linear interpolation function, power operation correction values are calculated; these correction values are then filled into the power operation data after removing missing values to obtain the final power operation data.
[0135] This invention provides a device for extracting power grid operation modes. The device acquires power operation data of the power grid to be extracted using a power data acquisition module. This power operation data includes generator output data, cross-sectional power flow data, and load data. A power time-series feature extraction module extracts time-series features from the power operation data. A feature dimensionality reduction module performs dimensionality reduction optimization based on the power time-series features to obtain target power time-series features. A power data clustering module clusters the target power time-series features to obtain power data clustering results. Finally, an operation mode extraction module uses the cluster centers corresponding to the power data clustering results as the power grid operation mode of the power grid to be extracted. By extracting time-series features from the power grid's operation data, we obtain power time-series features that reflect the dynamic characteristics of the power grid's operation, providing more accurate time-series features for subsequent power grid operation mode extraction. Then, we perform dimensionality reduction optimization on the power time-series features to adapt to the complex operation scenarios of large-scale power grid systems, avoiding the limitations of power grid operation mode extraction and improving the accuracy of power grid operation mode extraction. After clustering the target power time-series features, we use the cluster centers corresponding to the power data clustering results as the power grid operation modes, reducing manual intervention. By forming a complete chain from time-series feature extraction, dimensionality reduction, and clustering, we gradually extract the power grid operation modes, improving the accuracy of power grid operation mode extraction.
[0136] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0137] Those skilled in the art will understand that, for convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0138] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a method for extracting a power grid operation mode as described in the above embodiments. The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0139] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting various parts of the terminal device via various interfaces and lines.
[0140] The memory can be used to store the computer program. The processor implements various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0141] Another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power grid operation mode extraction method described in the above embodiment.
[0142] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0143] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for extracting power grid operation modes, characterized in that, include: Obtain the power operation data of the power grid to be extracted; The power operation data includes: generator output data, cross-sectional power flow data, and load data; Based on the power operation data, time series features are extracted to obtain power time series features; Dimensionality reduction optimization is performed based on the power time series characteristics to obtain the target power time series characteristics; The target power time-series features are clustered to obtain the final power data clustering results; The cluster centers corresponding to the final power data clustering results are used as the power grid operation modes of the power grid to be extracted. The target power time-series features are clustered to obtain the final power data clustering result, including: Based on the target power time series characteristics, several target power time series characteristics are randomly selected as initial cluster centers; Based on the initial cluster centers and the target power time series characteristics, the clustering operation is repeated until the preset cost function converges, and the final power data clustering result is obtained. The clustering operation includes: Based on the current cluster center and the target power time series characteristics, the target power time series characteristics are assigned to the nearest current cluster center to obtain several time series characteristic clusters; Several time-series feature clusters are used as the current power data clustering results; the current cluster center when the clustering operation is performed for the first time is the initial cluster center; The cost function is calculated based on the current cluster center corresponding to the current power data clustering results and the target power time series characteristics. When determining the convergence of the cost function, the current power data clustering result is taken as the final power data clustering result; When the cost function is determined to be non-convergent, the Bayesian score is calculated based on the number of several time-series feature clusters, the number of target power time-series features, and the preset likelihood function; and the number of current cluster centers is updated based on the Bayesian score and the preset score threshold. Update the current cluster centers based on the current number of cluster centers and several temporal feature clusters.
2. The method for extracting power grid operation modes as described in claim 1, characterized in that, Based on the power operation data, time series features are extracted to obtain power time series features, including: Based on the power operation data and the preset sliding window length, several subsequences of power operation data are found by sliding. Based on the power operation data and several power operation data subsequences, the distance value between the power operation data and each power operation data subsequence corresponding to the power operation data is calculated. Based on the power operation data, several power operation data subsequences, the distance value, and a preset distance threshold, the power time series characteristics are obtained.
3. The method for extracting power grid operation modes as described in claim 2, characterized in that, Based on the power operation data, several power operation data subsequences, the distance value, and a preset distance threshold, power time-series characteristics are obtained, including: The information gain is calculated based on several subsequences of power operation data, the distance value, and a preset distance threshold. When the information gain is maximized, the breakout point corresponding to the maximum information gain is taken as the target breakout point. Based on the target separation point and several power operation data subsequences, the power operation data subsequences that satisfy the target separation point are determined as the target time series; Based on the target time series and the power operation data, shape factor transformation is performed to extract power time series features.
4. The method for extracting power grid operation modes as described in claim 1, characterized in that, Dimensionality reduction optimization is performed based on the power time series characteristics to obtain the target power time series characteristics, including: Based on the power time series characteristics and the preset kernel function, the power time series characteristics are mapped to a high-dimensional space, and principal component analysis is performed on the mapped power time series characteristics in the high-dimensional space to obtain preliminary dimensionality-reduced time series characteristics; The initial dimensionality-reduced temporal features are randomly divided into an action set and an environment state set; Based on the action set and the environment state set, iterative optimization is repeatedly performed until the current cumulative reward value is less than the previous cumulative reward value, thus obtaining the final action set and the final environment state set. The target power timing characteristics are determined based on the final set of actions and the final set of environmental states. The iterative optimization includes: The Q-value table is updated based on the current action set and the current environment state set; the current action set and the current environment state set during the initial iteration optimization are the action set and the environment state set, respectively. Calculate the current cumulative reward value based on the current set of actions and the set of environmental states; Compare the current cumulative reward value with the previous cumulative reward value; If it is determined that the current cumulative reward value is less than the previous cumulative reward value, the current action set and the current environment state set are used as the final action set and the final environment state set. If the current cumulative reward value is determined to be greater than the previous cumulative reward value, the Q-value table is updated according to the cumulative reward value; and the current action set and the current environment state set are updated according to the updated Q-value table.
5. The method for extracting power grid operation modes as described in claim 1, characterized in that, Before extracting time series features from the power operation data to obtain power time series features, the method further includes: preprocessing the power operation data to obtain the final power operation data. The power operation data is preprocessed to obtain the final power operation data, including: The missing values in the power operation data are processed to obtain the power operation data after removing the missing values. Anomalies are identified based on the power operation data after removing missing values and the preset anomaly threshold to obtain abnormal power operation values. Based on abnormal power operation values and a preset linear interpolation function, power operation correction values are calculated. The power operation correction value is filled into the power operation data after removing missing values to obtain the final power operation data.
6. A device for extracting power grid operation modes, characterized in that, include: The power data acquisition module is used to acquire the power operation data of the power grid to be extracted; The power operation data includes: generator output data, cross-sectional power flow data, and load data; The power time series feature extraction module is used to extract time series features based on the power operation data to obtain power time series features. The feature dimensionality reduction module is used to perform dimensionality reduction optimization based on the power time series features to obtain the target power time series features; The power data clustering module is used to cluster the target power time-series features to obtain the final power data clustering result; The operation mode extraction module is used to take the cluster center corresponding to the final power data clustering result as the power grid operation mode of the power grid to be extracted; The power data clustering module is used to cluster the target power time-series features to obtain the final power data clustering result, including: Based on the target power time series characteristics, several target power time series characteristics are randomly selected as initial cluster centers; Based on the initial cluster centers and the target power time series characteristics, the clustering operation is repeated until the preset cost function converges, and the final power data clustering result is obtained. The clustering operation includes: Based on the current cluster center and the target power time series characteristics, the target power time series characteristics are assigned to the nearest current cluster center to obtain several time series characteristic clusters; Several time-series feature clusters are used as the current power data clustering results; the current cluster center when the clustering operation is performed for the first time is the initial cluster center; The cost function is calculated based on the current cluster center corresponding to the current power data clustering results and the target power time series characteristics. When determining the convergence of the cost function, the current power data clustering result is taken as the final power data clustering result; When the cost function is determined to be non-convergent, the Bayesian score is calculated based on the number of several time-series feature clusters, the number of target power time-series features, and the preset likelihood function; and the number of current cluster centers is updated based on the Bayesian score and the preset score threshold. Update the current cluster centers based on the current number of cluster centers and several temporal feature clusters.
7. The device for extracting power grid operation modes as described in claim 6, characterized in that, Also includes: The data preprocessing module is used to preprocess the power operation data to obtain the final power operation data; The power operation data is preprocessed to obtain the final power operation data, including: The missing values in the power operation data are processed to obtain the power operation data after removing the missing values. Anomalies are identified based on the power operation data after removing missing values and the preset anomaly threshold to obtain abnormal power operation values. Based on abnormal power operation values and a preset linear interpolation function, power operation correction values are calculated. The power operation correction value is filled into the power operation data after removing missing values to obtain the final power operation data.
8. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement a method for extracting a power grid operation mode as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a method for extracting a power grid operation mode as described in any one of claims 1 to 5.