A method, apparatus, equipment, and medium for extracting key features of power network assets.
By using an improved k-means clustering algorithm and attention mechanism, Mahalanobis distance and dynamic weight updates are calculated to extract key features of power network assets, solving the problem that traditional methods struggle to capture hidden patterns and enabling more efficient data analysis and management.
Patent Information
- Application Number
- CN202411656533.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Traditional power grid asset data analysis methods struggle to effectively capture hidden patterns and key features in the data, failing to meet the smart grid's demands for real-time monitoring and precise analysis.
An improved k-means clustering algorithm combined with an attention mechanism is adopted. By calculating Mahalanobis distance and dynamically updating weights, key features of power network assets are extracted, and feature weighted summation and nonlinear transformation are performed.
It improves the accuracy and flexibility of cluster analysis, optimizes feature representation, and enhances the efficiency and accuracy of data analysis, providing reliable data support for the management and maintenance of power network assets.
Smart Images

Figure CN119577414B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer and information science and technology, and relates to a method, apparatus, equipment, and medium for extracting key features of power network assets. It is applied to the classification and feature extraction of assets in power systems, improving the security and management efficiency of power networks. Background Technology
[0002] In the power industry, the management and maintenance of power network assets are crucial for ensuring the stable operation of the power grid and efficient energy distribution. With the development of smart grids, the amount of data from power network assets has increased dramatically. How to extract key features from this massive amount of data to support more accurate asset management, fault diagnosis, and predictive maintenance has become an urgent problem to be solved. Traditional power network asset data analysis methods often rely on expert experience or simple statistical analysis, which are inadequate when dealing with complex and multidimensional power data. On the one hand, due to the diversity and complexity of power data, traditional methods struggle to effectively capture hidden patterns and key features; on the other hand, with the continuous advancement of smart grid technology, the demand for real-time monitoring and accurate analysis of power network assets is increasingly urgent, requiring data analysis methods to have a higher level of automation and intelligence. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, device, and medium for extracting key features of power network assets, so as to solve the problem that traditional methods in the prior art are difficult to effectively capture hidden patterns and key features in data.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] In a first aspect, the present invention provides a method for extracting key features of power network assets, comprising the following steps:
[0006] Acquire power network asset data;
[0007] An improved k-means clustering algorithm was used to perform cluster analysis on power network asset data to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is as follows: during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate.
[0008] An attention mechanism is used to perform feature weighting and nonlinear transformation on the key features obtained from clustering to obtain an optimized feature vector matrix.
[0009] Furthermore, an improved k-means clustering algorithm was used to perform cluster analysis on the power network asset data to obtain the key features of the power network assets, including:
[0010] For power network asset data, a data point is randomly selected as the first cluster center; the square of the minimum distance between the remaining data points and the selected cluster center is calculated, and the selection probability is determined based on the square of the minimum distance. The next cluster center is selected based on the selection probability, thus obtaining the complete cluster center. k Cluster centers;
[0011] For each data point, calculate the Mahalanobis distance between the current data point and all cluster centers, and assign each data point to the cluster to which the cluster center with the smallest Mahalanobis distance belongs;
[0012] For each cluster, the cluster centers are iteratively updated based on dynamic weight updates and adaptive learning rates until a preset condition is met. After each iteration, the sum of squared errors within all clusters is calculated. If the sum of squared errors within a cluster exceeds a preset range, the number of cluster centers is adjusted.
[0013] Furthermore, an attention mechanism is used to perform weighted summation and nonlinear transformation on the key features obtained from clustering; the weighted summation includes the following steps:
[0014] The key features of power network assets are input into the adaptive multi-head attention mechanism in the form of a feature matrix.
[0015] In the adaptive multi-head attention mechanism, the weighted summation of features is performed in parallel across multiple heads to obtain the weighted feature representation for each head.
[0016] The weighted feature representations from different heads are concatenated to obtain the final feature representation;
[0017] The final feature representation is subjected to a nonlinear transformation to obtain the optimized feature vector matrix.
[0018] Furthermore, in the adaptive multi-head attention mechanism, feature weighted summation is performed in parallel across multiple heads to obtain the weighted feature representation for each head, including:
[0019] For each head in the adaptive multi-head attention mechanism, the following steps are performed in parallel:
[0020] The energy value of each eigenvector in the feature matrix is calculated using a feedforward neural network; the energy value is converted into attention weights using the softmax function; and the calculated attention weights are used to perform a weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation.
[0021] Furthermore, the final feature representation is subjected to a nonlinear transformation to obtain an optimized feature vector matrix, including:
[0022] Perform the nonlinear transformation according to the following formula:
[0023] h ′′=Activation(Merge([ h 1′, h 2′,..., h H ′]))
[0024] in, h '′' represents the final feature representation after nonlinear transformation; Activation is the activation function; Merge is the concatenation operation; h H ′ is the first step in the adaptive multi-head attention mechanism. H Weighted feature representation of size.
[0025] Furthermore, each eigenvector in the feature matrix is used to calculate its corresponding energy value using a feedforward neural network; the energy value is then converted into attention weights using a softmax function, and the calculated attention weights are used to perform a weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation, including:
[0026] Calculate feature vectors using a feedforward neural network. i Corresponding energy value :
[0027]
[0028] Based on feature vectors i Corresponding energy value The attention weights for each feature are calculated using the softmax function. :
[0029]
[0030] We use attention weights to perform a weighted summation of the input features to obtain a weighted feature representation. :
[0031]
[0032] in, Representing the eigenvector i .
[0033] Furthermore, following the step of acquiring power network asset data, the process also includes a preprocessing step for the power network asset data, specifically including:
[0034] Data normalization, missing value imputation, outlier detection, and data dimensionality reduction.
[0035] In a second aspect, the present invention provides a device for extracting key features of power network assets, comprising:
[0036] The data acquisition module is used to acquire power network asset data;
[0037] The clustering module is used to perform cluster analysis on power network asset data using an improved k-means clustering algorithm to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is that, during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate.
[0038] The feature extraction module is used to perform weighted summation and nonlinear transformation on the key features obtained from clustering using an attention mechanism to obtain an optimized feature vector matrix.
[0039] In a third aspect, the present invention provides an electronic device including a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the method for extracting key features of power network assets as described above.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium storing at least one instruction that, when executed by a processor, implements the method for extracting key features of power network assets as described above.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] This invention proposes a method for extracting key features of power network assets. This method combines an improved k-means clustering algorithm and an attention mechanism to extract more representative key features from power network asset data. Specifically, the method first uses an improved k-means clustering algorithm to perform cluster analysis on the data, improving the accuracy and robustness of clustering by calculating Mahalanobis distance and employing a dynamic weight update strategy. Then, the key features obtained from clustering are weighted and subjected to nonlinear transformation using an attention mechanism to obtain an optimized feature vector matrix, providing strong support for subsequent asset management, fault diagnosis, and predictive maintenance. The power network asset key feature extraction device, electronic device, and computer-readable storage medium provided by this invention also solve the problems raised in the background section.
[0043] By employing an improved k-means clustering algorithm, the Mahalanobis distance between each data point and each cluster center is calculated, which can more accurately reflect the actual distance between data points and avoid the errors that may be caused by traditional Euclidean distance in some cases. This makes the clustering results closer to the true distribution of the data and improves the accuracy of cluster analysis.
[0044] This scheme introduces dynamic weight updates and adaptive learning rates to iteratively update cluster centers, enabling the clustering process to adjust according to the actual distribution of the data, thus enhancing the flexibility and adaptability of clustering. Simultaneously, by controlling the convergence of the clustering process through preset conditions, it ensures that the clustering results meet both accuracy requirements and efficiency.
[0045] This scheme utilizes an attention mechanism to perform weighted summation and nonlinear transformation on the key features obtained from clustering, highlighting the importance of key features and suppressing the influence of non-key features. This improves the quality of feature vectors and provides stronger support for subsequent data analysis and processing.
[0046] This solution combines clustering analysis with an attention mechanism to quickly extract key features from large amounts of power network asset data and generate an optimized feature vector matrix. This significantly improves the efficiency and accuracy of data analysis, providing more reliable data support for the assessment, management, and maintenance of power network assets.
[0047] The extracted key features and optimized feature vector matrix can be used for various aspects of power network assets, such as equipment condition monitoring, fault diagnosis, and predictive maintenance.
[0048] In summary, the beneficial effects of this solution are reflected in improving the accuracy of cluster analysis, enhancing the flexibility and adaptability of clustering, optimizing feature representation, improving the efficiency and accuracy of data analysis, and supporting the comprehensive management of power network assets. It has significant practical implications and application value for the management and maintenance of power network assets. Attached Figure Description
[0049] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0050] Figure 1 This is a flowchart illustrating a method for extracting key features of power network assets according to an embodiment of the present invention.
[0051] Figure 2 This is a structural block diagram of a power network asset key feature extraction device according to an embodiment of the present invention;
[0052] Figure 3 This is a structural block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0053] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0054] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0055] Example 1
[0056] This invention provides a method for extracting key features of power network assets, which is mainly used to classify and extract features of various assets in the power system, so as to improve the efficiency of power network asset management and security detection.
[0057] like Figure 1 As shown, a method for extracting key features of power network assets includes the following steps:
[0058] S1. Obtain power network asset data;
[0059] S2. An improved k-means clustering algorithm is used to perform cluster analysis on power network asset data to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is as follows: during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate.
[0060] S3. Use the attention mechanism to perform feature weighting and nonlinear transformation on the key features obtained from clustering to obtain the optimized feature vector matrix.
[0061] This invention proposes a method for extracting key features of power network assets. By combining an improved k-means clustering algorithm with an attention mechanism, it can extract key features of power network assets more accurately and comprehensively. First, the power network asset data is preprocessed to ensure data consistency and integrity. Then, the improved k-means clustering algorithm is used to perform cluster analysis on the data to identify key features. Finally, the attention mechanism is used to further extract and optimize these key features, forming the final feature vector matrix. This method outperforms traditional methods in both accuracy and robustness, and can significantly improve the security and management efficiency of power network assets.
[0062] To further explain and illustrate the present invention, in an optional embodiment, this solution also provides a method for extracting key features of power network assets, including the following steps:
[0063] S100, Obtain power network asset data.
[0064] Specifically, power network asset data includes various types of information, including but not limited to equipment number, installation location, operating status, and historical fault records.
[0065] S200. An improved k-means clustering algorithm is used to perform cluster analysis on power network asset data to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is that, during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance. The cluster centers are updated based on dynamic weight updates and adaptive learning rate.
[0066] Specifically, an improved k-means clustering algorithm is used to perform cluster analysis on power network asset data to obtain key features of power network assets, including:
[0067] For power grid asset data, a data point is randomly selected as the first cluster center. ;
[0068] Calculate the remaining data points The square of the minimum distance to the selected cluster centers The selection probability is determined based on the square of the minimum distance. Based on selection probability Select the next cluster center to get the whole k Cluster centers;
[0069] For each data point, calculate the relationship between the current data point and all cluster centers. Mahalanobis distance between d ijEach data point is assigned to the cluster whose cluster center has the smallest Mahalanobis distance;
[0070] Mahalanobis distance is calculated using the following formula:
[0071]
[0072] For each cluster, the cluster centers are iteratively updated based on dynamic weight updates and adaptive learning rates until a preset condition is met. After each iteration, the sum of squared errors within all clusters is calculated. If the sum of squared errors within a cluster exceeds a preset range, the number of cluster centers is adjusted.
[0073] New cluster center C j 'for:
[0074]
[0075] in, η It's the learning rate. ω ij Data points x To the cluster center C j The weights; S j For the first j Each cluster contains a set of data points.
[0076] After each iteration, the sum of squared intra-cluster errors (SSE) for all clusters is calculated:
[0077]
[0078] in, SSE j Let be the sum of squared errors within cluster j; SSE total SSE is the sum of squared errors within all clusters. SSE is used to measure clustering performance.
[0079] Alternatively, the k-means clustering algorithm can be implemented with the following improvements:
[0080] 1) The k-means++ algorithm is used to initialize the cluster centers to reduce the sensitivity of the algorithm to the initial values and improve the stability of the clustering. For example, in the process of selecting the initial cluster centers, the algorithm first randomly selects a data point as the first cluster center, and then selects the next center point according to the distance distribution between each data point and the selected center, until all centers are selected.
[0081] 2) Mahalanobis distance is introduced as a distance metric during the clustering process to improve adaptability to heterogeneous data. Mahalanobis distance can take into account the correlation between different features and is suitable for power network asset data containing multiple different units and scales. For example, during the clustering process, the algorithm calculates the Mahalanobis distance between each data point and each cluster center and assigns the data point to the cluster center with the shortest distance.
[0082] 3) During the iteration process, the update weights of the cluster centers are dynamically adjusted, and an adaptive learning rate optimization algorithm is introduced to ensure the stability and accuracy of clustering. Specifically, the algorithm adjusts the weights according to the current clustering error each time the cluster centers are updated, and uses an adaptive learning rate to avoid getting trapped in local optima.
[0083] 4) After each clustering operation, the sum of squared errors within each cluster (SSE) is calculated to evaluate the clustering effect, and the number of clusters is automatically adjusted to achieve the best clustering results. For example, when the SSE value of a certain cluster is significantly higher than that of other clusters, the algorithm will further subdivide the cluster by increasing the number of clusters in that cluster. A threshold level can be set to determine whether the SSE value of a certain cluster is significantly higher than that of other clusters, based on the actual situation.
[0084] S300. The key features obtained from clustering are subjected to feature weighting summation and nonlinear transformation using an attention mechanism to obtain an optimized feature vector matrix.
[0085] Specifically, feature-weighted summation includes:
[0086] The key features of power network assets are input into the adaptive multi-head attention mechanism in the form of a feature matrix X; whereby... Where m is the number of samples within a cluster, and n is the number of features. In the adaptive multi-head attention mechanism, the features are weighted and summed in parallel across multiple heads to obtain the weighted feature representation for each head; the weighted feature representations from different heads are concatenated to obtain the final feature representation; and the final feature representation is subjected to a nonlinear transformation to obtain the optimized feature vector matrix.
[0087] More specifically, in the adaptive multi-head attention mechanism, feature weighting and summing are performed in parallel across multiple heads to obtain the weighted feature representation for each head, including:
[0088] For each head in the adaptive multi-head attention mechanism, the following steps are performed in parallel: For each feature vector in the feature matrix X... h i The corresponding energy value is calculated using a feedforward neural network. e iThe energy values are converted into attention weights using the softmax function; the calculated attention weights are then used to sum the weighted features of each feature vector in the feature matrix to obtain a weighted feature representation.
[0089] More specifically, the final feature representation undergoes a nonlinear transformation to obtain an optimized feature vector matrix, including:
[0090] Perform the nonlinear transformation according to the following formula:
[0091] h ′′=Activation(Merge([ h 1′, h 2′,..., h H ′]))
[0092] in, h '′' represents the final feature representation after nonlinear transformation; Activation is the activation function; Merge is the concatenation operation; h H ′ is the first step in the adaptive multi-head attention mechanism. H Weighted feature representation of size.
[0093] As a concrete example, each eigenvector in the feature matrix is used to calculate its corresponding energy value using a feedforward neural network; the energy value is then converted into attention weights using a softmax function; and the calculated attention weights are used to perform a weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation, including:
[0094] Calculate feature vectors using a feedforward neural network. i Corresponding energy value :
[0095]
[0096] Based on feature vectors i Corresponding energy value The attention weights for each feature are calculated using the softmax function. :
[0097]
[0098] We use attention weights to perform a weighted summation of the input features to obtain a weighted feature representation. :
[0099]
[0100] in, Representing the eigenvector i .
[0101] Among the optional approaches, attention mechanism feature extraction includes:
[0102] 1) Attention Weight Calculation. First, the clustered feature matrix is input into the attention mechanism to calculate the importance score for each feature. Then, a feedforward neural network processes the features to calculate the attention weight for each feature. For example, in the feature vector of power equipment, some features (such as current fluctuations) may have a greater impact on the asset's health and therefore will be assigned higher weights.
[0103] 2) Weighted feature summation. Based on the calculated attention weights, the features are summed using weighted methods to generate an optimized feature representation. This process is similar to weighted averaging in a neural network; by using weighted summation, the most valuable feature information can be retained while irrelevant features are filtered out.
[0104] 3) Adaptive Multi-Head Attention Mechanism. To enhance the model's sensitivity to different feature combinations, an adaptive multi-head attention mechanism is employed. This mechanism computes multiple attention heads in parallel and merges their results, thereby capturing complex relationships between features. This improves the model's feature extraction capability for power network assets, especially when processing data with multiple feature types.
[0105] 4) Nonlinear Transformation. To further enhance the complexity of the feature representation, a nonlinear transformation is performed on the feature vectors after weighted summation. This step uses activation functions (such as ReLU or GELU) to nonlinearly process the feature vectors, thereby increasing the expressive power of the model.
[0106] Power network asset data typically contains various types of information, including but not limited to equipment numbers, installation locations, operating status, and historical fault records. In a preferred embodiment, to improve data quality and consistency, after acquiring the power network asset data, a preprocessing step is included, specifically: data normalization, missing value imputation, outlier detection, and data dimensionality reduction.
[0107] 1) Data normalization: Mapping data of different scales to the same numerical range (usually [0,1]) to eliminate the influence of dimensions. For example, normalizing the operating time and voltage values of a device so that they can be processed in the same algorithm.
[0108] 2) Missing value imputation: Since some data on power network assets may be missing during the data collection process, appropriate methods need to be used to impute them. For numerical data, common methods include mean imputation and interpolation; for categorical data, mode imputation can be used.
[0109] 3) Outlier Detection: Outlier detection and removal are performed using the z-score method. For example, if the running time of some devices is significantly higher than the average, it may be an outlier caused by data acquisition errors and needs to be handled.
[0110] 4) Data Dimensionality Reduction: Principal Component Analysis (PCA) is used to reduce the dimensionality of the data, retaining the most representative features and reducing redundant information. For example, in scenarios containing data from multiple sensors, PCA can map these data to a few principal components, thereby simplifying subsequent analysis and processing.
[0111] In the preferred embodiment, after obtaining the optimized eigenvector matrix, the optimized eigenvector matrix is used for the security detection and management of power network assets. This includes the following:
[0112] 1) Feature Selection and Classification: Feature selection is performed on the optimized feature vector to remove irrelevant or redundant features, and machine learning classification algorithms (such as SVM and random forest) are used to classify the features. For example, high-risk assets in the power network can be identified through classification algorithms and further analysis can be performed.
[0113] 2) Historical Data Matching and Trend Analysis: The classification results are matched with historical data to analyze asset change trends and generate a security inspection report. For example, by comparing current asset characteristics with historical data, potential risk trends can be identified and early warnings can be provided.
[0114] 3) Dynamic Feature Updates: To adapt to the dynamic changes in power network assets, feature vectors are updated in real time and new data is introduced. For example, during the operation of the power network, as new equipment is added and old equipment is decommissioned, feature vectors need to be dynamically adjusted to ensure the accuracy and timeliness of the model.
[0115] 4) Security Detection and Early Warning: Based on the optimized feature vectors, the system can automatically perform security detection, identify abnormal assets in the power network, and generate early warning signals. For example, if the feature vector of a certain device highly matches the characteristics of a high-risk asset, the system will automatically trigger an early warning and notify relevant personnel to take action.
[0116] The optimized feature vector matrix is used for the security detection and management of power network assets. By comparing the scores of various features, abnormal assets are identified, and further processing or early warnings are issued for them, thereby achieving effective management and security detection of power network assets.
[0117] Example 2
[0118] like Figure 2 As shown, based on the same inventive concept as the above embodiments, the present invention also provides a device for extracting key features of power network assets, comprising:
[0119] The data acquisition module is used to acquire power network asset data;
[0120] The clustering module is used to perform cluster analysis on power network asset data using an improved k-means clustering algorithm to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is that, during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate.
[0121] The feature extraction module is used to perform weighted summation and nonlinear transformation on the key features obtained from clustering using an attention mechanism to obtain an optimized feature vector matrix.
[0122] Example 3
[0123] like Figure 3 As shown, the present invention also provides an electronic device 100 for implementing the method for extracting key features of power network assets according to Embodiment 1;
[0124] The electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on at least one processor 102, and at least one communication bus 104.
[0125] The memory 101 can be used to store computer program 103. The processor 102 implements the steps of the method for extracting key features of power network assets in Embodiment 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101.
[0126] The memory 101 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the electronic device 100 (such as audio data), etc. In addition, the memory 101 may 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 non-volatile solid-state storage device.
[0127] At least one processor 102 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 102 may be a microprocessor or any conventional processor. Processor 102 is the control center of electronic device 100, connecting various parts of electronic device 100 via various interfaces and lines.
[0128] The memory 101 in the electronic device 100 stores multiple instructions to implement a method for extracting key features of power network assets, and the processor 102 can execute multiple instructions to achieve the following:
[0129] Acquire power network asset data;
[0130] An improved k-means clustering algorithm was used to perform cluster analysis on power network asset data to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is as follows: during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate.
[0131] An attention mechanism is used to perform feature weighting and nonlinear transformation on the key features obtained from clustering to obtain an optimized feature vector matrix.
[0132] Example 4
[0133] If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, and read-only memory (ROM).
[0134] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0135] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0138] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for extracting key features of power network assets, characterized in that, Includes the following steps: Acquire power network asset data; An improved k-means clustering algorithm was used to perform cluster analysis on power network asset data to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is as follows: during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate. An attention mechanism is used to perform weighted summation and nonlinear transformation on the key features obtained from clustering to obtain an optimized feature vector matrix. An improved k-means clustering algorithm was used to perform cluster analysis on power network asset data to obtain key features of power network assets, including: For power network asset data, a data point is randomly selected as the first cluster center; the square of the minimum distance between the remaining data points and the selected cluster center is calculated, and the selection probability is determined based on the square of the minimum distance. The next cluster center is selected based on the selection probability, thus obtaining the complete cluster center. k Cluster centers; For each data point, calculate the Mahalanobis distance between the current data point and all cluster centers, and assign each data point to the cluster to which the cluster center with the smallest Mahalanobis distance belongs; For each cluster, the cluster centers are iteratively updated based on dynamic weight updates and adaptive learning rates until a preset condition is met. After each iteration, the sum of squared errors within all clusters is calculated. If the sum of squared errors within a cluster exceeds a preset range, the number of cluster centers is adjusted.
2. The method for extracting key features of power network assets according to claim 1, characterized in that, The key features obtained from clustering are processed by weighted summation and nonlinear transformation using an attention mechanism; the weighted summation includes the following steps: The key features of power network assets are input into the adaptive multi-head attention mechanism in the form of a feature matrix. In the adaptive multi-head attention mechanism, the weighted summation of features is performed in parallel across multiple heads to obtain the weighted feature representation for each head. The weighted feature representations from different heads are concatenated to obtain the final feature representation; The final feature representation is subjected to a nonlinear transformation to obtain the optimized feature vector matrix.
3. The method for extracting key features of power network assets according to claim 2, characterized in that, In the adaptive multi-head attention mechanism, feature weighting and summation are performed in parallel across multiple heads to obtain the weighted feature representation for each head, including: For each head in the adaptive multi-head attention mechanism, the following steps are performed in parallel: The energy value of each eigenvector in the feature matrix is calculated using a feedforward neural network; the energy value is converted into attention weights using the softmax function; and the calculated attention weights are used to perform a weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation.
4. The method for extracting key features of power network assets according to claim 2, characterized in that, The final feature representation is then subjected to a nonlinear transformation to obtain an optimized feature vector matrix, including: Perform the nonlinear transformation according to the following formula: h ′′=Activation(Merge([ h 1′, h 2′,..., h H ′])) in, h '′' represents the final feature representation after nonlinear transformation; Activation is the activation function; Merge is the concatenation operation; h H ′ is the first step in the adaptive multi-head attention mechanism. H Weighted feature representation of size.
5. The method for extracting key features of power network assets according to claim 3, characterized in that, Each eigenvector in the feature matrix is used to calculate its corresponding energy value using a feedforward neural network; the energy value is then converted into attention weights using a softmax function; and the calculated attention weights are used to perform a weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation, including: Calculate feature vectors using a feedforward neural network. i Corresponding energy value : Based on feature vectors i Corresponding energy value The attention weights for each feature are calculated using the softmax function. : We use attention weights to perform a weighted summation of the input features to obtain a weighted feature representation. : in, Representing the eigenvector i .
6. The method for extracting key features of power network assets according to claim 1, characterized in that, Following the step of acquiring power network asset data, the process also includes a preprocessing step for the power network asset data, specifically including: Data normalization, missing value imputation, outlier detection, and data dimensionality reduction.
7. A device for extracting key features of power network assets, characterized in that, include: The data acquisition module is used to acquire power network asset data; The clustering module is used to perform cluster analysis on power network asset data using an improved k-means clustering algorithm to obtain the key features of power network assets. The improvement of the k-means clustering algorithm is that, during the clustering process, the Mahalanobis distance between each data point and each cluster center is calculated, and the data point is assigned to the cluster center with the shortest distance; the cluster centers are updated based on dynamic weight updates and adaptive learning rate. The feature extraction module is used to perform weighted summation and nonlinear transformation on the key features obtained from clustering using an attention mechanism to obtain an optimized feature vector matrix. An improved k-means clustering algorithm was used to perform cluster analysis on power network asset data to obtain key features of power network assets, including: For power network asset data, a data point is randomly selected as the first cluster center; the square of the minimum distance between the remaining data points and the selected cluster center is calculated, and the selection probability is determined based on the square of the minimum distance. The next cluster center is selected based on the selection probability, thus obtaining the complete cluster center. k Cluster centers; For each data point, calculate the Mahalanobis distance between the current data point and all cluster centers, and assign each data point to the cluster to which the cluster center with the smallest Mahalanobis distance belongs; For each cluster, the cluster centers are iteratively updated based on dynamic weight updates and adaptive learning rates until a preset condition is met. After each iteration, the sum of squared errors within all clusters is calculated. If the sum of squared errors within a cluster exceeds a preset range, the number of cluster centers is adjusted.
8. An electronic device, characterized in that, It includes a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the method for extracting key features of power network assets as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the method for extracting key features of power network assets as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Power consumer portraying method and device, equipment and medium
CN114897097A
Intelligent decision-making method and system fusing deep clustering and Transform model
CN118940100A