Power network asset key feature extraction method, device, equipment and medium
Through the improved k-means clustering algorithm and attention mechanism, the problem that traditional methods are difficult to extract hidden patterns and key features in the data is solved, and more efficient and accurate feature extraction is achieved, supporting more accurate power network asset management and maintenance.
Patent Information
- Application Number
- CN202411656533.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Traditional power network asset data analysis methods are difficult to effectively capture hidden patterns and key features in data, especially when processing complex, multi-dimensional power data.
Using the improved k-means clustering algorithm and attention mechanism, the cluster analysis and feature extraction of the power network asset data is carried out by calculating the Mahayana distance and dynamic weight update strategy to obtain the optimized feature vector matrix.
Improve the accuracy and robustness of clustering analysis, extract more representative key features, enhance the efficiency and accuracy of data analysis, and support more accurate asset management, fault diagnosis and predictive maintenance.
Smart Images

Figure CN119577414A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer and information science and technology, and relates to a method, device, equipment and medium for extracting key features of power network assets. The method is applied to the classification and feature extraction of assets in the power system to improve the security and management efficiency of the power network. Background Art
[0002] In the power industry, the management and maintenance of power network assets are crucial to ensure the stable operation of the power grid and efficient energy distribution. With the development of smart grids, the amount of data on power network assets has increased dramatically. How to extract key features from these massive 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 incapable of processing complex and multi-dimensional power data. On the one hand, due to the diversity and complexity of power data, traditional methods are difficult to effectively capture hidden patterns and key features in the data; on the other hand, with the continuous advancement of smart grid technology, the demand for real-time monitoring and precise analysis of power network assets is becoming increasingly urgent, requiring data analysis methods to have a higher level of automation and intelligence. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device, equipment and medium for extracting key features of power network assets to solve the problem that traditional methods in the prior art are difficult to effectively capture hidden patterns and key features in data.
[0004] In order to achieve the above object, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for extracting key features of power network assets, comprising the following steps: Obtain power network asset data; The 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: in 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 center is updated based on dynamic weight update and adaptive learning rate; The attention mechanism is used to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain the optimized feature vector matrix.
[0005] Furthermore, the improved k-means clustering algorithm is used to perform cluster analysis on the power network asset data to obtain the key features of the power network assets, including: For power network asset data, randomly select a data point as the first cluster center; calculate the square of the minimum distance between the remaining data points and the selected cluster center, determine the selection probability based on the square of the minimum distance, and select the next cluster center based on the selection probability to obtain the full 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 center is iteratively updated based on dynamic weight update and adaptive learning rate until the preset conditions are met; wherein, after each iteration, the sum of squared intra-cluster errors of all clusters is calculated. If the sum of squared intra-cluster errors of a cluster exceeds the preset range, the number of cluster centers is adjusted.
[0006] Furthermore, the attention mechanism is used to perform feature weighted summation and nonlinear transformation processing on the key features obtained by clustering; wherein the feature 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 feature matrix; In the multiple heads of the adaptive multi-head attention mechanism, feature weighted summation is performed in parallel to obtain the weighted feature representation corresponding to each head; Concatenate the weighted feature representations from different heads to obtain the final feature representation; The final feature representation is transformed nonlinearly to obtain the optimized feature vector matrix.
[0007] Furthermore, in the multiple heads of the adaptive multi-head attention mechanism, feature weighted summation is performed in parallel to obtain the weighted feature representation corresponding to each head, including: For each head in the adaptive multi-head attention mechanism, the following steps are performed in parallel: The corresponding energy value of each eigenvector in the feature matrix is calculated using a feedforward neural network; the energy value is converted into an attention weight using the softmax function; and the calculated attention weight is used to perform weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation.
[0008] Furthermore, the final feature representation is subjected to nonlinear transformation to obtain an optimized feature vector matrix, including: The nonlinear transformation is performed according to the following formula: h ′′=Activation(Merge([ h 1′, h 2′,..., h H ′])) in,h ′′ is the final feature representation after nonlinear transformation; Activation is the activation function; Merge is the concatenation operation; h H ′ is the first link of the adaptive multi-head attention mechanism H Weighted feature representation of each head.
[0009] Furthermore, the corresponding energy value of each eigenvector in the feature matrix is calculated using a feedforward neural network; the energy value is converted into an attention weight using a softmax function, and each eigenvector in the feature matrix is weighted and summed using the calculated attention weight to obtain a weighted feature representation, including: Calculate the feature vector through a feedforward neural network i The corresponding energy value :
[0010] Based on the feature vector i The corresponding energy value , use the softmax function to calculate the attention weight of each feature :
[0011] Use the attention weights to perform weighted summation on the input features to obtain the weighted feature representation :
[0012] in, Represents the feature vector i .
[0013] Furthermore, after the step of acquiring the power network asset data, the step of preprocessing the power network asset data is also included, specifically including: Data normalization, missing value filling, outlier detection and data dimensionality reduction.
[0014] In a second aspect of the present invention, a device for extracting key features of power network assets is provided, comprising: A data acquisition module, used to acquire power network asset data; The clustering module is used to perform cluster analysis on the power network asset data using the improved k-means clustering algorithm to obtain the key features of the power network assets; wherein, the improvement of the k-means clustering algorithm is: in 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 center is updated based on dynamic weight update and adaptive learning rate; The feature extraction module is used to use the attention mechanism to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain an optimized feature vector matrix.
[0015] According to a third aspect of the present invention, there is provided an electronic device, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the above-mentioned method for extracting key features of power network assets.
[0016] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for extracting key features of power network assets as described above is implemented.
[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention proposes a method for extracting key features of power network assets. The method combines an improved k-means clustering algorithm and an attention mechanism, aiming to extract more representative key features from power network asset data. Specifically, the method first uses an improved k-means clustering algorithm to perform clustering analysis on the data, and improves the accuracy and robustness of clustering by calculating the Mahalanobis distance and dynamic weight update strategy; then, the attention mechanism is used to perform weighted summation and nonlinear transformation processing on the key features obtained by clustering, and an optimized feature vector matrix is obtained, which provides strong support for subsequent asset management, fault diagnosis and predictive maintenance. The device for extracting key features of power network assets, an electronic device and a computer-readable storage medium provided by the present invention also solve the problems raised in the background technology section.
[0018] By adopting the improved k-means clustering algorithm and calculating the Mahalanobis distance between each data point and each cluster center, the actual distance between data points can be more accurately reflected, avoiding the errors that may be caused by traditional Euclidean distance in some cases, making the clustering results closer to the actual distribution of the data and improving the accuracy of clustering analysis.
[0019] This solution introduces dynamic weight update and adaptive learning rate to iteratively update the cluster center, so that the clustering process can be adjusted according to the actual distribution of the data, enhancing the flexibility and adaptability of clustering. At the same time, by controlling the convergence of the clustering process through preset conditions, it can ensure that the clustering results meet both accuracy requirements and have a certain efficiency.
[0020] This solution uses the attention mechanism to perform weighted summation and nonlinear transformation on the key features obtained by clustering, highlighting the importance of key features and suppressing the influence of non-key features. It improves the quality of feature vectors and provides more powerful support for subsequent data analysis and processing.
[0021] By combining cluster analysis with the attention mechanism, this solution can quickly extract key features from a large amount of power network asset data and generate an optimized feature vector matrix. This greatly improves the efficiency and accuracy of data analysis and provides more reliable data support for the evaluation, management and maintenance of power network assets.
[0022] The extracted key features and optimized eigenvector matrix can be used in many aspects of power network assets, such as equipment condition monitoring, fault diagnosis, and predictive maintenance.
[0023] In summary, the beneficial effects of this scheme 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 important practical significance and application value for the management and maintenance of power network assets. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 A schematic diagram of a flow chart of a method for extracting key features of power network assets according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a device for extracting key features of power network assets according to an embodiment of the present invention; Figure 3 The present invention is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0026] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention.
[0027] Example 1 The embodiment of the present invention provides a method for extracting key features of power network assets, which is mainly used for classifying and extracting features of various types of assets in a power system to improve the management and safety detection efficiency of power network assets.
[0028] like Figure 1 As shown, a method for extracting key features of power network assets includes the following steps: S1. Obtain power network asset data; S2. Use the improved k-means clustering algorithm to perform cluster analysis on the power network asset data to obtain the key features of the power network assets; the improvement of the k-means clustering algorithm is that: in 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 center is updated based on dynamic weight update and adaptive learning rate; S3. Use the attention mechanism to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain the optimized feature vector matrix.
[0029] The present invention proposes a method for extracting key features of power network assets. By combining the improved k-means clustering algorithm and the attention mechanism, the key features of power network assets can be extracted more accurately and comprehensively. First, the power network asset data is preprocessed to ensure the consistency and integrity of the data; 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 to form the final feature vector matrix. This method is superior to traditional methods in both accuracy and robustness, and can significantly improve the safety and management efficiency of power network assets.
[0030] In order to further explain and illustrate the present invention, in an optional embodiment of the present solution, a method for extracting key features of power network assets is also provided, comprising the following steps: S100. Acquire power network asset data.
[0031] Specifically, power network asset data contains various types of information, including but not limited to equipment number, installation location, operating status, historical fault records, etc.
[0032] S200. Use an improved k-means clustering algorithm to perform cluster analysis on power network asset data to obtain key features of power network assets; wherein, the improvement of the k-means clustering algorithm is: in the clustering process, calculate the Mahalanobis distance between each data point and each cluster center, and assign the data point to the cluster center with the shortest distance; update the cluster center based on dynamic weight update and adaptive learning rate.
[0033] Specifically, the improved k-means clustering algorithm is used to perform cluster analysis on the power network asset data to obtain the key features of the power network assets, including: For the power network asset data, a data point is randomly selected as the first cluster center ; Calculate the remaining data points The square of the minimum distance to the selected cluster center , the selection probability is determined based on the square of the minimum distance , based on the probability of selection Select the next cluster center and get the whole k Cluster centers; For each data point, calculate the current data point and all cluster centers Mahalanobis distance d ij , assign each data point to the cluster to which the cluster center with the smallest Mahalanobis distance belongs; The Mahalanobis distance is calculated as follows:
[0034] For each cluster, the cluster center is iteratively updated based on dynamic weight update and adaptive learning rate until the preset conditions are met; wherein, after each iteration, the sum of squared intra-cluster errors of all clusters is calculated. If the sum of squared intra-cluster errors of a cluster exceeds the preset range, the number of cluster centers is adjusted.
[0035] New cluster centers C j 'for:
[0036] in, η is the learning rate, ω ij It is a data point x To cluster center C j The weight of S j For the j A cluster contains a set of data points.
[0037] After each iteration, the within-cluster sum of squared errors (SSE) is calculated for all clusters:
[0038] in, SSE j is the sum of squared errors within cluster j; SSE total is the sum of squared errors within all clusters. SSE is used to measure the clustering effect.
[0039] Optionally, the k-means clustering algorithm is implemented with the following improvements: 1) Use the k-means++ algorithm to select the initial cluster centers to reduce the algorithm's sensitivity to initial values and improve clustering stability; 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 based on the distance distribution between each data point and the selected center until all centers are selected.
[0040] 2) In the clustering process, the Mahalanobis distance is introduced as a distance metric to improve the adaptability to heterogeneous data; the Mahalanobis distance can consider the correlation between different features and is applicable to power network asset data containing a variety of different units and scales. For example, in 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.
[0041] 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, each time the algorithm updates the cluster center, it adjusts the weights according to the error of the current clustering, and uses an adaptive learning rate to avoid falling into the local optimum.
[0042] 4) After each clustering, the sum of squared errors (SSE) within the cluster is calculated to evaluate the clustering effect, and the number of clusters is automatically adjusted to achieve the best clustering effect. For example, when the SSE value of a class is significantly higher than that of other classes, the algorithm will further subdivide the class by increasing the number of clusters of that class. When judging whether the SSE value of a class is significantly higher than that of other classes, the threshold level can be set according to the actual situation.
[0043] S300, using the attention mechanism to perform feature weighted summation and nonlinear transformation processing on the key features obtained by clustering to obtain an optimized feature vector matrix.
[0044] Specifically, the weighted summation of features includes: The key features of power network assets are input into the adaptive multi-head attention mechanism in the form of feature matrix X; , m is the number of samples in the cluster, and n is the number of features. In the multiple heads of the adaptive multi-head attention mechanism, the weighted sum of features is performed in parallel to obtain the weighted feature representation corresponding to each head; the weighted feature representations from different heads are concatenated to obtain the final feature representation; the final feature representation is nonlinearly transformed to obtain the optimized feature vector matrix.
[0045] Specifically, in the multiple heads of the adaptive multi-head attention mechanism, feature weighted summation is performed in parallel to obtain the weighted feature representation corresponding to each head, including: For each head of the adaptive multi-head attention mechanism, the following steps are performed in parallel: each feature vector in the feature matrix X ish i Use feedforward neural network to calculate the corresponding energy value e i ; Use the softmax function to convert the energy value into attention weight; Use the calculated attention weight to perform weighted summation on each feature vector in the feature matrix to obtain a weighted feature representation.
[0046] Specifically, the final feature representation is subjected to nonlinear transformation to obtain an optimized feature vector matrix, including: The nonlinear transformation is performed according to the following formula: h ′′=Activation(Merge([ h 1′, h 2′,..., h H ′])) in, h ′′ is the final feature representation after nonlinear transformation; Activation is the activation function; Merge is the concatenation operation; h H ′ is the first link of the adaptive multi-head attention mechanism H Weighted feature representation of each head.
[0047] As a specific example, a feedforward neural network is used to calculate the corresponding energy value of each eigenvector in the feature matrix; the energy value is converted into an attention weight using a softmax function, and the calculated attention weight is used to perform weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation, including: Calculate the feature vector through a feedforward neural network i The corresponding energy value :
[0048] Based on the feature vector i The corresponding energy value , use the softmax function to calculate the attention weight of each feature :
[0049] Use the attention weights to perform weighted summation on the input features to obtain the weighted feature representation :
[0050] in, Represents the feature vector i .
[0051] Among the options, attention mechanism feature extraction includes: 1) Attention weight calculation. First, the clustered feature matrix is input into the attention mechanism to calculate the importance score of each feature. The features are processed through a feedforward neural network to calculate the attention weight of each feature. For example, in the feature vector of power equipment, some features (such as current fluctuations) may have a greater impact on the health of the asset, so they will be given a higher weight.
[0052] 2) Weighted summation of features. Based on the calculated attention weights, the features are weighted summed to generate optimized feature representations. This process is similar to weighted averaging in a neural network. By weighted summation, the most valuable feature information can be retained and irrelevant features can be filtered out.
[0053] 3) Adaptive multi-head attention mechanism. In order to enhance the model’s sensitivity to different feature combinations, an adaptive multi-head attention mechanism is used. This mechanism can capture the complex relationship between features by computing multiple attention heads in parallel and merging their results. This can improve the model’s ability to extract features from power network assets, especially when processing data with multiple feature types.
[0054] 4) Nonlinear transformation. To further enhance the complexity of feature representation, the feature vector is nonlinearly transformed after weighted summation. This step uses an activation function (such as ReLU or GELU) to perform nonlinear processing on the feature vector, thereby increasing the expressive power of the model.
[0055] Power network asset data usually contains multiple types of information, including but not limited to equipment number, installation location, operating status, historical fault records, etc. In the preferred solution, in order to improve the quality and consistency of the data, after the step of obtaining the power network asset data, the step of preprocessing the power network asset data is also included, specifically including: data normalization, missing value filling, outlier detection and data dimensionality reduction.
[0056] 1) Data normalization: Mapping data of different scales to the same numerical range (usually [0,1]) to eliminate the dimension effect. For example, the operating time and voltage values of a device are normalized so that they can be processed in the same algorithm.
[0057] 2) Missing value filling: Since some missing values may appear in the power network asset data during the collection process, appropriate methods need to be used to fill them. For numerical data, commonly used methods include mean filling and interpolation; for categorical data, mode filling can be used.
[0058] 3) Outlier detection: Use the z-score method to detect and remove outliers in the data. For example, if the running time of some equipment is significantly higher than the average, it may be an outlier caused by data collection errors and needs to be processed.
[0059] 4) Data dimensionality reduction: Use principal component analysis (PCA) to reduce the dimensionality of the data, retain the most representative features in the data, and reduce redundant information. For example, in a scenario containing multiple sensor data, PCA can map this data to a few main components, thereby simplifying subsequent analysis and processing.
[0060] In the preferred solution, after obtaining the optimized eigenvector matrix, the optimized eigenvector matrix is used for the safety detection and management of power network assets. It includes the following contents: 1) Feature selection and classification: Perform feature selection on the optimized feature vector, remove irrelevant or redundant features, and classify the features using machine learning classification algorithms (such as SVM and random forest). For example, high-risk assets in the power network can be identified through classification algorithms and further analyzed.
[0061] 2) Historical data matching and trend analysis: Match the classification results with historical data, analyze asset change trends, and generate safety inspection reports. For example, by comparing current asset characteristics with historical data, potential risk trends can be identified and early warnings can be provided.
[0062] 3) Dynamic feature update: In order to adapt to the dynamic changes of power network assets, the feature vector is 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 eliminated, the feature vector needs to be dynamically adjusted to ensure the accuracy and timeliness of the model.
[0063] 4) Safety detection and early warning: Based on the optimized feature vector, the system can automatically perform safety 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 handle it.
[0064] The optimized eigenvector matrix is used for the safety detection and management of power network assets. By comparing the scores of various features, abnormal assets are identified and further processed or warned, thus achieving effective management and safety detection of power network assets.
[0065] Example 2 like Figure 2 As shown, based on the same inventive concept as the above embodiment, the present invention also provides a device for extracting key features of power network assets, including: A data acquisition module, used to acquire power network asset data; The clustering module is used to perform cluster analysis on the power network asset data using the improved k-means clustering algorithm to obtain the key features of the power network assets; wherein, the improvement of the k-means clustering algorithm is: in 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 center is updated based on dynamic weight update and adaptive learning rate; The feature extraction module is used to use the attention mechanism to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain an optimized feature vector matrix.
[0066] Example 3 like Figure 3 As shown, the present invention also provides an electronic device 100 for implementing a method for extracting key features of power network assets in Example 1; 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 the at least one processor 102 , and at least one communication bus 104 .
[0067] The memory 101 can be used to store a computer program 103 , and the processor 102 implements the steps of a method for extracting key features of power network assets in Example 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101 .
[0068] The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data (such as audio data) created according to the use of the electronic device 100, etc. In addition, the memory 101 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0069] At least one processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor, etc. The processor 102 is the control center of the electronic device 100, and uses various interfaces and lines to connect various parts of the entire electronic device 100.
[0070] The memory 101 in the electronic device 100 stores a plurality of instructions to implement a method for extracting key features of power network assets, and the processor 102 can execute the plurality of instructions to implement: Obtain power network asset data; The 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: in 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 center is updated based on dynamic weight update and adaptive learning rate; The attention mechanism is used to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain the optimized feature vector matrix.
[0071] Example 4 If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).
[0072] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented 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.
[0073] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0074] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0076] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does 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: The steps include: Obtain power network asset data; The 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: in 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 center is updated based on dynamic weight update and adaptive learning rate; The attention mechanism is used to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain the optimized feature vector matrix.
2. The method for extracting key features of power network assets according to claim 1, characterized in that: The 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, including: For power network asset data, randomly select a data point as the first cluster center; calculate the square of the minimum distance between the remaining data points and the selected cluster center, determine the selection probability based on the square of the minimum distance, and select the next cluster center based on the selection probability to obtain the full 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 center is iteratively updated based on dynamic weight update and adaptive learning rate until the preset conditions are met; wherein, after each iteration, the sum of squared intra-cluster errors of all clusters is calculated. If the sum of squared intra-cluster errors of a cluster exceeds the preset range, the number of cluster centers is adjusted.
3. The method for extracting key features of power network assets according to claim 1, characterized in that: The attention mechanism is used to perform feature weighted summation and nonlinear transformation processing on the key features obtained by clustering; wherein, the feature 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 feature matrix; In the multiple heads of the adaptive multi-head attention mechanism, feature weighted summation is performed in parallel to obtain the weighted feature representation corresponding to each head; Concatenate the weighted feature representations from different heads to obtain the final feature representation; The final feature representation is transformed nonlinearly to obtain the optimized feature vector matrix.
4. The method for extracting key features of power network assets according to claim 3, characterized in that: In the multiple heads of the adaptive multi-head attention mechanism, feature weighted summation is performed in parallel to obtain the weighted feature representation corresponding to each head, including: For each head in the adaptive multi-head attention mechanism, the following steps are performed in parallel: The corresponding energy value of each eigenvector in the feature matrix is calculated using a feedforward neural network; the energy value is converted into an attention weight using the softmax function; and the calculated attention weight is used to perform weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation.
5. The method for extracting key features of power network assets according to claim 3, characterized in that: The final feature representation is transformed nonlinearly to obtain the optimized feature vector matrix, including: The nonlinear transformation is performed according to the following formula: h ′′=Activation(Merge([ h 1′, h 2′,..., h H ′])) in, h ′′ is the final feature representation after nonlinear transformation; Activation is the activation function; Merge is the concatenation operation; h H ′ is the first link of the adaptive multi-head attention mechanism H Weighted feature representation of each head.
6. The method for extracting key features of power network assets according to claim 4, characterized in that: The corresponding energy value of each eigenvector in the feature matrix is calculated using a feedforward neural network; the energy value is converted into an attention weight using the softmax function, and the calculated attention weight is used to perform a weighted summation on each eigenvector in the feature matrix to obtain a weighted feature representation, including: Calculate the feature vector through a feedforward neural network i The corresponding energy value : Based on the feature vector i The corresponding energy value , use the softmax function to calculate the attention weight of each feature : Use the attention weights to perform weighted summation on the input features to obtain the weighted feature representation : in, Represents the feature vector i .
7. The method for extracting key features of power network assets according to claim 1, characterized in that: After the step of acquiring the power network asset data, the step of preprocessing the power network asset data is also included, specifically including: Data normalization, missing value filling, outlier detection and data dimensionality reduction.
8. A device for extracting key features of power network assets, characterized in that: include: A data acquisition module, used to acquire power network asset data; The clustering module is used to perform cluster analysis on the power network asset data using the improved k-means clustering algorithm to obtain the key features of the power network assets; the improvement of the k-means clustering algorithm is that: in 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 center is updated based on dynamic weight update and adaptive learning rate; The feature extraction module is used to use the attention mechanism to perform weighted summation and nonlinear transformation on the key features obtained by clustering to obtain an optimized feature vector matrix.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the method for extracting key features of power network assets as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for extracting key features of power network assets according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Power consumer portraying method and device, equipment and medium
CN114897097A
Information analysis method based on big data distributed framework
CN114936611A
Deep embedded load clustering method and device based on node daily load curve
CN115563368A
Virtual power plant regulation load decomposition and identification method
CN115587311A
Load prediction method based on K-means clustering and convolutional neural network model
CN115983477A
Cited By
Method and device for obtaining key semantic enhancement features and medium
CN121527598A