CVT error prediction method, system, device and medium based on dual-stage attention mechanism
Through the dual-stage attention mechanism method, the problems of feature selection and time node selection in error prediction of capacitive voltage transformer are solved, the prediction accuracy is improved, and the accuracy of the future error state of capacitive voltage transformer is realized, which is enhanced. The stability of the power system and the life of the equipment.
Patent Information
- Application Number
- CN202411104667.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-08-13
AI Technical Summary
The prior art has failed to effectively solve the impact of input data feature selection and time node selection on prediction accuracy in capacitive voltage transformer error prediction, resulting in insufficient prediction accuracy.
The method based on the two-stage attention mechanism is adopted to adaptively select feature data through input attention mechanism and time attention mechanism, update the input matrix, and combine the multi-layer convolutional neural network model to predict error states.
It improves the accuracy of error prediction of capacitive voltage transformers, can accurately predict future errors of equipment based on historical data, provide early warning and adjustment suggestions, extend the service life of the equipment, and improve the stability of the power system.
Smart Images

Figure CN118643875B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a CVT error prediction method, system, equipment and medium based on a dual-stage attention mechanism, and belongs to the technical field of power equipment state monitoring. Background Art
[0002] Capacitor voltage transformer (CVT) is an important device in the power system, used to measure and monitor voltage. However, with the aging of equipment, environmental factors and other factors, the error of capacitor voltage transformer may change, which will affect the stable operation of the power system. Therefore, it is of great significance to predict the error of capacitor voltage transformer. By monitoring and predicting the error, potential problems of equipment can be discovered in time, the operating efficiency of the power system can be improved, and the service life of the equipment can be extended. Therefore, the research and application of error prediction technology of capacitor voltage transformer should be strengthened to improve the stability and reliability of the power system.
[0003] Existing technologies, such as the Chinese invention patent with publication number CN117475158A, disclose a capacitive voltage transformer error prediction method, which specifically utilizes the characteristics of local area connection, weight sharing and spatial sampling of convolutional neural networks, and fully captures the complex nonlinear relationship between multiple factors in the input data through a multi-scale convolutional neural network; then further learns the timing information in the features through a bidirectional gated recurrent unit network; finally, the channel attention mechanism and the spatial attention mechanism are used to assign weights to the key areas of the features to enhance the expressive power of the key features, thereby improving the accuracy of CVT error prediction.
[0004] The above-mentioned existing technologies do not take into account that the input data contains a variety of features. The introduction of different features has a great impact on the prediction accuracy. Moreover, for the data at various historical moments, the feature data at different time nodes have corresponding characteristics. How to perform feature selection on the input data and select the input data at the appropriate time nodes to improve the prediction accuracy is an urgent problem that needs to be solved. Summary of the invention
[0005] In order to solve the above-mentioned problems existing in the prior art, the present invention proposes a CVT error prediction method, system, device and medium based on a dual-stage attention mechanism.
[0006] The technical solution of the present invention is as follows:
[0007] On the one hand, the present invention proposes a CVT error prediction method based on a dual-stage attention mechanism, comprising the following steps:
[0008] Collecting characteristic data related to the error state of the target capacitor mutual inductor at historical moments, and constructing a first input matrix based on the collected characteristic data, wherein rows and columns of the first input matrix correspond to categories and moments of the characteristic data respectively;
[0009] Input the first input matrix into the first CNN model to obtain a first output result;
[0010] Perform a fusion calculation based on the input attention mechanism on the first input matrix and the first output result, obtain the correlation between the first output result and each category of feature data in the first input matrix, and update the first input matrix based on the correlation to obtain the second input matrix;
[0011] Input the second input matrix into the second CNN model to obtain a second output result, and input the second output result into the third CNN model to obtain a third output result;
[0012] Perform a fusion calculation based on the time attention mechanism on the second input matrix and the third output result, obtain the attention degree of the third output result to the data at each moment in the second input matrix, and update the third output result based on the attention degree of the data at each moment to obtain the fourth output result;
[0013] The third output result and the fourth output result are integrated to obtain the error state prediction result of the target capacitor mutual inductor at a future moment.
[0014] As a preferred implementation, the step of performing fusion calculation on the first input matrix and the first output result based on the input attention mechanism is specifically as follows:
[0015] Perform one-dimensional convolution on the first output result by column to obtain a one-dimensional feature matrix as the query Query of the attention mechanism;
[0016] Use the feature data set of each category as the key of the attention mechanism;
[0017] Perform dot product calculation on the query Query and the key Key to obtain the first attention score between the one-dimensional feature matrix and the feature data group of each category, and normalize each obtained first attention score to obtain the attention degree of the one-dimensional feature matrix to the feature data group of each category;
[0018] The first input matrix is updated based on the attention degree of each category of the feature data group of the one-dimensional feature matrix to obtain the second input matrix.
[0019] As a preferred implementation, the step of performing fusion calculation based on the time attention mechanism on the second input matrix and the third output result is specifically:
[0020] The third output result is used as the query Query of the temporal attention mechanism;
[0021] The data at each moment in the second input matrix is used as the key of the temporal attention mechanism;
[0022] Perform dot product calculation on the query Query of the time attention mechanism and the key Key to obtain the second attention score between the data at each moment in the second input matrix and the third output result, normalize each obtained second attention score, and obtain the second attention degree of the third output result to the data at each moment in the second input matrix;
[0023] The fourth output result is obtained by updating the third output result based on the second output result for the second attention degree of the data at each moment in the second input matrix.
[0024] As a preferred implementation, in the step of fusing the third output result and the fourth output result, a gating mechanism is specifically used for the fusion.
[0025] On the other hand, the present invention also proposes a CVT error prediction system based on a dual-stage attention mechanism, comprising:
[0026] A data acquisition module, used to collect characteristic data related to the error state of the target capacitor mutual inductor at historical moments, and construct a first input matrix based on the collected characteristic data, wherein the rows and columns of the first input matrix correspond to the categories and moments of the characteristic data respectively;
[0027] A first prediction module, used for inputting a first input matrix into a first CNN model to obtain a first output result;
[0028] An input attention mechanism introduction module is used to perform a fusion calculation based on the input attention mechanism on the first input matrix and the first output result, obtain the correlation between the first output result and each category of feature data in the first input matrix, and update the first input matrix based on the correlation to obtain the second input matrix;
[0029] A second prediction module is used to input the second input matrix into the second CNN model to obtain a second output result, and input the second output result into the third CNN model to obtain a third output result;
[0030] A temporal attention mechanism introduction module is used to perform a fusion calculation based on the temporal attention mechanism on the second input matrix and the third output result, obtain the attention degree of the third output result to the data at each moment in the second input matrix, and update the third output result based on the attention degree of the data at each moment to obtain the fourth output result;
[0031] The prediction result fusion module is used to fuse the third output result and the fourth output result to obtain the error state prediction result of the target capacitor mutual inductor at a future moment.
[0032] As a preferred implementation, the input attention mechanism is introduced into the module, and the steps of performing fusion calculation based on the input attention mechanism on the first input matrix and the first output result are specifically as follows:
[0033] Perform one-dimensional convolution on the first output result by column to obtain a one-dimensional feature matrix as the query Query of the attention mechanism;
[0034] Use the feature data set of each category as the key of the attention mechanism;
[0035] Perform dot product calculation on the query Query and the key Key to obtain the first attention score between the one-dimensional feature matrix and the feature data group of each category, and normalize each obtained first attention score to obtain the attention degree of the one-dimensional feature matrix to the feature data group of each category;
[0036] The first input matrix is updated based on the attention degree of each category of the feature data group of the one-dimensional feature matrix to obtain the second input matrix.
[0037] As a preferred implementation, the temporal attention mechanism is introduced into the module, and the steps of performing fusion calculation based on the temporal attention mechanism on the second input matrix and the third output result are specifically as follows:
[0038] The third output result is used as the query Query of the temporal attention mechanism;
[0039] The data at each moment in the second input matrix is used as the key of the temporal attention mechanism;
[0040] Perform dot product calculation on the query Query of the time attention mechanism and the key Key to obtain the second attention score between the data at each moment in the second input matrix and the third output result, normalize each obtained second attention score, and obtain the second attention degree of the third output result to the data at each moment in the second input matrix;
[0041] The fourth output result is obtained by updating the third output result based on the second output result for the second attention degree of the data at each moment in the second input matrix.
[0042] As a preferred implementation, in the fusion module, a gating mechanism is specifically used to fuse the third output result and the fourth output result.
[0043] On the other hand, the present invention also proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the CVT error prediction method based on the dual-stage attention mechanism as described in any embodiment of the present invention is implemented.
[0044] On the other hand, the present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the CVT error prediction method based on the dual-stage attention mechanism as described in any embodiment of the present invention.
[0045] The present invention has the following beneficial effects:
[0046] The present invention discloses a CVT error prediction method based on a dual-stage attention mechanism, which introduces an input attention mechanism and a time attention mechanism, adaptively selects input features, and selects input data according to key time nodes, and can accurately predict future errors of a device based on historical data. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a schematic diagram of a method flow chart of Embodiment 1 of the present invention;
[0048] Figure 2 Schematic diagram of the input attention mechanism introduced in the embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the working of the temporal attention mechanism introduced in an embodiment of the present invention;
[0050] Figure 4 is a schematic diagram of performing one-dimensional convolution on a first input matrix in an embodiment of the present invention;
[0051] Figure 5 It is a schematic diagram of performing one-dimensional convolution on the intermediate matrix in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.
[0054] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0055] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0056] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.
[0057] Embodiment 1:
[0058] See also Figure 1 This embodiment provides a CVT error prediction method based on a dual-stage attention mechanism, which can predict the future error of the device according to historical data and give corresponding warnings and adjustment suggestions, specifically including the following steps:
[0059] S100, collecting characteristic data related to the error state of the target capacitor transformer (CVT) at a historical moment. In this embodiment, the characteristic data includes the ratio difference data, temperature, frequency and other influencing factor data of the CVT, and the specific error state of the CVT;
[0060] Construct the first input matrix based on the collected feature data , the first input matrix The rows and columns correspond to the categories and moments of the feature data, that is, ,in is the category of feature data, is the time step.
[0061] S200, the first input matrix Input into the first CNN (convolutional neural network) model to obtain the first output result ; In the first CNN model, zero padding is used to ensure that the input and output sizes of the model are consistent. The zero padding method refers to filling zeros around the input matrix, that is, the first output result is .
[0062] S300, see Figure 2 , for the first input matrix And the first output result Perform fusion calculation based on input attention mechanism to obtain the first output result With the first input matrix The correlation of each category of feature data in is used to update the first input matrix based on the correlation to obtain the second input matrix ; This step introduces an input attention mechanism, which can adaptively select the input features of the model based on the output results of the model. It can also be understood as using the input attention mechanism to the first input matrix Preprocessing was performed.
[0063] S400, the second input matrix Input into the second CNN model to obtain the second output result , the network structure of the second CNN model should be completely consistent with the network structure of the first CNN model, so as to adaptively select the input features of the model according to the output results of the model and improve the adaptability of the model to the input data;
[0064] The second output result Input into the third CNN model to obtain the third output result ; At this time That is, the candidate target capacitor transformer error state prediction value for the next step. The last layer of the third CNN model should be set to a fully connected layer, and the output step size should be set to 1.
[0065] S500, see Figure 3 , for the second input matrix And the third output result Perform fusion calculation based on the time attention mechanism to obtain the third output result For the second input matrix The attention degree of the data at each moment in the third output result is updated based on the attention degree of the data at each moment Get the fourth output result ; Since the second input matrix After passing through multiple CNN models, the original information is lost, resulting in poor mapping ability between the original data and the predicted data. At the same time, in time series prediction, special attention should be paid to the impact of a single time step on the predicted data. Therefore, the present invention introduces a temporal attention mechanism. The time points that have a greater impact on the prediction results are adaptively selected in the step sizes.
[0066] S600: Fusing the third output result and the fourth output result, and using the fused prediction result obtained by fusion as the error state prediction result of the target capacitor mutual inductor at a future moment.
[0067] As a preferred implementation of this embodiment, in step S300, the step of performing fusion calculation based on the input attention mechanism on the first input matrix and the first output result is specifically:
[0068] S301: For the convenience of calculation, the first output result Perform one-dimensional convolution by column to obtain a one-dimensional feature matrix As the query of the attention mechanism, the specific process is as follows Figure 4 As shown, Figure 4 middle, Representative size is The convolution kernel of the first output result Each column of data in is convolved with the convolution kernel to finally obtain a one-dimensional feature matrix .
[0069] S302, each category of feature data group is used as the key of the attention mechanism, that is, Key is ,in It is a feature data set for each category; the value of the attention mechanism is set to the same as the value of Key.
[0070] S303, perform dot product calculation on the query Query and the key Key to obtain the first attention score between the one-dimensional feature matrix and the feature data group of each category, and the specific formula is:
[0071] ;
[0072] in, is a one-dimensional feature matrix The first attention score between the feature data set of the k-th category;
[0073] S304, normalize each first attention score obtained to obtain the attention degree of the one-dimensional feature matrix for each category of feature data group. The specific formula is:
[0074] ;
[0075] in, is a one-dimensional feature matrix The attention paid to the feature data group of the kth category, is an exponential function;
[0076] S305, based on one-dimensional feature matrix The first input matrix is updated for the attention level of each category of feature data group to obtain the second input matrix. The specific update formula is:
[0077] ;
[0078] Where T is the transpose. The attention of each category of feature data group is used as the weight, and the weight is assigned to each category of feature data group to obtain the second input matrix .
[0079] As a preferred implementation, in step S500, the step of performing fusion calculation based on the time attention mechanism on the second input matrix and the third output result is specifically:
[0080] S501: Output the third result Query as a temporal attention mechanism;
[0081] S502: Use the data at each moment in the second input matrix as the key of the temporal attention mechanism, that is, the Key of the temporal attention mechanism is , is the data at the sth moment in the second input matrix; the value of the time attention mechanism is set to the same as the Key value.
[0082] S503: Perform dot product calculation on the query Query of the time attention mechanism and the key Key to obtain the data at each moment in the second input matrix and the third output result The second attention score between is calculated as follows:
[0083] ;
[0084] in, The data at the sth moment in the second input matrix and the third output result The second attention score between .
[0085] S504: normalize each of the obtained second attention scores to obtain a third output result The specific formula for the second attention degree of the data at each moment in the second input matrix is:
[0086] ;
[0087] in, The third output result The second attention to the data at the sth moment in the second input matrix, is an exponential function;
[0088] Based on the third output The second attention to the data at each moment in the second input matrix Update the third output result to obtain the fourth output result First, the data at each moment in the second input matrix is compared with the second attention Multiply and add to get the intermediate matrix , , the specific formula is:
[0089] ;
[0090] For the intermediate matrix Perform a one-dimensional convolution attention mechanism, the process is as follows Figure 5 As shown, Representative size is The convolution kernel of the intermediate matrix Each row of data in is convolved with the convolution kernel, and the convolution result is the fourth output result , , the fourth output result Contains the third output result Key information about all previous moments in time.
[0091] As a preferred implementation of this embodiment, in step S600, in the step of fusing the third output result and the fourth output result, a gating mechanism is specifically used for fusion, and the specific formula is as follows:
[0092]
[0093] in, , Respectively represent the third output results And the fourth output result The importance of the final prediction result. are the trainable weight parameters respectively. are the bias parameters respectively, is the sigmoid function, The fusion prediction results.
[0094] Based on the above embodiments, accurate prediction of the error state of a capacitive voltage transformer is achieved.
[0095] Embodiment 2:
[0096] This embodiment proposes a CVT error prediction system based on a dual-stage attention mechanism, including:
[0097] A data acquisition module, used to collect characteristic data related to the error state of the target capacitor mutual inductor at historical moments, and construct a first input matrix based on the collected characteristic data, wherein the rows and columns of the first input matrix correspond to the categories and moments of the characteristic data respectively; this module is used to implement the function of step S100 in the first embodiment, and will not be described in detail here;
[0098] A first prediction module, used to input the first input matrix into the first CNN model to obtain a first output result; this module is used to implement the function of step S200 in the first embodiment, which will not be described in detail here;
[0099] An input attention mechanism introduction module is used to perform a fusion calculation based on the input attention mechanism on the first input matrix and the first output result, obtain the correlation between the first output result and each category of feature data in the first input matrix, and update the first input matrix based on the correlation to obtain the second input matrix; this module is used to implement the function of step S300 in the first embodiment, and will not be repeated here;
[0100] A second prediction module, used for inputting the second input matrix into the second CNN model to obtain a second output result, and inputting the second output result into the third CNN model to obtain a third output result; this module is used to implement the function of step S400 in the first embodiment, which will not be described in detail here;
[0101] A temporal attention mechanism introduction module performs a fusion calculation based on the temporal attention mechanism on the second input matrix and the third output result, obtains the attention degree of the third output result to the data at each moment in the second input matrix, and updates the third output result based on the attention degree of the data at each moment to obtain the fourth output result; this module is used to implement the function of step S500 in the first embodiment, and will not be repeated here;
[0102] The prediction result fusion module is used to fuse the third output result and the fourth output result to obtain the error state prediction result of the target capacitor transformer at a future moment; this module is used to implement the function of step S600 in embodiment 1, which will not be repeated here.
[0103] As a preferred implementation of this embodiment, the input attention mechanism is introduced into the module, and the steps of performing fusion calculation based on the input attention mechanism on the first input matrix and the first output result are specifically as follows:
[0104] Perform one-dimensional convolution on the first output result by column to obtain a one-dimensional feature matrix as the query Query of the attention mechanism;
[0105] Use the feature data set of each category as the key of the attention mechanism;
[0106] Perform dot product calculation on the query Query and the key Key to obtain the first attention score between the one-dimensional feature matrix and the feature data group of each category, and normalize each obtained first attention score to obtain the attention degree of the one-dimensional feature matrix to the feature data group of each category;
[0107] The first input matrix is updated based on the attention degree of each category of the feature data group of the one-dimensional feature matrix to obtain the second input matrix.
[0108] As a preferred implementation of this embodiment, the temporal attention mechanism is introduced into the module, and the steps of performing fusion calculation based on the temporal attention mechanism on the second input matrix and the third output result are specifically as follows:
[0109] The third output result is used as the query Query of the temporal attention mechanism;
[0110] The data at each moment in the second input matrix is used as the key of the temporal attention mechanism;
[0111] Perform dot product calculation on the query Query of the time attention mechanism and the key Key to obtain the second attention score between the data at each moment in the second input matrix and the third output result, normalize each obtained second attention score, and obtain the second attention degree of the third output result to the data at each moment in the second input matrix;
[0112] The fourth output result is obtained by updating the third output result based on the second output result for the second attention degree of the data at each moment in the second input matrix.
[0113] As a preferred implementation of this embodiment, in the fusion module, a gating mechanism is specifically used to fuse the third output result and the fourth output result.
[0114] Embodiment three:
[0115] This embodiment proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the CVT error prediction method based on the dual-stage attention mechanism as described in any embodiment of the present invention is implemented.
[0116] Embodiment 4:
[0117] This embodiment proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the CVT error prediction method based on the dual-stage attention mechanism as described in any embodiment of the present invention is implemented.
[0118] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0119] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0121] In several embodiments provided in the present application, if any function 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 technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.
[0122] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A CVT error prediction method based on a dual-stage attention mechanism, characterized in that: The following steps are involved: Collect characteristic data related to the error state of the target capacitor mutual inductor at historical moments, and construct a first input matrix based on the collected characteristic data, wherein the rows and columns of the first input matrix correspond to the category and time of the characteristic data, respectively, that is, the first input matrix is ,in is the category of feature data, is the time step; Input the first input matrix into the first CNN model to obtain a first output result; In the first CNN model, zero padding is used to ensure that the input and output sizes of the model are consistent; That is, the first output result is ; Perform a fusion calculation based on the input attention mechanism on the first input matrix and the first output result, obtain the correlation between the first output result and each category of feature data in the first input matrix, and update the first input matrix based on the correlation to obtain the second input matrix; Inputting the second input matrix into the second CNN model to obtain a second output result, wherein the network structure of the second CNN model is consistent with the network structure of the first CNN model; The second output result is input into the third CNN model to obtain the third output result. The third output result is That is, the candidate target capacitor transformer error state prediction value for the next step, the last layer of the third CNN model is set to a fully connected layer, and the output step size is set to 1; Perform a fusion calculation based on the time attention mechanism on the second input matrix and the third output result, obtain the attention degree of the third output result to the data at each moment in the second input matrix, and update the third output result based on the attention degree of the data at each moment to obtain the fourth output result; The third output result and the fourth output result are integrated to obtain an error state prediction result of the target capacitor mutual inductor at a future moment; The step of performing fusion calculation on the first input matrix and the first output result based on the input attention mechanism is specifically as follows: Perform one-dimensional convolution on the first output result by column to obtain a one-dimensional feature matrix as the query Query of the attention mechanism; Use the feature data set of each category as the key of the attention mechanism; Perform dot product calculation on the query Query and the key Key to obtain the first attention score between the one-dimensional feature matrix and the feature data group of each category, and normalize each obtained first attention score to obtain the attention degree of the one-dimensional feature matrix to the feature data group of each category; Based on the one-dimensional feature matrix, the attention degree of each category of feature data group is updated to obtain a second input matrix; The step of performing fusion calculation based on the time attention mechanism on the second input matrix and the third output result is specifically as follows: The third output result is used as the query Query of the temporal attention mechanism; The data at each moment in the second input matrix is used as the key of the temporal attention mechanism; Perform dot product calculation on the query Query of the time attention mechanism and the key Key to obtain the second attention score between the data at each moment in the second input matrix and the third output result, normalize each obtained second attention score, and obtain the second attention degree of the third output result to the data at each moment in the second input matrix; The fourth output result is obtained by updating the third output result based on the second output result for the second attention degree of the data at each moment in the second input matrix.
2. According to claim 1, a CVT error prediction method based on a dual-stage attention mechanism is characterized in that: In the step of fusing the third output result and the fourth output result, a gating mechanism is specifically used for fusion.
3. A CVT error prediction system based on a dual-stage attention mechanism, characterized in that: include: The data acquisition module is used to collect characteristic data related to the error state of the target capacitor mutual inductor at historical moments, and construct a first input matrix based on the collected characteristic data, wherein the rows and columns of the first input matrix correspond to the category and time of the characteristic data respectively; that is, the first input matrix is ,in is the category of feature data, is the time step; A first prediction module, used for inputting a first input matrix into a first CNN model to obtain a first output result; In the first CNN model, zero padding is used to ensure that the input and output sizes of the model are consistent; That is, the first output result is ; An input attention mechanism introduction module is used to perform a fusion calculation based on the input attention mechanism on the first input matrix and the first output result, obtain the correlation between the first output result and each category of feature data in the first input matrix, and update the first input matrix based on the correlation to obtain the second input matrix; A second prediction module is used to input the second input matrix into the second CNN model to obtain a second output result, and the network structure of the second CNN model is consistent with the network structure of the first CNN model; The second output result is input into the third CNN model to obtain the third output result. The third output result is That is, the candidate target capacitor transformer error state prediction value for the next step, the last layer of the third CNN model is set to a fully connected layer, and the output step size is set to 1; A temporal attention mechanism introduction module is used to perform a fusion calculation based on the temporal attention mechanism on the second input matrix and the third output result, obtain the attention degree of the third output result to the data at each moment in the second input matrix, and update the third output result based on the attention degree of the data at each moment to obtain the fourth output result; A prediction result fusion module, used for fusing the third output result and the fourth output result to obtain a prediction result of the error state of the target capacitor mutual inductor at a future moment; The input attention mechanism is introduced into the module, and the steps of performing fusion calculation based on the input attention mechanism on the first input matrix and the first output result are specifically as follows: Perform one-dimensional convolution on the first output result by column to obtain a one-dimensional feature matrix as the query Query of the attention mechanism; Use the feature data set of each category as the key of the attention mechanism; Perform dot product calculation on the query Query and the key Key to obtain the first attention score between the one-dimensional feature matrix and the feature data group of each category, and normalize each obtained first attention score to obtain the attention degree of the one-dimensional feature matrix to the feature data group of each category; Based on the one-dimensional feature matrix, the attention degree of each category of feature data group is updated to obtain a second input matrix; The temporal attention mechanism is introduced into the module, and the steps of performing fusion calculation based on the temporal attention mechanism on the second input matrix and the third output result are specifically as follows: The third output result is used as the query Query of the temporal attention mechanism; The data at each moment in the second input matrix is used as the key of the temporal attention mechanism; Perform dot product calculation on the query Query of the time attention mechanism and the key Key to obtain the second attention score between the data at each moment in the second input matrix and the third output result, normalize each obtained second attention score, and obtain the second attention degree of the third output result to the data at each moment in the second input matrix; The fourth output result is obtained by updating the third output result based on the second output result for the second attention degree of the data at each moment in the second input matrix.
4. A CVT error prediction system based on a dual-stage attention mechanism according to claim 3, characterized in that: In the fusion module, a gating mechanism is specifically used to fuse the third output result and the fourth output result.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the CVT error prediction method based on the dual-stage attention mechanism as described in any one of claims 1 to 2 is implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the CVT error prediction method based on the dual-stage attention mechanism as described in any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Capacitive voltage transformer error prediction method, device, equipment and medium
CN117475158A
Text sentiment classification method and system
CN111881291A
Motor fault diagnosis method based on residual image attention network
CN112834921A
Method and device for processing self-attention mechanism, and convolutional neural network model
CN116150561A
CVT error prediction method and device and storage medium
CN117668746A
