Temperature profile prediction model construction method, prediction method, device and equipment
A temperature profile prediction model is built through a predictive neural network, using layer height and periodic spatio-temporal convolution coding sub-modules and attention mechanisms to solve the problem of spatio-temporal correlation not considered in traditional methods and improve the accuracy of temperature profile prediction. .
Patent Information
- Application Number
- CN202210597544.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-05-30
AI Technical Summary
The traditional temperature profile prediction method is based on multiple linear regression and fails to effectively consider the correlation between temperature profiles at different grid points in the space-time dimension, resulting in low prediction accuracy.
A predictive neural network is used to extract spatiotemporal features through the layer-high attention mechanism coding submodule and periodic spatiotemporal convolution coding submodule, and the attention spatiotemporal convolution decoding module and temporal attention module are used to construct a temperature profile prediction model, reflecting different Correlation between temperature profiles at isobaric altitude.
It significantly improves the accuracy of temperature profile prediction, can better reflect the temperature change relationship in the spatiotemporal dimension, and improves the prediction accuracy of meteorological grid data.
Smart Images

Figure CN114997490B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method for constructing a temperature profile prediction model, a prediction method, a device and equipment. Background Art
[0002] Meteorological grid element data is the basic data of modern weather forecast. It is generally collected through different observation sources, such as satellites, soundings, sea surface buoys, ground stations, etc., and then obtained through data assimilation technology to obtain four-dimensional earth grid data containing longitude, latitude, altitude and time. Meteorological grid data contains a wealth of basic meteorological elements, which are also necessary initial fields for modern numerical weather forecast input. Therefore, the rational use of meteorological grid data plays an important role in the prediction of future weather, meteorology, climate or extreme meteorological phenomena. And predicting temperature profiles is an important application of meteorological grid elements, which has an important impact on the fields of global greenhouse effect, urban heat island effect, carbon emissions, ocean optical parameters, etc.
[0003] In the related technology, the traditional temperature profile prediction method is mainly based on the multivariate linear regression method, and it is necessary to manually define some features and input them into the regression equation. It neither takes into account the correlation between the temperature profiles of different grid points in the time and space dimensions, nor makes good use of the data-driven approach to automatically learn the features. This will lead to inaccurate and biased temperature profile predictions. Therefore, the prediction accuracy of the traditional temperature profile prediction method is not high.
[0004] Therefore, a new method for temperature profile prediction is urgently needed. Summary of the invention
[0005] In order to solve the problem that the prediction accuracy of the original temperature profile prediction method is not high, the embodiments of the present invention provide a method for constructing a temperature profile prediction model, a prediction method, a device and equipment.
[0006] In a first aspect, an embodiment of the present invention provides a method for constructing a temperature profile prediction model, comprising:
[0007] Acquire multiple training sample pairs; the training sample pairs include a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, a first time series corresponding to the plurality of original temperature tensors as input is located before a second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; the original temperature tensors are temperature tensors of a plurality of meteorological grid points at different isobaric altitudes;
[0008] The prediction neural network is used to extract and train the spatiotemporal features of the temperature profile using multiple training samples to construct a temperature profile prediction model; the prediction neural network includes an encoding layer consisting of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer consisting of an attention spatiotemporal convolution decoding module and a temporal attention module.
[0009] Preferably, the extraction and training of the spatiotemporal features of the temperature profile of the prediction neural network using a plurality of training samples to construct a temperature profile prediction model includes:
[0010] Inputting the several original temperature tensors corresponding to the first time series in the training sample pair into the layer height attention mechanism encoding submodule of the encoding layer in sequence according to the time series, performing isobaric height attention calculation on each original temperature tensor, and obtaining several adjusted original temperature tensors;
[0011] Inputting the adjusted several original temperature tensors into the periodic spatiotemporal convolutional coding submodule in sequence according to the time series, extracting the spatiotemporal features of the original temperature tensor corresponding to the next moment based on the extracted spatiotemporal features of the original temperature tensor corresponding to the previous moment and the spatiotemporal features of the original temperature tensor corresponding to the previous period, until the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series are obtained; wherein each original temperature tensor corresponds to one moment;
[0012] Inputting the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series into the attention spatiotemporal convolutional decoding module of the decoding layer to predict several initial temperature tensors of the second time series;
[0013] Using the temporal attention module of the encoding layer, according to the spatiotemporal characteristics of the several original temperature tensors of the first time series, perform temporal attention calculation on each initial temperature tensor of the predicted second time series, and output several predicted temperature tensors;
[0014] According to the outputted predicted temperature tensors and the original temperature tensors of the training sample pairs corresponding to the second time series, the network parameters of the prediction neural network are adjusted until a temperature profile prediction model that meets expectations is obtained.
[0015] Preferably, the periodic spatiotemporal convolutional coding submodule extracts spatiotemporal features from the adjusted original temperature tensor according to the following formula:
[0016]
[0017]
[0018]
[0019]
[0020]
[0021] Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, i t is the output of the input gate, f t is the output of the forget gate, o t is the output of the output gate, e t is the output of the memory unit, e t-τ is the output of the memory unit in the previous cycle, H t-1 is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t-1, H t is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t, H t-τ is the spatiotemporal characteristics of the original temperature tensor output corresponding to time t in the previous cycle, x t is the adjusted original temperature tensor corresponding to time t, σ is the first activation function, tanh is the second activation function, W xi , W hi , W ci , W xf , W hf , W cf , W xc , W hc , W xo , W ho , W co , b i , b f , b c , b o is the network parameter of the periodic spatiotemporal convolutional coding submodule, W it , W ft , W et , W ot , W t is the network parameter of the periodic spatiotemporal convolutional coding submodule at time t, W i(t-τ) , W f(t-τ) , W e(t-τ) , W o(t-τ) , W t-τ are the network parameters of the periodic spatiotemporal convolutional coding submodule at time t in the previous cycle.
[0022] Preferably, the attention spatiotemporal convolutional decoding module predicts the initial temperature tensor of the second time series according to the following formula:
[0023]
[0024]
[0025]
[0026]
[0027]
[0028] Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, and i′ t is the output of the input gate, f′ t is the output of the forget gate, o′ t is the output of the output gate, e′ t is the output of the memory unit, e′ t-τ is the output of the memory unit in the previous cycle, D t-1 is the initial temperature tensor corresponding to the output time t-1, D t is the predicted initial temperature tensor corresponding to time t, D t-τ is the corresponding initial temperature tensor output at time t in the previous cycle, σ is the first activation function, tanh is the second activation function, W′ hi , W′ ci , W′ hf , W′ cf , W′ hc , W′ ho , W′ co , b′ i , b′ f , b′ c , b′ o is the network parameter of the attention spatiotemporal convolutional decoding module, W′ it , W′ ft , W′ et , W′ ot , W′ t is the network parameter of the attention spatiotemporal convolutional decoding module at time t, W′ i(t-τ) , W′ f(t-τ) , W′ e(t-τ) , W′ o(t-τ) , W′ t-τ are the network parameters of the attention spatiotemporal convolutional decoding module at time t in the previous cycle.
[0029] Preferably, the temporal attention module obtains the predicted temperature tensor according to the following formula, including:
[0030]
[0031]
[0032]
[0033] in, represents the Hadamard product, H i is the spatiotemporal feature of the original temperature tensor of the first time series in the encoding layer, i∈{s,s-1,…sN-1}, s is the last moment of the first time series, N is the number of original temperature tensors of the first time series, D s+k is the kth initial temperature tensor of the second time series predicted by the attention spatiotemporal convolutional decoding module, a i is the spatiotemporal characteristics of the ith original temperature tensor relative to D s+k The attention distribution value, C s+k is the attention state value, tanh is the activation function, W c are the network parameters of the temporal attention module, The kth predicted temperature tensor of the second time series obtained by the temporal attention module.
[0034] In a second aspect, an embodiment of the present invention further provides a prediction method for temperature profile prediction using a temperature profile prediction model constructed by any method for constructing a temperature profile prediction model described in this specification, comprising:
[0035] Get several raw temperature tensors of the historical time series;
[0036] Inputting a plurality of original temperature tensors of the historical time series into the temperature profile prediction model;
[0037] A plurality of predicted temperature tensors of the next time series of the historical time series output by the temperature profile prediction model are received.
[0038] In a third aspect, an embodiment of the present invention further provides a device for constructing a temperature profile prediction model, comprising:
[0039] An acquisition unit is used to acquire a plurality of training sample pairs; the training sample pairs include a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, a first time series corresponding to the plurality of original temperature tensors as input is located before a second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; the original temperature tensors are temperature tensors of a plurality of meteorological grid points at different isobaric altitudes;
[0040] A construction unit is used to extract and train the spatiotemporal features of the temperature profile of the prediction neural network using multiple training samples to construct a temperature profile prediction model; the prediction neural network includes an encoding layer composed of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module.
[0041] In a fourth aspect, an embodiment of the present invention further provides a temperature profile prediction device, comprising:
[0042] A sequence acquisition unit, used to obtain several original temperature tensors of the historical time series;
[0043] An input unit, used for inputting a plurality of original temperature tensors of a historical time series into a temperature profile prediction model; the temperature profile prediction model is constructed by using any method for constructing a temperature profile prediction model of the present invention;
[0044] The prediction unit is used to receive a plurality of predicted temperature tensors of the next time series of the historical time series output by the temperature profile prediction model.
[0045] In a fifth aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of this specification is implemented.
[0046] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method described in any embodiment of this specification.
[0047] The embodiment of the present invention provides a method for constructing a temperature profile prediction model, a prediction method, an apparatus and a device. First, a plurality of training sample pairs including a plurality of original temperature tensors as input and a plurality of original temperature tensors as output are obtained, and a first time series corresponding to the plurality of original temperature tensors as input is located before a second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous. By utilizing a coding layer composed of a high-level attention mechanism coding submodule and a periodic spatiotemporal convolution coding submodule in a prediction neural network and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module, the spatiotemporal features of the temperature profile of the training sample pairs are extracted to train a temperature profile prediction model, thereby improving the prediction accuracy of the temperature profile. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 It is a flow chart of a method for constructing a temperature profile prediction model provided by one embodiment of the present invention;
[0050] Figure 2 is a hardware architecture diagram of an electronic device provided by an embodiment of the present invention;
[0051] Figure 3 It is a structural diagram of a device for constructing a temperature profile prediction model provided by one embodiment of the present invention;
[0052] Figure 4 is a hardware architecture diagram of another electronic device provided by an embodiment of the present invention;
[0053] Figure 5 It is a structural diagram of a temperature profile prediction device provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0055] As mentioned above, in the related technology, the traditional temperature profile prediction method is mainly based on the multivariate linear regression method, and it is necessary to manually define some features to input into the regression equation. It neither takes into account the correlation between the temperature profiles of different grid points in the time and space dimensions, nor makes good use of the data-driven approach to automatically learn features. This will lead to inaccurate and biased temperature profile predictions. Therefore, the prediction accuracy of the traditional temperature profile prediction method is not high.
[0056] In order to solve the above technical problems, the inventor may consider first obtaining a plurality of training sample pairs including a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, and the first time series corresponding to the plurality of original temperature tensors as input is located before the second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; then using a plurality of training sample pairs to extract and train the spatiotemporal features of the temperature profile of the prediction neural network to construct a temperature profile prediction model, in order to improve the prediction accuracy of the temperature profile prediction model in the four dimensions of longitude, latitude, altitude and time, the encoding layer in the prediction neural network is provided with a layer height attention mechanism encoding submodule and a periodic spatiotemporal convolution encoding submodule for isobaric height attention calculation, and the decoding layer is provided with an attention spatiotemporal convolution decoding module and a temporal attention module. Moreover, since each original temperature tensor in the training sample pair is a temperature tensor of multiple meteorological grid points at different isobaric heights in a region, the temperature profile prediction model obtained by training can well reflect the correlation between the temperature profiles of different meteorological grid points in the spatiotemporal dimension. In summary, the temperature profile prediction model constructed in this scheme can significantly improve the prediction accuracy of the temperature profile.
[0057] The specific implementation of the above concept is described below.
[0058] Please refer to Figure 1 , an embodiment of the present invention provides a method for constructing a temperature profile prediction model, the method comprising:
[0059] Step 100: obtaining a plurality of training sample pairs; the training sample pairs include a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, wherein a first time series corresponding to the plurality of original temperature tensors as input is located before a second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; the original temperature tensors are temperature tensors of a plurality of meteorological grid points at different isobaric altitudes;
[0060] Step 102: Extract and train the spatiotemporal features of the temperature profile of the prediction neural network using multiple training samples to construct a temperature profile prediction model; the prediction neural network includes an encoding layer consisting of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer consisting of an attention spatiotemporal convolution decoding module and a temporal attention module.
[0061] In an embodiment of the present invention, a plurality of training sample pairs including a plurality of original temperature tensors as input and a plurality of original temperature tensors as output are first obtained, and a first time series corresponding to the plurality of original temperature tensors as input is located before a second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous, and the spatiotemporal features of the temperature profile of the training sample pairs are extracted by utilizing an encoding layer composed of a high-level attention mechanism encoding submodule and a periodic spatiotemporal convolution encoding submodule in a prediction neural network, and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module, so as to train a temperature profile prediction model, thereby improving the prediction accuracy of the temperature profile.
[0062] Described below Figure 1 How the various steps are performed.
[0063] For step 100:
[0064] In the embodiment of the present invention, each original temperature tensor in the multiple training sample pairs obtained is a four-dimensional earth grid data including longitude, latitude, altitude and time, that is, the ERA5 data set. The temperature distribution data of this data set is evenly distributed in the geographic space, that is, it is a grid type, including the temperature distribution characteristics of each area to be studied at different isobaric altitudes, with high resolution and high accuracy.
[0065] Specifically, the method for constructing training sample pairs is:
[0066] For example, the temperature distribution data of continuous monitoring from 2018 to 2021 in the ERA5 dataset is selected, with 1 hour as a time interval, that is, 1 hour of data is used as an original temperature tensor, and it is the original temperature tensor at a moment. In order to make the number of training sample pairs sufficient, the prediction neural network is fully trained, and the prediction accuracy of the temperature profile prediction model is improved, the temperature distribution data from 2018 to 2021 is segmented using a sliding window with overlapping windows, with 1 hour as a unit length, and each continuous 25 aerosol concentration spatiotemporal distribution sample images as a sequence. For example, the first time series as input of the first training sample pair is 25 time data from 0:00 on January 1, 2018 to 0:00 on January 2, 2018, and the second time series as output is 25 time data from 0:00 on January 3, 2018 to 0:00 on January 4, 2018; sliding back a time interval, that is, 1 hour, then the first time series as input of the second training sample pair is 25 time data from 1:00 on January 1, 2018 to 1:00 on January 2, 2018, and the second time series as output is 25 time data from 1:00 on January 2, 2018 to 1:00 on January 3, 2018. By analogy, the temperature distribution data is divided into training data, verification data and test data. The division of training data, verification data and test data is in a ratio of 6:2:2. Since the existing data is continuous in time, each sample image has its corresponding start time. In reality, the model usually uses historical data to train the model to predict future data. Therefore, the data segmentation should also have a time series relationship. Therefore, when training the model, the first 60% of the historical data is used as training data, the next 20% of the data is used as verification data, and the last 20% of the data is used as test data. Then the training data and verification data are shuffled separately. Shuffling can prevent the temperature profile prediction model from jittering during the training process, which is beneficial to the robustness of the temperature profile prediction model, especially when the training batch size is small. In addition, shuffling the data can also prevent overfitting.
[0067] It should be noted that the number of original temperature tensors in each time series and the time interval corresponding to each original temperature tensor can be determined according to actual conditions, so no specific limitation is made. In addition, the time lengths of the first time series and the second time series can be equal or unequal.
[0068] In the embodiment of the present invention, it is assumed that the original temperature tensor in the first time series selected as input is {X s ,X s-1 ,…,X s-N-1}, where X s Represents the original temperature tensor corresponding to time s, whose size is X s∈R n×m×c , n represents the longitude grid points that the area spans, m represents the latitude grid points that the area spans, c represents the number of isobaric height layers included, X s-1 Expressed as X s is the original temperature tensor of the same area at time s-1.
[0069] Regarding step 102:
[0070] In an embodiment of the present invention, the prediction neural network includes an encoding layer composed of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module. The encoding layer is used for feature extraction, and the decoding layer is used for temperature profile prediction based on the extracted features.
[0071] It should be noted that a layer-high attention mechanism encoding submodule and a periodic spatiotemporal convolution encoding submodule of the encoding layer can be connected in series to form an attention spatiotemporal convolution encoding module. The number of attention spatiotemporal convolution encoding modules in the encoding layer can be selected according to the depth of the spatiotemporal features to be extracted. For example, the encoding layer can be two attention spatiotemporal convolution encoding modules connected in series, or multiple attention spatiotemporal convolution encoding modules connected in series; similarly, the decoding layer can be two attention spatiotemporal convolution decoding modules connected in series, or multiple attention spatiotemporal convolution decoding modules connected in series. Therefore, the number of attention spatiotemporal convolution encoding modules in the encoding layer and the number of attention spatiotemporal convolution decoding modules in the decoding layer are not specifically limited.
[0072] In some implementations, step 102 may include the following steps S1-S5:
[0073] S1: Several original temperature tensors corresponding to the first time series in the training sample pair are input into the layer height attention mechanism encoding submodule of the encoding layer in sequence according to the time series, and isobaric height attention calculation is performed on each original temperature tensor to obtain several adjusted original temperature tensors.
[0074] Specifically, in some implementations, step S1 may include:
[0075] For example, for the input raw temperature tensor {X s ,X s-1 ,…,X s-N-1} Each temperature tensor X t ∈R n×m×c , where t∈{s,s-1,…sN-1}; First, for X t Perform global average pooling to obtain the pooling of each layer height, and then activate it with the activation function ReLU to obtain X t(1) ∈R c , then, after nonlinear activation, it has better nonlinear expression ability and can learn the nonlinear characteristics of data more effectively; then, X t (1) After a downsampling process with a magnification of r, the downsampled output X is obtained. t (2) ∈R c / r The purpose of this operation is to effectively reduce the complexity of the model through learnable parameters, making the model more robust; then, the downsampled output X t (2) , and then through an upsampling process with the same ratio r, the amount of information represented by the layer height is restored to the level before downsampling, that is, X t (3) ∈R c , the purpose of this operation is to enhance the learning ability of the model by scaling the number of calculated parameters; after that, the upsampled output X t (3) , and then after the nonlinear activation function Sigmoid activation, the attention values of different layers are obtained, that is, X t (4) ∈R c , these attention values represent the weights corresponding to different layer heights. The larger the weight, the more attention the model needs to pay attention to during the learning process, so that the model can more effectively learn the features of different layer heights with drastic changes; finally, these attention values X t (4) With the input raw temperature tensor X t Multiply them to get the output after isobaric height attention calculation, that is, x t =X t ×X t (4) , then each original temperature tensor is subjected to the above calculation, and several adjusted original temperature tensors can be obtained.
[0076] S2: Input the adjusted several original temperature tensors into the periodic spatiotemporal convolutional coding submodule in sequence according to the time series, and extract the spatiotemporal features of the original temperature tensor corresponding to the next moment based on the extracted spatiotemporal features of the original temperature tensor corresponding to the previous moment and the spatiotemporal features of the original temperature tensor corresponding to the previous period, until the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series are obtained; wherein each original temperature tensor corresponds to one moment.
[0077] In some implementations, the periodic spatiotemporal convolutional coding submodule may perform spatiotemporal feature extraction on the adjusted original temperature tensor according to the following formula:
[0078]
[0079]
[0080]
[0081]
[0082]
[0083] Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, i t is the output of the input gate, f t is the output of the forget gate, o t is the output of the output gate, e t is the output of the memory unit, e t-τ is the output of the memory unit in the previous cycle, H t-1 is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t-1, H t is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t, H t-τ is the spatiotemporal characteristics of the original temperature tensor output corresponding to time t in the previous cycle, x t is the adjusted original temperature tensor corresponding to time t, σ is the first activation function, tanh is the second activation function, W xi , W hi , W ci , W xf , W hf , W cf , W xc , W hc , W xo , W ho , W co 、b i 、b f 、b c 、b o is the network parameter of the periodic spatiotemporal convolutional encoding submodule, W it , W ft , W et , W ot , W t is the network parameter of the periodic spatiotemporal convolutional encoding submodule at time t, W i(t-τ) , W f(t-τ) , W e(t-τ) , W o(t-τ) , W t-τ is the network parameter of the periodic spatiotemporal convolutional coding submodule at time t in the previous cycle.
[0084] Specifically, the above formula is used for example.
[0085] The adjusted raw temperature tensor {X s ,X s-1 ,…,X s-N-1} Input the periodic spatiotemporal convolutional coding submodule in chronological order, s is the last moment of the first time series, and first randomly assigns H0, H 1-τ And e0, for the original temperature tensor x1 corresponding to the first moment after the adjustment of the input, after the calculation of the above formula, the memory unit output e1 when extracting the spatiotemporal features of the original temperature tensor corresponding to the first moment and the spatiotemporal features H1 of the original temperature tensor corresponding to the first moment can be obtained. Then, for the original temperature tensor x2 corresponding to the second moment after the adjustment of the input, the convolutional recurrent neural network units are cyclically run, and after the calculation of the above formula, the memory unit output e1 when extracting the spatiotemporal features of the original temperature tensor corresponding to the first moment, the spatiotemporal features H1 of the original temperature tensor corresponding to the first moment, and the spatiotemporal features H1 of the original temperature tensor corresponding to the second moment of the previous cycle are used. 2-τ And the input adjusted original temperature tensor x2 corresponding to the second moment, we can get the memory unit output e2 when extracting the spatiotemporal features of the original temperature tensor corresponding to the second moment and the spatiotemporal features H2 of the original temperature tensor corresponding to the second moment. And so on, by executing this formula in a loop, we can get the memory unit output e2 when extracting the spatiotemporal features of the original temperature tensor corresponding to the last moment of the first time series. s The spatiotemporal characteristics H of the original temperature tensor corresponding to the last moment s .
[0086] In an embodiment of the present invention, by utilizing the layer-height attention mechanism encoding submodule, it is easier to learn the characteristics of drastic changes in temperature profiles, while by utilizing the periodic spatiotemporal convolution encoding submodule, it is possible to extract the spatiotemporal characteristics of the original temperature tensor using spatiotemporal convolution while considering the periodicity of temperature changes.
[0087] S3: Input the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series into the attention spatiotemporal convolutional decoding module of the decoding layer to predict several initial temperature tensors of the second time series.
[0088] In some embodiments, the attention spatiotemporal convolutional decoding module may predict the initial temperature tensor of the second time series according to the following formula:
[0089]
[0090]
[0091]
[0092]
[0093]
[0094] Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, and i′ t is the output of the input gate, f′ t is the output of the forget gate, o′ t is the output of the output gate, e′ t is the output of the memory unit, e′ t-τ is the output of the memory unit in the previous cycle, D t-1 is the initial temperature tensor corresponding to the output time t-1, D t is the predicted initial temperature tensor corresponding to time t, D t-τ is the corresponding initial temperature tensor output at time t in the previous cycle, σ is the first activation function, tanh is the second activation function, W′ hi , W′ ci , W′ hf , W′ cf , W′ hc , W′ ho , W′ co , b′ i , b′ f , b′ c , b′ o is the network parameter of the attention spatiotemporal convolutional decoding module, W′ it , W′ ft , W′ et , W′ ot , W′ t is the network parameter of the attention spatiotemporal convolutional decoding module at time t, W′ i(t-τ) , W′ f(t-τ) , W′ e(t-τ) , W′ o(t-τ) , W′ t-τ is the network parameter of the attention spatiotemporal convolutional decoding module at time t in the previous cycle.
[0095] Specifically, the above formula is used for example.
[0096] The memory unit output e of the periodic spatiotemporal convolutional coding submodule obtained in step S2 when extracting the spatiotemporal features of the original temperature tensor corresponding to the last moment of the first time series s The spatiotemporal characteristics H of the original temperature tensor corresponding to the last moment sThe attention spatiotemporal convolutional decoding module of the input decoding layer can be calculated by the above formula to obtain the memory unit output e′ of the decoding layer when predicting the initial temperature tensor corresponding to the time s+1: s+1 , and the initial temperature tensor D corresponding to time s+1 s+1 Next, the periodic spatiotemporal convolutional encoding submodule is run cyclically. After the calculation of the above formula, the memory unit output e′ of the attention spatiotemporal convolutional decoding module is used to predict the initial temperature tensor corresponding to the time s+1. s+1 , the initial temperature tensor D corresponding to time s+1 s+1 And the output e′ of the memory unit at the last cycle s+2 s+2-τ , the initial temperature tensor D at the last cycle s+2 s+2-τ , we can get the memory unit output e′ of the attention spatiotemporal convolutional decoding module when predicting the initial temperature tensor at time s+2 s+1 and the initial temperature tensor D corresponding to time s+2 s+2 By analogy, by executing this formula cyclically, several initial temperature tensors of the second time series can be predicted.
[0097] In an embodiment of the present invention, by utilizing the layer-height attention mechanism decoding submodule, it is easier to predict the characteristics of drastic changes in the temperature profile, while by utilizing the periodic spatiotemporal convolution decoding submodule, it is possible to more accurately predict the initial temperature tensor based on the spatiotemporal characteristics of the original temperature tensor by utilizing spatiotemporal convolution while considering the periodicity of temperature changes.
[0098] S4: Using the temporal attention module of the encoding layer, according to the spatiotemporal characteristics of several original temperature tensors of the first time series, perform temporal attention calculation on each initial temperature tensor of the predicted second time series, and output several predicted temperature tensors.
[0099] In some implementations, the temporal attention module may obtain a predicted temperature tensor according to the following formula, including:
[0100]
[0101]
[0102]
[0103] in, represents the Hadamard product, H i is the spatiotemporal feature of the original temperature tensor of the first time series in the encoding layer, i∈{s,s-1,…sN-1}, s is the last moment of the first time series, N is the number of original temperature tensors of the first time series, D s+kis the kth initial temperature tensor of the second time series predicted by the attention spatiotemporal convolutional decoding module, a i is the spatiotemporal characteristics of the ith original temperature tensor relative to D s+k The attention distribution value, C s+k is the attention state value, tanh is the activation function, W c are the network parameters of the temporal attention module, The kth predicted temperature tensor of the second time series obtained by the temporal attention module.
[0104] In an embodiment of the present invention, in order to increase the prediction speed of the temperature profile prediction model, before outputting several predicted temperature tensors using the temporal attention module of the encoding layer with reference to the above formula, it is also necessary to simplify the spatiotemporal characteristics of several original temperature tensors of the first time series.
[0105] For example, for the spatiotemporal features of several original temperature tensors {H s ,H s-1 ,…,H s-N-1}, for each H i , where i∈{s,s-1,…sN-1}, first perform a three-dimensional convolution operation with an output channel of 1 to compress the high-dimensional tensor into a matrix H i (1) , reducing the amount of calculation during attention calculation; then, using the shared learnable vector, the matrix H i (1) Transformed into a hidden vector space, further simplifying the computational complexity, we get a vector H i (2) , the processed vector H i (2) As the input H in the above formula i .
[0106] Afterwards, an example is given with reference to the above formula to illustrate how the temporal attention module obtains the predicted temperature tensor.
[0107] Calculate the spatiotemporal characteristics H of all original temperature tensors i Relative to each initial temperature tensor D output by the attention spatiotemporal convolutional decoding module s+k Attention distribution, these adaptive calculations finally get the corresponding attention distribution value a i , the corresponding attention state value C is calculated by weighted summation s+k ,Finally, according to the attention state value C s+k And the initial temperature tensor D output by decoding s+k Get the final predicted temperature tensor In this way, several predicted temperature tensors of the second time series can be obtained.
[0108] In the embodiment of the present invention, the spatiotemporal features {H s ,H s-1 ,…,H s-N-1}Calculate its temporal importance, and perform weighted summation on the spatiotemporal features of these original temperature tensors according to these importances to obtain the final output of the decoding layer, that is, several predicted temperature tensors of the second time series, where the value range of k is greater than or equal to 1 and less than or equal to the number of temperature tensors of the second time series.
[0109] S5: According to the outputted predicted temperature tensors and the original temperature tensors of the training sample pairs corresponding to the second time series, the network parameters of the prediction neural network are adjusted until a temperature profile prediction model that meets expectations is obtained.
[0110] In this step, the network parameters of the prediction neural network are adjusted according to the output of several predicted temperature tensors and several original temperature tensors corresponding to the second time series in the training sample pairs, so that the value of the total loss function is minimized, and the network parameters of the temperature profile prediction model that meets the expectations are adjusted, thereby training a temperature profile prediction model that meets the expectations.
[0111] This embodiment also provides a prediction method for predicting a temperature profile based on a temperature profile prediction model constructed by any method for constructing a temperature profile prediction model described in the specification, comprising:
[0112] Get several raw temperature tensors of the historical time series;
[0113] Input several original temperature tensors of the historical time series into the temperature profile prediction model;
[0114] Receive several predicted temperature tensors of the next time series of the historical time series output by the temperature profile prediction model.
[0115] like Figure 2 , Figure 3 As shown, an embodiment of the present invention provides a device for constructing a temperature profile prediction model. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, Figure 2 As shown, it is a hardware architecture diagram of an electronic device where a device for constructing a temperature profile prediction model provided by an embodiment of the present invention is located, except Figure 3In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 3 As shown, as a device in a logical sense, the CPU of the electronic device in which it is located reads the corresponding computer program in the non-volatile memory into the internal memory and runs it.
[0116] like Figure 3 As shown, this embodiment provides a device for constructing a temperature profile prediction model, including:
[0117] The acquisition unit 301 is used to acquire multiple training sample pairs; the training sample pairs include a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, the first time series corresponding to the plurality of original temperature tensors as input is located before the second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; the original temperature tensors are temperature tensors of a plurality of meteorological grid points at different isobaric altitudes;
[0118] The construction unit 302 is used to extract and train the spatiotemporal features of the temperature profile of the prediction neural network using multiple training samples to construct a temperature profile prediction model; the prediction neural network includes an encoding layer composed of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module.
[0119] In one embodiment of the present invention, the construction unit 302 is used to perform the following operations:
[0120] Input several original temperature tensors corresponding to the first time series in the training sample pair into the layer height attention mechanism encoding submodule of the encoding layer in sequence according to the time series, perform isobaric height attention calculation on each original temperature tensor, and obtain several adjusted original temperature tensors;
[0121] Input the adjusted several original temperature tensors into the periodic spatiotemporal convolutional coding submodule in sequence according to the time series, extract the spatiotemporal features of the original temperature tensor corresponding to the next moment based on the extracted spatiotemporal features of the original temperature tensor corresponding to the previous moment and the spatiotemporal features of the original temperature tensor corresponding to the previous period, until the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series are obtained; wherein each original temperature tensor corresponds to one moment;
[0122] Input the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series into the attention spatiotemporal convolutional decoding module of the decoding layer to predict several initial temperature tensors of the second time series;
[0123] Using the temporal attention module of the encoding layer, according to the spatiotemporal characteristics of several original temperature tensors of the first time series, a temporal attention calculation is performed on each initial temperature tensor of the predicted second time series, and several predicted temperature tensors are output;
[0124] According to the outputted predicted temperature tensors and the original temperature tensors of the training sample pairs corresponding to the second time series, the network parameters of the prediction neural network are adjusted until a temperature profile prediction model that meets expectations is obtained.
[0125] In one embodiment of the present invention, in the construction unit 302, the periodic spatiotemporal convolutional coding submodule extracts spatiotemporal features of the adjusted original temperature tensor according to the following formula:
[0126]
[0127]
[0128]
[0129]
[0130]
[0131] Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, i t is the output of the input gate, f t is the output of the forget gate, o t is the output of the output gate, e t is the output of the memory unit, e t-τ is the output of the memory unit in the previous cycle, H t-1 is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t-1, H t is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t, H t-τ is the spatiotemporal characteristics of the original temperature tensor output corresponding to time t in the previous cycle, x t is the adjusted original temperature tensor corresponding to time t, σ is the first activation function, tanh is the second activation function, W xi , W hi , W ci , W xf , W hf , Wcf , W xc , W hc , W xo , W ho , W co 、b i 、b f 、b c 、b o is the network parameter of the periodic spatiotemporal convolutional encoding submodule, W it , W ft , W et , W ot , W t is the network parameter of the periodic spatiotemporal convolutional encoding submodule at time t, W i(t-τ) , W f(t-τ) , W e(t-τ) , W o(t-τ) , W t-τ is the network parameter of the periodic spatiotemporal convolutional coding submodule at time t in the previous cycle.
[0132] In one embodiment of the present invention, in the construction unit 302, the attention spatiotemporal convolutional decoding module predicts the initial temperature tensor of the second time series according to the following formula:
[0133]
[0134]
[0135]
[0136]
[0137]
[0138] Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, and i′ t is the output of the input gate, f′ t is the output of the forget gate, o′ t is the output of the output gate, e′ t is the output of the memory unit, e′ t-τ is the output of the memory unit in the previous cycle, D t-1 is the initial temperature tensor corresponding to the output time t-1, D t is the predicted initial temperature tensor corresponding to time t, D t-τ is the corresponding initial temperature tensor output at time t in the previous cycle, σ is the first activation function, tanh is the second activation function, W′ hi , W′ ci , W′hf , W′ cf , W′ hc , W′ ho , W′ co , b′ i , b′ f , b′ c , b′ o is the network parameter of the attention spatiotemporal convolutional decoding module, W′ it , W′ ft , W′ et , W′ ot , W′ t is the network parameter of the attention spatiotemporal convolutional decoding module at time t, W′ i(t-τ) , W′ f(t-τ) , W′ e(t-τ) , W′ o(t-τ) , W′ t-τ is the network parameter of the attention spatiotemporal convolutional decoding module at time t in the previous cycle.
[0139] In one embodiment of the present invention, in the construction unit 302, the temporal attention module obtains the predicted temperature tensor according to the following formula, including:
[0140]
[0141]
[0142]
[0143] in, represents the Hadamard product, H i is the spatiotemporal feature of the original temperature tensor of the first time series in the encoding layer, i∈{s,s-1,…sN-1}, s is the last moment of the first time series, N is the number of original temperature tensors of the first time series, D s+k is the kth initial temperature tensor of the second time series predicted by the attention spatiotemporal convolutional decoding module, a i is the spatiotemporal characteristics of the ith original temperature tensor relative to D s+k The attention distribution value, C s+k is the attention state value, tanh is the activation function, W c are the network parameters of the temporal attention module, The kth predicted temperature tensor of the second time series obtained by the temporal attention module.
[0144] like Figure 4 , Figure 5As shown, an embodiment of the present invention provides a temperature profile prediction device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, Figure 4 As shown, it is a hardware architecture diagram of an electronic device in which a temperature profile prediction device provided by an embodiment of the present invention is located. Figure 5 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 5 As shown, as a device in a logical sense, the CPU of the electronic device in which it is located reads the corresponding computer program in the non-volatile memory into the internal memory and runs it.
[0145] like Figure 5 As shown, a temperature profile prediction device provided by an embodiment of the present invention includes:
[0146] A sequence acquisition unit 501 is used to acquire a number of original temperature tensors of a historical time series;
[0147] An input unit 502 is used to input a plurality of original temperature tensors of a historical time series into a temperature profile prediction model; the temperature profile prediction model is constructed using any method for constructing a temperature profile prediction model described in this specification;
[0148] The prediction unit 503 is used to receive a plurality of predicted temperature tensors of the next time series of the historical time series output by the temperature profile prediction model.
[0149] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on a device for constructing a temperature profile prediction model / a device for predicting a temperature profile. In other embodiments of the present invention, a device for constructing a temperature profile prediction model / a device for predicting a temperature profile may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0150] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.
[0151] An embodiment of the present invention also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, a method for constructing a temperature profile prediction model in any embodiment of the present invention and a prediction method for predicting a temperature profile using a temperature profile prediction model constructed using any of the methods described in this specification are implemented.
[0152] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes a method for constructing a temperature profile prediction model in any embodiment of the present invention and a prediction method for predicting a temperature profile using a temperature profile prediction model constructed using any of the methods described in this specification.
[0153] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.
[0154] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0155] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0156] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0157] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0158] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical factors in the process, method, article or device including the elements.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a temperature profile prediction model, characterized in that: include: A plurality of training sample pairs are obtained; the training sample pairs include a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, the first time series corresponding to the plurality of original temperature tensors as input is located before the second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; the original temperature tensor is a temperature tensor of a plurality of meteorological grid points at different isobaric heights; the size of the original temperature tensor is X s ∈R n×m×c , X s represents the original temperature tensor corresponding to time s, n represents the longitude grid points spanned by the region, m represents the latitude grid points spanned by the region, and c represents the number of isobaric height layers included; The prediction neural network is used to extract and train the spatiotemporal features of the temperature profile using multiple training samples to construct a temperature profile prediction model; the prediction neural network includes an encoding layer composed of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module; The method of extracting and training the temporal and spatial characteristics of the temperature profile of the prediction neural network using multiple training samples to construct a temperature profile prediction model includes: Inputting the several original temperature tensors corresponding to the first time series in the training sample pair into the layer height attention mechanism encoding submodule of the encoding layer in sequence according to the time series, performing isobaric height attention calculation on each original temperature tensor, and obtaining several adjusted original temperature tensors; Inputting the adjusted several original temperature tensors into the periodic spatiotemporal convolutional coding submodule in sequence according to the time series, extracting the spatiotemporal features of the original temperature tensor corresponding to the next moment based on the extracted spatiotemporal features of the original temperature tensor corresponding to the previous moment and the spatiotemporal features of the original temperature tensor corresponding to the previous period, until the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series are obtained; wherein each original temperature tensor corresponds to one moment; Inputting the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series into the attention spatiotemporal convolutional decoding module of the decoding layer to predict several initial temperature tensors of the second time series; Using the temporal attention module of the decoding layer, according to the spatiotemporal features of the several original temperature tensors of the first time series, perform temporal attention calculation on each initial temperature tensor of the predicted second time series, and output several predicted temperature tensors; According to the outputted predicted temperature tensors and the original temperature tensors of the training sample pairs corresponding to the second time series, adjusting the network parameters of the prediction neural network until a temperature profile prediction model that meets expectations is obtained; The periodic spatiotemporal convolutional coding submodule extracts spatiotemporal features from the adjusted original temperature tensor according to the following formula: Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, i t is the output of the input gate, f t is the output of the forget gate, o t is the output of the output gate, e t is the output of the memory unit, e t-τ is the output of the memory unit in the previous cycle, H t-1 is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t-1, H t is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t, H t-τ is the spatiotemporal characteristics of the original temperature tensor output corresponding to time t in the previous cycle, x t is the adjusted original temperature tensor corresponding to time t, σ is the first activation function, tanh is the second activation function, W xi , W hi , W ci , W xf , W hf , W cf , W xc , W hc , W xo , W h0 , W co 、b i 、b f 、b c 、b o is the network parameter of the periodic spatiotemporal convolutional coding submodule, W it , W ft , W et , W ot , W t is the network parameter of the periodic spatiotemporal convolutional coding submodule at time t, W i(t-τ) , W f(t-τ) , W e(t-τ) , W o(t-τ) , W t-τ is the network parameter of the periodic spatiotemporal convolutional coding submodule at time t in the previous cycle; The temporal attention module of the decoding layer is used to perform temporal attention calculation on each initial temperature tensor of the predicted second time series according to the spatiotemporal characteristics of the several original temperature tensors of the first time series, and output several predicted temperature tensors, including: Calculating the attention distribution of the spatiotemporal features of the original temperature tensor in the first time series relative to each initial temperature tensor output by the attention spatiotemporal convolution decoding module; performing weighted summation on the attention distribution values to calculate the corresponding attention state value; and obtaining a plurality of predicted temperature tensors according to each attention state value and the corresponding initial temperature tensor; The temporal attention module obtains the predicted temperature tensor according to the following formula, including: in, represents the Hadamard product, H i is the spatiotemporal feature of the original temperature tensor of the first time series in the coding layer, i∈{s,s-1,…sN-1}, s is the last moment of the first time series, N is the number of original temperature tensors of the first time series, D s+k is the kth initial temperature tensor of the second time series predicted by the attention spatiotemporal convolutional decoding module, a i is the spatiotemporal characteristics of the ith original temperature tensor relative to D s+k The attention distribution value, C s+k is the attention state value, tanh is the activation function, W c are the network parameters of the temporal attention module, The kth predicted temperature tensor of the second time series obtained by the temporal attention module.
2. The method according to claim 1, characterized in that The attention spatiotemporal convolutional decoding module predicts the initial temperature tensor of the second time series according to the following formula: Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, and i′ t is the output of the input gate, f t ′ is the output of the forget gate, o′ t is the output of the output gate, e′ t is the output of the memory unit, e′ t-τ is the output of the memory unit in the previous cycle, D t-1 is the initial temperature tensor corresponding to the output time t-1, D t is the predicted initial temperature tensor corresponding to time t, D t-τ is the corresponding initial temperature tensor output at time t in the previous cycle, σ is the first activation function, tanh is the second activation function, W′ hi , W′ ci , W′ hf , W′ cf , W′ hc , W′ ho , W′ co , b′ i , b′ f , b′ c , b′ o is the network parameter of the attention spatiotemporal convolutional decoding module, W′ it , W′ ft , W′ et , W′ ot , W′ t is the network parameter of the attention spatiotemporal convolutional decoding module at time t, W′ i(t-τ) , W′ f(t-τ) , W′ e(t-τ) , W′ o(t-τ) , W′ t-τ are the network parameters of the attention spatiotemporal convolutional decoding module at time t in the previous cycle.
3. A prediction method for temperature profile prediction using a temperature profile prediction model constructed by the method described in any one of claims 1 to 2, characterized in that: include: Get several raw temperature tensors of the historical time series; Inputting a plurality of original temperature tensors of the historical time series into the temperature profile prediction model; A plurality of predicted temperature tensors of the next time series of the historical time series output by the temperature profile prediction model are received.
4. A device for constructing a temperature profile prediction model, characterized in that: include: An acquisition unit is used to acquire multiple training sample pairs; the training sample pairs include a plurality of original temperature tensors as input and a plurality of original temperature tensors as output, the first time series corresponding to the plurality of original temperature tensors as input is located before the second time series of the plurality of original temperature tensors as output, and the first time series and the second time series are continuous; the original temperature tensor is a temperature tensor of a plurality of meteorological grid points at different isobaric heights; the size of the original temperature tensor is X s ∈R n×m×c , X s represents the original temperature tensor corresponding to time s, n represents the longitude grid points spanned by the region, m represents the latitude grid points spanned by the region, and c represents the number of isobaric height layers included; A construction unit is used to extract and train the spatiotemporal features of the temperature profile of the prediction neural network using multiple training samples to construct a temperature profile prediction model; the prediction neural network includes an encoding layer composed of a layer height attention mechanism encoding submodule for isobaric height attention calculation and a periodic spatiotemporal convolution encoding submodule, and a decoding layer composed of an attention spatiotemporal convolution decoding module and a temporal attention module; Building blocks are used to perform the following operations: Input several original temperature tensors corresponding to the first time series in the training sample pair into the layer height attention mechanism encoding submodule of the encoding layer in sequence according to the time series, perform isobaric height attention calculation on each original temperature tensor, and obtain several adjusted original temperature tensors; Input the adjusted several original temperature tensors into the periodic spatiotemporal convolutional coding submodule in sequence according to the time series, extract the spatiotemporal features of the original temperature tensor corresponding to the next moment based on the extracted spatiotemporal features of the original temperature tensor corresponding to the previous moment and the spatiotemporal features of the original temperature tensor corresponding to the previous period, until the spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series are obtained; wherein each original temperature tensor corresponds to one moment; The spatiotemporal features of the original temperature tensor corresponding to the last moment in the first time series are input into the attention spatiotemporal convolutional decoding module of the decoding layer to predict several initial temperature tensors of the second time series; Using the temporal attention module of the decoding layer, according to the spatiotemporal characteristics of several original temperature tensors of the first time series, a temporal attention calculation is performed on each initial temperature tensor of the predicted second time series, and several predicted temperature tensors are output; According to the outputted predicted temperature tensors and the original temperature tensors of the training sample pairs corresponding to the second time series, the network parameters of the prediction neural network are adjusted until a temperature profile prediction model that meets expectations is obtained; In the construction unit, the periodic spatiotemporal convolutional coding submodule extracts spatiotemporal features of the adjusted original temperature tensor according to the following formula: Among them, * represents convolution, · represents product, represents the Hadamard product, τ is the time period of the original temperature tensor, i t is the output of the input gate, f t is the output of the forget gate, o t is the output of the output gate, e t is the output of the memory unit, e t-τ is the output of the memory unit in the previous cycle, H t-1 is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t-1, H t is the spatiotemporal characteristics of the original temperature tensor corresponding to the output time t, H t-τ is the spatiotemporal characteristics of the original temperature tensor output corresponding to time t in the previous cycle, x t is the adjusted original temperature tensor corresponding to time t, σ is the first activation function, tanh is the second activation function, W xi , W hi , W ci , W xf , W hf , W cf , W xc , W hc , W xo , W ho , W co 、b i 、b f 、b c 、b o is the network parameter of the periodic spatiotemporal convolutional encoding submodule, W it , W ft , W et , W ot , W t is the network parameter of the periodic spatiotemporal convolutional encoding submodule at time t, W i(t-τ) , W f(t-τ) , W e(t-τ) , W o(t-τ) , W t-τ is the network parameter of the periodic spatiotemporal convolutional coding submodule at time t in the previous cycle; When executing the temporal attention module using the decoding layer, the construction unit performs temporal attention calculation on each initial temperature tensor of the predicted second time series according to the spatiotemporal characteristics of the several original temperature tensors of the first time series, and outputs several predicted temperature tensors, for: Calculating the attention distribution of the spatiotemporal features of the original temperature tensor in the first time series relative to each initial temperature tensor output by the attention spatiotemporal convolution decoding module; performing weighted summation on the attention distribution values to calculate the corresponding attention state value; and obtaining a plurality of predicted temperature tensors according to each attention state value and the corresponding initial temperature tensor; The temporal attention module in the construction unit obtains the predicted temperature tensor according to the following formula, including: in, represents the Hadamard product, H i is the spatiotemporal feature of the original temperature tensor of the first time series in the coding layer, i∈{s,s-1,…sN-1}, s is the last moment of the first time series, N is the number of original temperature tensors of the first time series, D s+k is the kth initial temperature tensor of the second time series predicted by the attention spatiotemporal convolutional decoding module, a i is the spatiotemporal characteristics of the ith original temperature tensor relative to D s+k The attention distribution value, C s+k is the attention state value, tanh is the activation function, W c are the network parameters of the temporal attention module, The kth predicted temperature tensor of the second time series obtained by the temporal attention module.
5. A temperature profile prediction device, characterized in that: include: A sequence acquisition unit, used to obtain several original temperature tensors of the historical time series; An input unit, used for inputting a plurality of original temperature tensors of a historical time series into a temperature profile prediction model; the temperature profile prediction model is constructed using the method described in any one of claims 1-2; The prediction unit is used to receive a plurality of predicted temperature tensors of the next time series of the historical time series output by the temperature profile prediction model.
6. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 2 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 2.
