Multi-dimensional LSTM power cable optical power prediction method and system based on space-time attention mechanism
The multi-dimensional LSTM power optical cable optical power prediction method through the spatio-temporal attention mechanism, combined with data collection, principal component analysis and Bi-LSTM model, solves the problem of inaccurate optical power prediction in the existing technology and achieves more accurate and reliable optical power prediction. Power prediction, suitable for performance management and optimization of optical fiber transmission systems.
Patent Information
- Application Number
- CN202410712517.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-03
AI Technical Summary
Existing optical power prediction methods fail to fully consider the spatiotemporal changing trends and environmental factors in optical fiber transmission systems, resulting in inaccurate and unreliable prediction results.
A multi-dimensional LSTM power optical cable optical power prediction method based on the spatiotemporal attention mechanism is adopted. Through data collection, principal component analysis, double-layer atrous convolution network and the Bi-LSTM model of the attention mechanism, time, space and environmental factors are comprehensively considered to conduct Prediction of optical power data.
It improves the accuracy and reliability of optical power prediction, can fill in the blank areas of data, provides more comprehensive prediction results, adapts to the needs of different scenarios, and meets the requirements of real-time monitoring.
Smart Images

Figure CN118735032A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical power prediction, and more specifically to a multi-dimensional LSTM power optical cable optical power prediction method and system based on a spatiotemporal attention mechanism. Background Art
[0002] In the power communication system, power optical fiber has become a mainstream communication method and has been widely used in recent years due to its many advantages such as large communication capacity, low transmission loss and good anti-electromagnetic interference. As a key component of the power communication system, the stability of the power optical fiber communication system transmission is an important guarantee for the efficient production and stable operation of the power sector. Once the power optical fiber line fails, the resulting communication interruption will bring huge economic losses to enterprises and users. As one of the important indicators for measuring the quality of optical fiber transmission, optical power plays a key role in the normal operation and performance evaluation of the power communication system. Due to the complexity and diversity of the optical fiber transmission system, the optical power will be affected by many factors during the transmission process, including but not limited to optical fiber loss, environmental meteorological changes, ambient temperature, transmission distance, etc. Existing optical power prediction methods often fail to consider the combined impact of these factors, resulting in inaccurate and unreliable prediction results.
[0003] Existing optical power prediction methods mainly focus on the optical power at a single time point or location, ignoring the changing trends in time and space. In practical applications, optical power will show a complex nonlinear relationship with changes in time and space. For example, optical power will change due to drastic changes in the external environment, or abnormal conditions will occur in certain specific areas of the optical fiber transmission line. These characteristics of time and space changes are crucial for the planning, optimization and maintenance of optical fiber transmission systems.
[0004] Therefore, there is an urgent need for a more comprehensive and accurate optical power prediction method that can comprehensively consider the changing trend of spatiotemporal data, optical fiber transmission characteristic parameters, and environmental factors, so as to achieve more accurate and reliable optical power prediction. Such a method will provide effective decision support for the performance management and optimization of optical fiber transmission systems, help improve the quality and stability of optical fiber transmission, and play an important role in the fields of communication and data transmission. Summary of the invention
[0005] In view of this, the present invention provides a multi-dimensional LSTM power optical cable optical power prediction method and system based on the spatiotemporal attention mechanism, which takes into account factors such as time, space and environment during the operation of optical fiber, so that the prediction model can more comprehensively reflect the characteristics and performance of the optical fiber transmission system, and improves the accuracy and reliability of the prediction results.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism, including:
[0008] Collecting data on the optical cable to obtain optical power data and environmental data, wherein the optical power data includes position data and time data;
[0009] Obtaining the correlation coefficient between the environmental data and the optical power data according to the principal component analysis method, selecting part of the environmental data according to a preset contribution threshold, and obtaining fused data in combination with the optical power data;
[0010] Extract local features of the fused data in the time dimension and the space dimension respectively through a double-layer dilated convolutional network to obtain multi-dimensional spatiotemporal data;
[0011] The multidimensional spatiotemporal data is input into a Bi-LSTM model with an attention mechanism added, the attention weights of the multidimensional spatiotemporal data in the time dimension and the space dimension are calculated, and the weighted sum is performed to obtain the final optical power prediction data.
[0012] Preferably, before obtaining the correlation data between the environmental data and the optical power data according to the principal component analysis method, the optical power data and the environmental data are further subjected to data cleaning, missing value filling and standardization processing.
[0013] Preferably, the acquiring of fusion data specifically includes:
[0014] S11: for the collected optical power data and various types of environmental data, respectively calculating the correlation coefficient between each environmental data and the optical power data;
[0015] S12: adjusting the weight of each environmental data according to the correlation coefficient;
[0016] S13: using the weight of each environmental data to adjust the corresponding environmental data;
[0017] S14: Calculate the covariance matrix for the adjusted environmental data, and then calculate the eigenvalues and eigenvectors of each of the adjusted environmental data through the covariance matrix, further obtain the contribution of each of the environmental data, and preset a contribution threshold, select all environmental data within the set contribution threshold, and fuse them with the optical power data to obtain fused data.
[0018] Preferably, the double-layer atrous convolutional network specifically includes:
[0019]
[0020] Where F is the input signal, k is the convolution kernel, p is the signal length, l is the dilation operator, and s is the index value of each data in the input signal F. t is the index value of the corresponding data in the convolution kernel k that satisfies s+l·t=p.
[0021] Preferably, the Bi-LSTM model with the attention mechanism specifically includes introducing a self-attention mechanism in the fully connected layer of the Bi-LSTM model, as follows:
[0022] Calculate the data of the multidimensional spatiotemporal data in the time dimension and the space dimension, and introduce a self-attention weight calculation formula;
[0023] e t =Softmax(W t ·H t );
[0024]
[0025] Among them, e t is the attention score corresponding to the hidden state output of the Bi-LSTM model at time t, a t is the attention weight coefficient corresponding to the hidden state output of the Bi-LSTM model at time t, W t To calculate the time dimension attention weight matrix, H t Output the time dimension data in the multidimensional matrix for the Bi-LSTM model;
[0026] e s =Softmax(W s ·H s );
[0027]
[0028] Among them, e s is the attention score value corresponding to the hidden state output of the Bi-LSTM model at distance s, a s is the attention weight coefficient corresponding to the hidden state output of the Bi-LSTM model at distance s, W s To calculate the spatial dimension attention weight matrix, H s Output spatial dimension data in a multidimensional matrix for the Bi-LSTM model.
[0029] Preferably, the weighted summation specifically includes adding the time dimension attention weights a calculated separately t , spatial dimension attention weight a S As the weights of the corresponding dimensions, they are weighted and summed with the matrix H to obtain the overall weighted output Y. The summation formula is as follows:
[0030] Y=(at ⊙a S )⊙H.
[0031] Preferably, the acquisition of the final optical power prediction data specifically includes inputting the weighted output into a fully connected layer, performing feature processing and fully connected layer calculation on the output data after expansion, and denormalizing the obtained data to obtain the final optical power prediction data.
[0032] A multi-dimensional LSTM power cable optical power prediction system based on spatiotemporal attention mechanism, including:
[0033] A data acquisition module collects data from the optical cable to obtain optical power data and environmental data, wherein the optical power data includes position data and time data;
[0034] A data fusion module, which obtains the correlation coefficient between the environmental data and the optical power data according to the principal component analysis method, selects part of the environmental data according to a preset contribution threshold, and obtains fused data in combination with the optical power data;
[0035] A feature extraction module extracts local features of the fused data in the time dimension and the space dimension respectively through a double-layer dilated convolutional network to obtain multi-dimensional spatiotemporal data;
[0036] The weight calculation module inputs the multidimensional spatiotemporal data into the Bi-LSTM model with the attention mechanism added, calculates the attention weights of the multidimensional spatiotemporal data in the time dimension and the space dimension, and performs weighted summation to obtain the final optical power prediction data.
[0037] It can be seen from the above technical solutions that compared with the prior art, the present invention discloses a multi-dimensional LSTM power cable optical power prediction method and system based on the spatiotemporal attention mechanism, which takes into account factors such as time, space and environment during the operation of the optical fiber, so that the prediction model can more comprehensively reflect the characteristics and performance of the optical fiber transmission system, and improve the accuracy and reliability of the prediction results. The data blank areas are filled so that the prediction model has spatial continuity. In this way, even if data is not collected at some locations, more comprehensive prediction results can be obtained, which improves the coverage and accuracy of the prediction. Due to the use of Bi-LSTM and attention mechanisms in deep learning algorithms, the prediction model has strong adaptability and real-time performance. The prediction model can dynamically adjust parameters according to different data and environments, adapt to the prediction needs of different scenarios, and complete the prediction process in a relatively short time to meet the requirements of real-time monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0039] Figure 1 A schematic diagram of the principle provided by the present invention;
[0040] Figure 2 A schematic diagram of the structure provided by the present invention;
[0041] Figure 3 The internal structure diagram of the LSTM unit provided by the present invention;
[0042] Figure 4 This is a structural diagram of the Bi-LSTM system provided by the present invention. DETAILED DESCRIPTION
[0043] 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.
[0044] The embodiment of the present invention discloses a multi-dimensional LSTM power optical cable optical power prediction method based on spatiotemporal attention mechanism. Figure 1 As shown, including:
[0045] Collect data on the optical cable to obtain optical power data and environmental data. The optical power data includes location data and time data.
[0046] The correlation coefficient between the environmental data and the optical power data is obtained by principal component analysis, part of the environmental data is selected according to a preset contribution threshold, and the fused data is obtained by combining the optical power data;
[0047] The double-layer dilated convolutional network is used to extract local features of the fused data in the time dimension and space dimension respectively to obtain multi-dimensional spatiotemporal data.
[0048] The multi-dimensional spatiotemporal data is input into the Bi-LSTM model with the attention mechanism added, the attention weights of the multi-dimensional spatiotemporal data in the time dimension and space dimension are calculated, and the weighted sum is performed to obtain the final optical power prediction data.
[0049] In data collection, sensors are installed on the lines to be tested to collect optical power data at different locations and time points, and to collect spatiotemporal information related to the optical fiber transmission system, such as timestamps and distance data. At the same time, environmental data near the locations of each section of optical fiber are collected through meteorological websites, including wind speed and force data, rainfall data, light data, and ambient temperature data.
[0050] In a specific embodiment, before obtaining the correlation data between the environmental data and the optical power data according to the principal component analysis method, the optical power data and the environmental data are also cleaned, missing value filled and standardized. This makes the multidimensional data continuous and unified so that it can be input into the subsequent prediction model. The specific steps are as follows:
[0051] Step 21. Data cleaning: Perform preliminary cleaning on the collected raw optical power data. Check whether the data contains abnormal values, missing values or noise. For abnormal values and noise, a smoothing algorithm can be used for filtering. The specific implementation process is as follows:
[0052] Select a smoothing window with a window size of 2k to take values of continuous data. For the data x collected by the present invention, i , the data in the window is x i-k ,x i-k+1 ,......,x i+k .
[0053] Calculate the average value of data in the window:
[0054] x′ i As an alternative to x i Repeat this step until all data points are smoothed.
[0055] For boundary points, the window is filled with the mirror value of the known data to ensure that the smoothing operation is continuous and meaningful at the boundary.
[0056] Step 22: Filling missing values: During the data collection process, since optical power data may not be collected at all locations, data blank areas will be generated. In order to obtain more comprehensive spatiotemporal data optical power information, these blank areas need to be filled. The present invention intends to use Kriging interpolation method for data filling.
[0057] Kriging interpolation is an interpolation method based on spatial distance, which uses the observed values of known points to estimate the values at unknown locations. In the present invention, the known points are the locations where optical power data has been collected, and the unknown locations are the data blank areas. The specific implementation steps are as follows:
[0058] 1. Determine unknown data. Assume that the present invention is to estimate the optical power value at an unknown position x, and it is necessary to collect the optical power data at n sampled positions xi as y i (i=1,2,3......n).
[0059] 2. Calculate the distance: For each unknown position x, calculate its distance from the known position x i The space distance d i .
[0060] 3. Calculate weight: according to distance data d i and parameter p, and use the inverse distance weight calculation formula to calculate the weight w i , the weight calculation formula is expressed as:
[0061]
[0062] 4. Interpolation: Based on the optical power data y at the known position i and the corresponding weight w i , use the Kriging interpolation formula to calculate the optical power estimate at the unknown location The calculation formula is expressed as:
[0063]
[0064] 5. Fill in missing values: Fill in the estimated optical power value As the missing position x i The padding value at .
[0065] 6. Repeat steps 2-5: interpolate and fill all unknown locations until all data blank areas are filled.
[0066] Step 2: Data standardization: In the present invention, the minimum-maximum scaling method is used to standardize the collected data. The specific steps are as follows:
[0067] 1. Determine the normalization range: Determine the target range [a, b] after data normalization according to specific needs. In the present invention, the data is scaled to the range of [0, 1].
[0068] 2. Calculate the minimum and maximum values: For each feature data, calculate its minimum value min and maximum value max in the data set.
[0069] 3. Standardization: Apply the minimum-maximum scaling formula to each feature data and scale it to the target range [0,1]. The scaling formula is:
[0070]
[0071] in, is the scaled data value.
[0072] Repeat steps 2-3: Normalize all feature data to ensure that all features in the dataset are within the target range.
[0073] In a specific embodiment, obtaining fusion data specifically includes:
[0074] S11: for the collected optical power data and various environmental data, respectively calculating the correlation coefficient between each environmental data and the optical power data;
[0075] For the n types of environmental data {X1,X2...X n} and optical power data Y, calculate the correlation coefficients of each environmental data and optical power data respectively. The calculation formula is:
[0076]
[0077] Where, X ij is the jth data value of the i-th environmental data, is the average value of the i-th environmental data. j is the jth optical power data value. is the average value of the optical power data.
[0078] Calculate each set of environmental data and optical power data separately to obtain the correlation coefficient
[0079] S12: Adjust the weight of each environmental data according to the correlation coefficient;
[0080] The weight of each environmental data is adjusted according to the correlation coefficient of each type of data. The calculation formula is:
[0081]
[0082] Wherein, α is a constant for adjusting the weight influence value. In the present invention, α=2 is taken to emphasize the weight of the correlation variable.
[0083] S13: Use the weight of each environmental data to adjust the corresponding environmental data, and the calculation formula is:
[0084] Z i =W i ×X i ;
[0085] S14: Calculate the covariance matrix for the adjusted environmental data, and then calculate the eigenvalues and eigenvectors of each adjusted environmental data through the covariance matrix to further obtain the contribution of each environmental data. At the same time, preset a contribution threshold, select all environmental data within the set contribution threshold and fuse them with the optical power data to obtain fused data.
[0086] PCA is used to reduce the dimension of environmental data and fuse data. First, the covariance matrix of each data is calculated, and the formula is:
[0087]
[0088] Among them, m is the environmental data X i The number of samples.
[0089] Then the eigenvalue λ of each environmental data is calculated through the covariance matrix i and the eigenvector v i , and its calculation formula is:
[0090] C i v i =λ i v i ;
[0091] For each feature vector obtained, by analyzing the contribution of each data and setting a threshold, the environmental data that has a greater impact on the optical power data is selected for data fusion. First, the contribution CR of each data is calculated. i , the formula is:
[0092]
[0093] Where n is the number of types of environmental data.
[0094] The contribution of each data CR i Arrange in order and calculate the total contribution CR of the first k eigenvalues:
[0095]
[0096] The minimum eigenvector set of eigenvalues whose cumulative eigenvalues reach a certain threshold is selected. The threshold set in the present invention is 80%, and the m eigenvalues obtained by screening are integrated into a new eigenvector matrix V:
[0097] V=[v1,v2,...,v m ];
[0098] Finally, the data is projected into the principal component space:
[0099] F = ZV;
[0100] In the formula, Z is all Z after weight adjustment i The new matrix is arranged as follows:
[0101] Z=[Z1,Z2,...,Z n ]
[0102] Through this method, various environmental data can be fused with optical power data, and different importance can be given to them according to the correlation between the environmental data and the optical power data, so that the fused data can reflect these data variables more specifically.
[0103] In a specific embodiment, when extracting time and space data features, considering that the collected data has relatively complex multi-dimensional features, a two-layer ACNN model is constructed to extract the time data features and space data features of the data respectively. Based on CNN, ACNN adds spaces between the convolution kernel elements to increase the receptive field of the convolution kernel, thereby extracting data features more comprehensively. For the obtained input signal F(t), the standard discrete convolution calculation formula is:
[0104]
[0105] Where F is the input signal, k is the convolution kernel, p is the signal length, and b is the bias.
[0106] ACNN introduces the dilation operator l on this basis, and obtains a wider input range by adjusting the dilation operator size. The two-layer hole convolution network specifically includes:
[0107]
[0108] Where F is the input signal, k is the convolution kernel, p is the signal length, l is the dilation operator, and s is the index value of each data in the input signal F. t is the index value of the corresponding data in the convolution kernel k that satisfies s+l·t=p.
[0109] In a specific embodiment, Bi-LSTM is a variant of a recurrent neural network (RNN). Unlike the traditional unidirectional LSTM, Bi-LSTM combines LSTM units in two directions (forward and reverse), such as Figure 3 As shown, information is extracted and memorized from two directions of the sequence, thereby capturing richer dependencies in the time series data. In the present invention, a two-layer Bi-LSTM prediction model including 1 input layer and 2 hidden layers (the hidden layers include a forward layer and a backward layer) is constructed, as shown in FIG. Figure 4 As shown, the specific construction steps are as follows:
[0110] Forward LSTM unit construction:
[0111] The forward LSTM unit structure consists of four parts: input gate, forget gate, unit state and output gate.
[0112] The formulas for each part and the final output value are as follows:
[0113] 1. Forward input gate: It controls the input data ratio to retain the valid information of the current unit. The calculation formula is:
[0114] i t =σ(W i ·[h t-1 ,x t ]+b i );
[0115] Where W i is the input weight matrix of the forward input gate, h t-1 is the hidden state input of the previous moment, x t is the time and space data matrix input corresponding to the optical power at the current moment. i is the bias of the forward input gate. σ() is the sigmoid activation function, which is used to map the calculation result to a probability value between 0 and 1. Its calculation formula is:
[0116]
[0117] 2. Forward forget gate: It controls the input data ratio to retain the valid information of the previous unit. The calculation formula is:
[0118] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0119] Where W f is the input weight matrix of the forward forget gate, b f is the bias of the forward output gate.
[0120] 3. Forward unit state: stores long-term memory, and each unit is updated to reflect the receipt of new information or the forgetting of old information. Its calculation formula is:
[0121]
[0122] In the formula, c t-1 is the forward cell state output by the forward LSTM cell at time t-1. is the candidate value of the forward unit state at time t, which is the new information that may be added to the current unit state and is jointly determined by the input of the current unit and the hidden state of the past unit. Its calculation formula is:
[0123]
[0124] Where W C is the input weight matrix of the candidate value of the forward unit state, b C is the bias term of the candidate value of the forward unit state, and tanh is the hyperbolic tangent function, which is calculated as follows:
[0125]
[0126] 4. Forward output gate: determines how much information to output based on the current value of the cell state. Its formula is:
[0127] o t =σ(W o ·[h t-1 ,x t ]+b o );
[0128] Where W o is the input weight matrix of the forward output gate, b o is the bias of the forward output gate.
[0129] 5. The final output of the forward LSTM unit is based on the current unit state and the value of the output gate. It reflects the network's comprehensive response to the long and short-term memory of the current input and its position in the sequence, which is used for prediction of the next time step or as a feature for further processing. Its calculation formula is:
[0130] h t =o t ⊙tanh(c t );
[0131] Backward LSTM unit construction:
[0132] The backward LSTM unit processes data in reverse. Its structure is similar to the forward LSTM unit, but it captures and memorizes information in the opposite direction. Its parts and output formula are as follows:
[0133] 1. Backward input gate:
[0134] i′ t =σ(W i ′·[h t+1 ,x t ]+b′ i );
[0135] Where W i ′ is the input weight matrix of the backward input gate, h t+1 is the hidden state input at the next moment, x t b′ is the time and space data matrix input corresponding to the optical power at the current moment.i is the bias of the backward input gate.
[0136] 2. Backward Forget Gate:
[0137] f t ′=σ(W′ f ·[h t+1 ,x t ]+b′ f );
[0138] Where W′ f is the input weight matrix of the backward forget gate, b′ f is the bias of the forward output gate.
[0139] 3. Backward unit status:
[0140]
[0141] In the formula, c′ t+1 is the backward cell state output by the backward LSTM cell at time t+1. is the candidate value of the forward unit state at time t, and its calculation formula is:
[0142]
[0143] Where W′ C is the input weight matrix of the candidate value of the backward unit state, b′ C is the bias term for the candidate value of the backward unit state,
[0144] 4. Backward output gate:
[0145] o′ t =σ(W′ o ·[h t+1 ,x t ]+b′ o );
[0146] Where W′ o is the input weight matrix of the backward output gate, b′ o is the bias of the backward output gate.
[0147] 5. Backward LSTM unit output:
[0148] h′ t =o′ t ⊙tanh(c′ t );
[0149] Bi-LSTM model total output:
[0150] At time t, the hidden state h(t) of the forward LSTM and the hidden state h(t′) of the backward LSTM are connected to form the total output H t :
[0151]
[0152] in, Represents the concatenation operation, which concatenates two vectors into a longer vector in a certain order. The total output H t It contains the output information of the forward and backward LSTM at time t, which can more comprehensively reflect the long-term dependencies and spatiotemporal information in time series data.
[0153] The Bi-LSTM model with attention mechanism specifically includes the introduction of self-attention mechanism in the fully connected layer of the Bi-LSTM model. The self-attention mechanism is a method of calculating attention weights on sequence data. It can dynamically assign weights according to the relationship between elements in the sequence, so that the model can pay more attention to those input information that have a greater impact on the prediction results. The details are as follows:
[0154] Calculate the data of multi-dimensional spatiotemporal data in the time dimension and space dimension, and introduce the self-attention weight calculation formula;
[0155] e t =Softmax(W t ·H t );
[0156]
[0157] Among them, e t is the attention score corresponding to the hidden state output of the Bi-LSTM model at time t, a t is the attention weight coefficient corresponding to the hidden state output of the Bi-LSTM model at time t, W t To calculate the time dimension attention weight matrix, H t Output the time dimension data in the multidimensional matrix for the Bi-LSTM model;
[0158] e s =Softmax(W s ·H s );
[0159]
[0160] Among them, e s is the attention score value corresponding to the hidden state output of the Bi-LSTM model at distance s, a s is the attention weight coefficient corresponding to the hidden state output of the Bi-LSTM model at distance s, Ws To calculate the spatial dimension attention weight matrix, H s Output spatial dimension data in a multidimensional matrix for the Bi-LSTM model.
[0161] Input the matrix data of each dimension of the hidden state output of the Bi-LSTM model into the attention calculation model respectively, and the attention weight coefficients a of the two dimensional data of time and space can be obtained respectively. t and a S .
[0162] In a specific embodiment, the weighted summation specifically includes adding the time dimension attention weights a calculated separately t , spatial dimension attention weight a S As the weights of the corresponding dimensions, they are weighted and summed with the matrix H to obtain the overall weighted output Y. The summation formula is as follows:
[0163] Y=(a t ⊙a S )⊙H.
[0164] In a specific embodiment, obtaining the final optical power prediction data specifically includes inputting the weighted output into a fully connected layer, performing feature processing and fully connected layer calculation on the output data after expansion, and denormalizing the obtained data to obtain the final optical power prediction data.
[0165] In a specific embodiment, it also includes optical power prediction data evaluation:
[0166] The optical power prediction model of the present invention uses a Bi-LSTM structure and adds an attention mechanism to improve the prediction accuracy and the degree of attention to different inputs. To verify the performance advantages of the model, the present invention uses RMSE (root mean square error), MAE (mean absolute error), R 2 (Determination coefficient) is evaluated by three evaluation methods, and the calculation formulas of the three evaluation indicators are as follows:
[0167]
[0168] Where N is the number of samples in the test set, y i is the actual observed value of the i-th sample, is the corresponding predicted value. is the average of the actual observed values.
[0169] Through the above evaluation method, the performance advantage of the optical power prediction model of the present invention can be fully verified. The experimental results are used as a basis to demonstrate the practicality and technical superiority of the present invention, and further increase the feasibility and value of the present invention.
[0170] A multi-dimensional LSTM power cable optical power prediction system based on spatiotemporal attention mechanism, such as Figure 2 As shown, including:
[0171] The data acquisition module collects data from the optical cable to obtain optical power data and environmental data. The optical power data includes position data and time data.
[0172] The data fusion module obtains the correlation coefficient between the environmental data and the optical power data according to the principal component analysis method, selects part of the environmental data according to the preset contribution threshold, and obtains fused data in combination with the optical power data;
[0173] The feature extraction module extracts local features of the fused data in the time dimension and space dimension respectively through a double-layer dilated convolutional network to obtain multi-dimensional spatiotemporal data;
[0174] The weight calculation module inputs the multi-dimensional spatiotemporal data into the Bi-LSTM model with the attention mechanism, calculates the attention weights of the multi-dimensional spatiotemporal data in the time dimension and space dimension, and performs weighted summation to obtain the final optical power prediction data.
[0175] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0176] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism, characterized in that: include: Collecting data on the optical cable to obtain optical power data and environmental data, wherein the optical power data includes position data and time data; Obtaining the correlation coefficient between the environmental data and the optical power data according to the principal component analysis method, selecting part of the environmental data according to a preset contribution threshold, and obtaining fused data in combination with the optical power data; Extract local features of the fused data in the time dimension and the space dimension respectively through a double-layer dilated convolutional network to obtain multi-dimensional spatiotemporal data; The multidimensional spatiotemporal data is input into a Bi-LSTM model with an attention mechanism added, the attention weights of the multidimensional spatiotemporal data in the time dimension and the space dimension are calculated, and the weighted sum is performed to obtain the final optical power prediction data.
2. According to claim 1, a multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism is characterized in that: Before obtaining the correlation data between the environmental data and the optical power data according to the principal component analysis method, the optical power data and the environmental data are also subjected to data cleaning, missing value filling and standardization processing.
3. According to the multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism of claim 1, it is characterized in that: The obtaining of fusion data specifically includes: S11: for the collected optical power data and various types of environmental data, respectively calculating the correlation coefficient between each environmental data and the optical power data; S12: adjusting the weight of each environmental data according to the correlation coefficient; S13: using the weight of each environmental data to adjust the corresponding environmental data; S14: Calculate the covariance matrix for the adjusted environmental data, and then calculate the eigenvalues and eigenvectors of each of the adjusted environmental data through the covariance matrix, further obtain the contribution of each of the environmental data, and preset a contribution threshold, select all environmental data within the set contribution threshold, and fuse them with the optical power data to obtain fused data.
4. According to a multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism according to claim 1, it is characterized in that: The double-layer hole convolutional network specifically includes: Where F is the input signal, k is the convolution kernel, p is the signal length, l is the dilation operator, and s is the index value of each data in the input signal F. t is the index value of the corresponding data in the convolution kernel k that satisfies s+l·t=p.
5. According to a multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism according to claim 1, it is characterized in that: The Bi-LSTM model with the attention mechanism specifically includes introducing a self-attention mechanism in the fully connected layer of the Bi-LSTM model, as follows: Calculate the data of the multidimensional spatiotemporal data in the time dimension and the space dimension, and introduce a self-attention weight calculation formula; e t =Softmax(W t ·H t ); Among them, e t is the attention score corresponding to the hidden state output of the Bi-LSTM model at time t, a t is the attention weight coefficient corresponding to the hidden state output of the Bi-LSTM model at time t, W t To calculate the time dimension attention weight matrix, H t Output the time dimension data in the multidimensional matrix for the Bi-LSTM model; e s =Softmax(W s ·H s ); Among them, e s is the attention score value corresponding to the hidden state output of the Bi-LSTM model at distance s, a s is the attention weight coefficient corresponding to the hidden state output of the Bi-LSTM model at distance s, W s To calculate the spatial dimension attention weight matrix, H s Output spatial dimension data in a multidimensional matrix for the Bi-LSTM model.
6. According to claim 5, a multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism is characterized in that: The weighted summation specifically includes the time dimension attention weights a calculated separately t , spatial dimension attention weight a S As the weights of the corresponding dimensions, they are weighted and summed with the matrix H to obtain the overall weighted output Y. The summation formula is as follows: And (a) t ⊙a S )⊙H。 7. According to claim 6, a multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism is characterized in that: The obtaining of the final optical power prediction data specifically includes inputting the weighted output into the fully connected layer, performing feature processing and fully connected layer calculation on the output data after expansion, and denormalizing the obtained data to obtain the final optical power prediction data.
8. A multi-dimensional LSTM power cable optical power prediction system based on spatiotemporal attention mechanism, characterized in that: include: A data acquisition module collects data from the optical cable to obtain optical power data and environmental data, wherein the optical power data includes position data and time data; A data fusion module, which obtains the correlation coefficient between the environmental data and the optical power data according to the principal component analysis method, selects part of the environmental data according to a preset contribution threshold, and obtains fused data in combination with the optical power data; A feature extraction module extracts local features of the fused data in the time dimension and the space dimension respectively through a double-layer dilated convolutional network to obtain multi-dimensional spatiotemporal data; The weight calculation module inputs the multidimensional spatiotemporal data into the Bi-LSTM model with the attention mechanism added, calculates the attention weights of the multidimensional spatiotemporal data in the time dimension and the space dimension, and performs weighted summation to obtain the final optical power prediction data.
Citation Information
Patent Citations
Optical fiber state prediction method for optimizing neural network based on improved firefly algorithm
CN106529701A
Optical power prediction method and system based on two-stage feature extraction and BiLSTM improvement
CN114282646A
Optical power prediction method and device
CN115965159A
Photovoltaic power prediction method and device, terminal equipment and storage medium
CN116894517A
Photovoltaic power prediction method based on multi-scale space-time diagram attention convolutional network
CN117154704A
Cited By
Distribution network optical cable optical power prediction system and method
CN121012572A
Electrified flexible source load characteristic identification and adjustable potential measurement and calculation method
CN121615992A
