A multi-dimensional LSTM power cable optical power prediction method and system based on spatiotemporal attention mechanism

Through the multi-dimensional LSTM power cable optical power prediction method based on the spatiotemporal attention mechanism, the problem that the changes in spatiotemporal data during optical fiber transmission in the prior art is solved, and more accurate and reliable optical power prediction is achieved, adapting to the real-time monitoring needs of different scenarios.

CN118735032BActive Publication Date: 2025-08-19ELECTRIC POWER RES INST OF EAST INNER MONGOLIA ELECTRIC POWER +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410712517.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2025-08-19
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

The existing optical power prediction methods fail to fully consider the changes in spatiotemporal data and environmental factors during optical fiber transmission, resulting in inaccurate and reliable prediction results.

Method used

The multi-dimensional LSTM power cable optical power prediction method based on the spatiotemporal attention mechanism is adopted. Through data acquisition, data cleaning and standardization processing, environmental data is selected in combination with the principal component analysis method, feature extraction is used using a double-layer hollow convolution network, and the Bi-LSTM model is used for weighted summing, and attention weight is calculated for optical power prediction.

Benefits of technology

It improves the accuracy and reliability of optical power prediction, can be filled in the blank areas of data, adapt to the prediction needs of different scenarios, meet real-time monitoring requirements, and enhances the adaptability and continuity of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735032B_ABST
    Figure CN118735032B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-dimensional LSTM power optical cable optical power prediction method and system based on a spatiotemporal attention mechanism, relating to the technical field of optical power prediction, comprising obtaining optical power data and environmental data; analyzing and obtaining a correlation coefficient between the environmental data and the optical power data, selecting part of the environmental data according to a preset contribution threshold, and obtaining fused data in combination with the optical power data; extracting local features from the fused data using a double-layer dilated convolutional network to obtain multi-dimensional spatiotemporal data; and inputting the multi-dimensional spatiotemporal data into a Bi-LSTM model to which an attention mechanism is added to obtain final optical power prediction data. The present invention can achieve accurate prediction of optical power under different environments and locations, which is of great significance to the power dispatching and operational safety of power grids.
Need to check novelty before this filing date? Find Prior Art

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 power communication systems, power fiber has become a mainstream communication method and has been widely used in recent years due to its numerous advantages, including high communication capacity, low transmission loss, and excellent resistance to electromagnetic interference. As a key component of power communication systems, the stability of power fiber communication system transmission is crucial for efficient production and stable operation of the power sector. Once a power fiber line fails, the resulting communication interruption will result in significant economic losses for enterprises and users. Optical power, as a key indicator of optical fiber transmission quality, plays a key role in the normal operation and performance evaluation of power communication systems. Due to the complexity and diversity of optical fiber transmission systems, optical power is affected by a variety of factors during transmission, including but not limited to fiber loss, environmental weather changes, ambient temperature, and transmission distance. 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 primarily focus on optical power at a single point in time or location, ignoring temporal and spatial variations. In practical applications, optical power exhibits complex, nonlinear relationships over time and space. For example, optical power can fluctuate due to drastic changes in the external environment, or experience anomalies in specific areas of an optical fiber transmission line. These temporal and spatial variations 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 trends of spatiotemporal data, fiber transmission characteristics, and environmental factors to achieve more precise 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 a vital role in the fields of communications 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, thereby improving the accuracy and reliability of the prediction results.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[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 a correlation coefficient between the environmental data and the optical power data according to a principal component analysis method, selecting part of the environmental data according to a preset contribution threshold, and combining the data with the optical power data to obtain fused data;

[0010] Performing local feature extraction on 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, the attention weights of the multidimensional 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.

[0012] Preferably, before obtaining the correlation data between the environmental data and the optical power data according to the principal component analysis method, the method further includes performing data cleaning, missing value filling and standardization on the optical power data and the environmental data.

[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 of 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 at the same time, 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 dilated 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 added attention mechanism specifically includes introducing a self-attention mechanism into 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 the self-attention weight calculation formula;

[0023] e t =Softmax(W t ·H t );

[0024]

[0025] Among them, e t is the attention score value 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 time dimension data in a 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 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, obtaining 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.

[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 a correlation coefficient between the environmental data and the optical power data according to a principal component analysis method, selects part of the environmental data according to a preset contribution threshold, and combines the data with the optical power data to obtain fused 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 a Bi-LSTM model with an attention mechanism, calculates the attention weights of the multidimensional spatiotemporal data in the time dimension and space dimension, and performs weighted summation to obtain the final optical power prediction data.

[0037] Through the above technical solution, it can be seen 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 in 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 can 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0039] Figure 1 A schematic diagram of the principle provided by the present invention;

[0040] Figure 2 A schematic structural diagram of 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 clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.

[0044] The embodiment of the present invention discloses a multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism, such as Figure 1 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 environmental data and optical power data is obtained using the principal component analysis method. Part of the environmental data is selected according to a preset contribution threshold, and then combined with the optical power data to obtain fused data.

[0047] The double-layer dilated convolutional network is used to extract local features of the fused data in the time dimension and the space dimension respectively to obtain multi-dimensional spatiotemporal data.

[0048] The multidimensional spatiotemporal data is input into the Bi-LSTM model with the attention mechanism, the attention weights of the multidimensional 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] During data collection, sensors installed along the lines under test collect optical power data at different locations and time points, as well as spatiotemporal information related to the optical fiber transmission system, such as timestamps and distance data. Environmental data near each fiber segment, including wind speed, rainfall, sunlight, and ambient temperature, is collected through meteorological websites.

[0050] In one specific embodiment, before obtaining the correlation data between the environmental data and the optical power data using the principal component analysis method, the optical power data and the environmental data are cleaned, missing values are filled, and normalized. This ensures that the multidimensional data has continuity and uniformity, so that it can be input into the subsequent prediction model. The specific steps are as follows:

[0051] Step 2.1 Data cleaning: Perform preliminary cleaning on the collected raw optical power data. Check whether the data contains outliers, missing values, or noise. For outliers and noise, a smoothing algorithm can be used for filtering. The specific implementation process is as follows:

[0052] A smoothing window with a window size of 2k is selected 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, because optical power data may not be collected at every location, data gaps may occur. To obtain more comprehensive spatiotemporal optical power information, these gaps need to be filled. This invention proposes to use Kriging interpolation for data filling.

[0057] Kriging interpolation is a spatial distance-based interpolation method that uses observed values at known points to estimate values at unknown locations. In this method, known points are locations where optical power data has been collected, and unknown locations are areas where data is blank. 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 spatial distance d between i .

[0060] 3. Calculate weight: according to distance data d i And parameter p, 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 and 3: Data normalization: In the present invention, the minimum-maximum scaling method is used to normalize the collected data. The specific steps are as follows:

[0067] 1. Determine the normalization range: Determine the target range [a, b] after data normalization based on specific needs. In this invention, the data is scaled to the range [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. Standardize: 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 calculate 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 coefficient between each environmental data and optical power data. 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] Here, α is a constant for adjusting the weight influence value. In the present invention, α=2 is used to emphasize the weight of the correlation variable.

[0083] S13: Use the weight of each environmental data to adjust the corresponding environmental data. The calculation formula is:

[0084] Z i =W i ×X i ;

[0085] S14: Calculate the covariance matrix of 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, and select all environmental data within the set contribution threshold to fuse with the optical power data to obtain fused data.

[0086] PCA is used to reduce the dimension of environmental data and perform data fusion. 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 calculate the eigenvalue λ of each environmental data 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 obtained eigenvector, 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 whose cumulative eigenvalue reaches a certain threshold is selected. The threshold set in the present invention is 80%. 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] Where 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 temporal and spatial data features, considering that the collected data has relatively complex multidimensional features, a two-layer ACNN model is constructed to extract the temporal data features and spatial data features of the data respectively. Based on CNN, ACNN adds spaces between 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 dilated convolutional 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 recurrent neural network (RNN). Unlike the traditional unidirectional LSTM, Bi-LSTM combines two directions (forward and reverse) LSTM units, such as Figure 3 As shown in Figure 2, information is extracted and memorized from two directions of the sequence, thereby capturing richer dependencies in time series data. In this invention, a two-layer Bi-LSTM prediction model is constructed, which includes 1 input layer and 2 hidden layers (the hidden layers include forward and backward layers), as shown in Figure 2. 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 effective information of the current unit. Its 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 results to probability values between 0 and 1. Its calculation formula is:

[0116]

[0117] 2. Forward forget gate: It controls the input data ratio and retains the valid information of the previous unit. Its 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] Where 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, 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 forward unit state candidate value, 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 current input and its long-term short-term memory of its position in the sequence, and 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] Where c′ t+1 is the backward unit state output by the backward LSTM unit 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 for calculating attention weights on sequence data. It can dynamically assign weights based on the relationship between elements in the sequence, allowing the model to pay more attention to input information that has 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 value 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 time dimension data in a 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 Bi-LSTM model hidden state output into the attention calculation model respectively, and the attention weight coefficients a of the time and space dimension data can be obtained respectively. t and a S .

[0162] In a specific embodiment, 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:

[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 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.

[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] Among them, N is the number of samples in the test set, y i is the actual observation value of the i-th sample, is the corresponding predicted value. is the average of the actual observations.

[0169] The above evaluation method can fully verify the performance advantages of the optical power prediction model of the present invention. The experimental results are used as a basis to demonstrate the practicality and technical superiority of the present invention, further increasing 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 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 environmental data and optical power data based on the principal component analysis method, selects part of the environmental data according to the preset contribution threshold, and combines it with the optical power data to obtain fused data;

[0173] The feature extraction module uses a double-layer dilated convolutional network to extract local features of the fused data in the time and space dimensions 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] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0176] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily 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 is not limited to the embodiments shown herein but is intended to conform 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 by: 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 a correlation coefficient between the environmental data and the optical power data according to a principal component analysis method, selecting part of the environmental data according to a preset contribution threshold, and combining the data with the optical power data to obtain fused data; Performing local feature extraction on 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; Input the multidimensional spatiotemporal data into a Bi-LSTM model with an attention mechanism, calculate the attention weights of the multidimensional spatiotemporal data in the time dimension and the space dimension, and perform weighted summation to obtain the final optical power prediction data; The acquiring 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: Calculating a covariance matrix for the adjusted environmental data, and then calculating the eigenvalues and eigenvectors of each of the adjusted environmental data using the covariance matrix, further obtaining a contribution of each of the environmental data, and simultaneously presetting a contribution threshold, selecting all environmental data within the set contribution threshold and fusing them with the optical power data to obtain fused data; The Bi-LSTM model with the attention mechanism specifically includes the introduction of 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 the self-attention weight calculation formula; e t =Softmax(W t ·H t ); Among them, e t is the attention score value 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 time dimension data in a 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.

2. A multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism according to claim 1, 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. The multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism according to claim 1 is characterized in that: The double-layer dilated 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, 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.

4. The multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism according to claim 1 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。 5. A multi-dimensional LSTM power cable optical power prediction method based on spatiotemporal attention mechanism according to claim 4, 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.

6. A multi-dimensional LSTM power cable optical power prediction system based on spatiotemporal attention mechanism, characterized by: 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 a correlation coefficient between the environmental data and the optical power data according to a principal component analysis method, selects part of the environmental data according to a preset contribution threshold, and combines the data with the optical power data to obtain fused 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; A weight calculation module inputs the multidimensional spatiotemporal data into a Bi-LSTM model with an attention mechanism, 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; The acquiring 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: Calculating a covariance matrix for the adjusted environmental data, and then calculating the eigenvalues and eigenvectors of each of the adjusted environmental data using the covariance matrix, further obtaining a contribution of each of the environmental data, and simultaneously presetting a contribution threshold, selecting all environmental data within the set contribution threshold and fusing them with the optical power data to obtain fused data; The Bi-LSTM model with the attention mechanism specifically includes the introduction of 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 the self-attention weight calculation formula; e t =Softmax(W t ·H t ); Among them, e t is the attention score value 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 time dimension data in a 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.

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