A microclimate prediction method, system, device and medium based on an attention mechanism

By combining LSTM and Attention mechanisms, the ALSTM model improves the accuracy of microclimate prediction using historical local and surrounding meteorological data, addressing the shortcomings of traditional methods in microclimate prediction, especially significantly reducing prediction errors in temperature, wind speed, and air pressure.

CN119669933BActive Publication Date: 2026-05-15HARBIN INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN INST OF TECH
Filing Date
2024-11-29
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional numerical weather models perform poorly in microclimate prediction, and deep learning methods lack predictive power beyond meteorological elements, failing to effectively utilize prior knowledge from local history and surrounding weather stations.

Method used

We adopt an attention-based microclimate prediction method, combining a long short-term memory network (LSTM) and an attention mechanism. By incorporating historical local meteorological data and forecast information from surrounding meteorological stations as temporal and spatial features, we design a local microclimate prediction model (ALSTM).

Benefits of technology

It improves the accuracy of microclimate prediction, especially in terms of significantly reducing prediction errors for meteorological elements such as temperature, wind speed, and air pressure, outperforming traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669933B_ABST
    Figure CN119669933B_ABST
Patent Text Reader

Abstract

The application discloses a microclimate prediction method, system, device and medium based on an attention mechanism, and comprises the following steps: acquiring meteorological data of a region to be predicted, wherein the meteorological data comprises historical local meteorological data of the region to be predicted and surrounding meteorological station prediction information; inputting the meteorological data into a climate prediction model for prediction classification to obtain climate prediction data, wherein the climate prediction model comprises a feature extraction module, a residual connection module, a normalization module and a prediction module connected in sequence, and the feature extraction module comprises a long short-term memory network module and an attention module arranged in parallel. The technical scheme disclosed by the application can be extended to the prediction of other meteorological elements and can improve the prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of meteorological forecasting technology, and in particular relates to a microclimate forecasting method, system, device and medium based on an attention mechanism. Background Technology

[0002] Under the same macroclimate background, special local climates that differ from the macroclimate due to factors such as topography, underlying surface properties, and human activities are called microclimate phenomena.

[0003] Since microclimate phenomena typically occur at scales smaller than the NWP grid, traditional numerical weather models that employ macroscopic physical laws do not perform ideally in predicting microclimates. The 1km reanalysis meteorological data HRCLDAS using numerical models exhibits significant errors at small scales compared to actual MAE observations from weather stations. However, utilizing artificial intelligence algorithms for information fusion and analysis can achieve more accurate local forecasts.

[0004] The basic principle of using deep learning for microclimate prediction is a regression problem. The general steps are: processing meteorological data by performing operations such as missing data filling and normalization; gradually building and training a neural network by extracting data features; and predicting the microclimate of a certain location in the future.

[0005] Traditional deep learning methods only demonstrate good performance in predicting meteorological elements for specific parameters, and their ability to extend to other meteorological elements is insufficient. Furthermore, they do not make good use of prior knowledge from local historical data and forecasts from surrounding weather stations. Summary of the Invention

[0006] The purpose of this invention is to provide a microclimate prediction method, system, device, and medium based on an attention mechanism to solve the problems existing in the prior art.

[0007] To achieve the above objectives, this invention provides a microclimate prediction method based on an attention mechanism, comprising:

[0008] Acquire meteorological data for the area to be predicted, including historical local meteorological data for the area to be predicted and forecast information from surrounding meteorological stations;

[0009] The meteorological data is input into a climate prediction model for prediction and classification to obtain climate prediction data. The climate prediction model includes a feature extraction module, a residual connection module, a normalization module, and a prediction module connected in sequence. The feature extraction module includes a long short-term memory network module and an attention module set in parallel.

[0010] Optionally, the training process of the climate prediction model specifically includes:

[0011] Acquire training data, which includes meteorological training data at different times;

[0012] An initial climate prediction model is constructed. The training data is input into the initial climate prediction model for prediction and classification. The goal is to minimize the loss between the initial training results after classification and the meteorological training data at the next moment corresponding to the input meteorological training data. The trained climate prediction model is obtained.

[0013] Optionally, the processing procedure of the climate prediction model specifically includes:

[0014] The historical local meteorological data is input into the long short-term memory network module for time feature extraction to obtain time feature data;

[0015] The forecast information from the surrounding meteorological stations is input into the attention module for spatial feature extraction to obtain spatial feature data;

[0016] The temporal feature data and the spatial feature data are input into the residual connection module and the normalization module for fusion to obtain fused data. Time coding is introduced into the fused data, and the fused data with time coding is input into the prediction module for prediction and classification to obtain the climate prediction data.

[0017] Optionally, the step of inputting the historical local meteorological data into the long short-term memory network module for time feature extraction specifically includes:

[0018] The historical local meteorological data is input into the long short-term memory network module to extract the characteristics and trends of meteorological elements in the time dimension, thereby obtaining the time feature data. The long short-term memory network module includes several long short-term memory network structures connected in sequence.

[0019] Optionally, the step of inputting the forecast information from the surrounding meteorological stations into the attention module for spatial feature extraction specifically includes:

[0020] The forecast information from the surrounding meteorological stations is input into the attention module, and the correlation between the forecast information from different meteorological stations is calculated to obtain the spatial feature data.

[0021] A climate prediction system based on an attention mechanism includes:

[0022] The data acquisition module is used to acquire meteorological data of the area to be predicted, including historical local meteorological data of the area to be predicted and forecast information from surrounding meteorological stations.

[0023] The climate prediction module is used to input the meteorological data into the climate prediction model for prediction and classification to obtain climate prediction data. The climate prediction model includes a feature extraction module, a residual connection module, a normalization module, and a prediction module connected in sequence. The feature extraction module includes a long short-term memory network module and an attention module set in parallel.

[0024] An electronic device includes a memory and a processor, the memory storing a computer program and the processor running the computer program to enable the electronic device to perform the attention-based microclimate prediction method.

[0025] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned attention-based microclimate prediction method.

[0026] The technical effects of this invention are as follows:

[0027] Based on deep learning technology, this invention introduces historical local meteorological data and forecast information from surrounding meteorological stations as temporal and spatial features. It designs and implements an ALSTM local microclimate prediction model that combines LSTM and Attention mechanism, which can improve the accuracy of prediction and achieve representative experimental results on three meteorological elements: temperature, wind speed, and air pressure. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0030] Figure 1 This is a diagram of the microclimate prediction network structure in an embodiment of the present invention;

[0031] Figure 2 This is a schematic diagram comparing the MAE error of temperature prediction in an embodiment of the present invention;

[0032] Figure 3 This is a schematic diagram showing the comparison results of ALSTM and LSTM temperature prediction MAE in an embodiment of the present invention.

[0033] Figure 4This is a flowchart of an embodiment of the present invention. Detailed Implementation

[0034] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as a limitation of the present invention, but rather as a more detailed description of certain aspects, features, and embodiments of the present invention.

[0035] It should be understood that the terminology used in this invention is merely for describing particular embodiments and is not intended to limit the invention. Furthermore, with respect to numerical ranges in this invention, it should be understood that each intermediate value between the upper and lower limits of the range is also specifically disclosed. Every smaller range between any stated value or intermediate value within a stated range, and any other stated value or intermediate value within said range, is also included in this invention. The upper and lower limits of these smaller ranges may be independently included or excluded from the range.

[0036] Unless otherwise stated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. While only preferred methods have been described herein, any methods similar or equivalent to those described herein may be used in the implementation or testing of this invention. All references to this specification are incorporated by way of citation to disclose and describe the methods associated with those references. In the event of any conflict with any incorporated reference, the content of this specification shall prevail.

[0037] Various modifications and variations can be made to the specific embodiments described in this specification without departing from the scope or spirit of the invention, as will be apparent to those skilled in the art. Other embodiments derived from this specification will also be obvious to those skilled in the art. This application specification and embodiments are merely exemplary.

[0038] The terms “include,” “including,” “have,” “contain,” etc., used in this article are all open-ended terms, meaning that they include but are not limited to.

[0039] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0040] Example 1

[0041] like Figure 1 - Figure 4As shown, this embodiment provides a microclimate prediction method based on an attention mechanism, including: acquiring meteorological data of the area to be predicted, the meteorological data including historical local meteorological data of the area to be predicted and forecast information of surrounding meteorological stations; inputting the meteorological data into a climate prediction model for prediction and classification to obtain climate prediction data, wherein the climate prediction model includes a feature extraction module, a residual connection module, a normalization module and a prediction module connected in sequence, and the feature extraction module includes a long short-term memory network module and an attention module set in parallel.

[0042] The training process of the climate prediction model specifically includes:

[0043] Acquire training data, which includes meteorological training data at different times;

[0044] An initial climate prediction model is constructed. The training data is input into the initial climate prediction model for prediction and classification. The goal is to minimize the loss between the initial training results after classification and the meteorological training data at the next moment corresponding to the input meteorological training data. The trained climate prediction model is obtained.

[0045] To improve the accuracy of microclimate prediction and achieve superior performance in areas with significant local characteristics, this embodiment, based on deep learning technology, incorporates historical local meteorological data and forecast information from surrounding meteorological stations as temporal and spatial features. A local microclimate prediction model, ALSTM, combining LSTM and an attention mechanism, was designed and implemented. Representative experimental results were obtained for three meteorological elements: temperature, wind speed, and air pressure.

[0046] The prediction model structure in this embodiment is as follows: Figure 1 As shown, the model extracts temporal features through an LSTM module and spatial features through an Attention mechanism. The residual connections and normalization results are temporally encoded to incorporate temporal information and assist the model in completing microclimate predictions.

[0047] Figure 1 China and Israel predict local temperature variables from time T to time T+k at time T-1. For example, in the experiment, the temperature of the next 24 hours is predicted based on the historical 72-hour temperature. Since the observation time interval of the data is 3 hours, the actual T value is 24, and k equals 7. The local observation sequence is input into the LSTM. This is the temporal trend of local temperature from time 0 to time T+k, and the final output is the hidden state h at time step T. T The weather station forecast inputs Self-Attention. This represents the spatial correlation of temperature forecasts for m stations surrounding the local weather station from time T to time T+k. The spatial and temporal features are extracted and fused using residual connections and normalization. Temporal information is then incorporated into the local forecast through a linear layer.

[0048] To demonstrate the effectiveness of introducing temporal and spatial features, this embodiment uses MAE as the performance evaluation index of the model itself and conducts comparative experiments.

[0049] The experiment compared three objects: 1km reanalysis data HRCLDAS, to verify whether fitting predictions based on local features have an advantage in areas with significant local characteristics;

[0050] Using only the LSTM model to capture the local characteristics of meteorological elements in a time dimension model, we verify whether introducing meteorological information from surrounding meteorological stations can effectively improve forecast accuracy.

[0051] We used only the Attention mechanism to extract the spatial dimension model of meteorological connections between the surrounding area and the local area, and verified whether the introduction of local historical observation information effectively corrected the prediction results.

[0052] Furthermore, to explore the impact of the spatial extent of surrounding meteorological station data on the prediction results, the proposed ALSTM was divided into two models: the ALSTM-all model, which uses meteorological information from meteorological stations throughout Heilongjiang Province, and the ALSTM-part model, which uses meteorological information from meteorological stations within a 500-kilometer radius of the local area and with smaller prediction biases.

[0053] The experimental results obtained from microclimate prediction in some areas of Heilongjiang are as follows:

[0054] Table 1 Comparison of MAE (temperature prediction) (°C)

[0055]

[0056] Table 1 shows that in some local geographical locations, such as the meteorological stations in Mohe, Huma, and Yichun in Heilongjiang Province, there are significant differences between the temperature prediction errors and the actual observation data, which are significantly higher than the average error of 1.656℃ of the HRCLDAS model. In contrast, the ALSTM model has smaller prediction errors and performs better in such areas with significant local characteristics.

[0057] Even using the LSTM model alone, leveraging local historical information for prediction can improve prediction accuracy. The LSTM model achieved a MAE of 1.539℃ on the test set, lower than the prediction error of HRCLDAS, with particularly significant results at smaller weather stations. The temperature prediction errors at the Mohe, Huma, and Yichun weather stations were reduced to 1.894℃, 1.954℃, and 1.561℃, respectively.

[0058] The spatial dimension model using only the attention mechanism did not show a significant improvement in average performance compared to HRCLDAS, demonstrating the irreplaceable role of temporal features in weather forecasting. Comparing the experimental results of LSTM and ALSTM, the addition of spatial features further reduced the model's prediction error, from an average of 1.539 to 1.459. Furthermore, it outperformed the LSTM model using only temporal information at each time step, as shown below. Figure 3 As shown.

[0059] In terms of spatial range selection for meteorological station data, the ALSTM-part model achieved superior performance with an average prediction error of 1.331℃, lower than the 1.459℃ of the ALSTM-all model. This result indicates that selecting only meteorological station data closely related to local weather and with smaller errors can effectively reduce model interference, thereby improving prediction accuracy.

[0060] To verify the performance of ALSTM in microclimate prediction under different meteorological elements, in addition to the temperature prediction experiment, comparative experiments were also conducted on wind speed and air pressure, two other meteorological variables. The results were similar, as shown in Tables 2 and 3 below:

[0061] Table 2 Comparison of MAE for Wind Speed ​​Forecast (m / s)

[0062]

[0063] Table 3 Comparison of MAE (hpa) for air pressure forecasts

[0064]

[0065] The overall prediction flowchart of ALSTM is as follows: Figure 4 As shown, the model accepts local observation sequences and forecasts from m weather stations as input, supplemented by introduced temporal information, to complete microclimate predictions. This will be discussed in detail below.

[0066] The model in this embodiment can be divided into two modules: an LSTM module and an Attention module, each processing an input stream, such as... Figure 4 As shown.

[0067] The LSTM module accepts local observation sequences as input. Taking a meteorological variable for a prediction time period T as an example, the local observation sequence is the historical meteorological data from time 0 to time T-1. The LASTM module consists of multiple LSTM structures connected in series and is responsible for extracting the characteristics and trends of meteorological elements in the time dimension.

[0068] The Attention module accepts forecasts from m weather stations as input, representing weather forecasts from local and surrounding weather stations for a given time period T. The Attention module multiplies each weather station's forecast by a different vector W. Q W K W V The resulting vectors Q, K, and V are used as inputs to learn the correlation between different spatial weather forecasts using a dot product approach.

[0069] The outputs of the two input streams, after being processed by residual connection and normalization, along with the time information encoded by time, are input into a linear layer to obtain the local weather forecast result.

[0070] Based on deep learning technology, this embodiment introduces historical local meteorological data and forecast information from surrounding meteorological stations as temporal and spatial features. It designs and implements an ALSTM local microclimate prediction model that combines LSTM and Attention mechanism, which can improve the accuracy of prediction and achieve representative experimental results on three meteorological elements: temperature, wind speed, and air pressure.

[0071] A climate prediction system based on an attention mechanism includes:

[0072] The data acquisition module is used to acquire meteorological data of the area to be predicted, including historical local meteorological data of the area to be predicted and forecast information from surrounding meteorological stations.

[0073] The climate prediction module is used to input the meteorological data into the climate prediction model for prediction and classification to obtain climate prediction data. The climate prediction model includes a feature extraction module, a residual connection module, a normalization module, and a prediction module connected in sequence. The feature extraction module includes a long short-term memory network module and an attention module set in parallel.

[0074] An electronic device includes a memory and a processor, the memory storing a computer program and the processor running the computer program to enable the electronic device to perform the attention-based microclimate prediction method.

[0075] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned attention-based microclimate prediction method.

[0076] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A microclimate prediction method based on an attention mechanism, characterized in that, include: Acquire meteorological data for the area to be predicted, including historical local meteorological data for the area to be predicted and forecast information from surrounding meteorological stations; The meteorological data is input into a climate prediction model for prediction and classification to obtain climate prediction data. The climate prediction model includes a feature extraction module, a residual connection module, a normalization module, and a prediction module connected in sequence. The feature extraction module includes a long short-term memory network module and an attention module set in parallel. The processing steps of the climate prediction model specifically include: The historical local meteorological data is input into the long short-term memory network module for time feature extraction to obtain time feature data; The forecast information from the surrounding meteorological stations is input into the attention module for spatial feature extraction to obtain spatial feature data; The temporal feature data and the spatial feature data are input into the residual connection module and the normalization module for fusion to obtain fused data. Time coding is introduced into the fused data, and the fused data with time coding is input into the prediction module for prediction and classification to obtain the climate prediction data. The step of inputting the historical local meteorological data into the long short-term memory network module for time feature extraction specifically includes: The historical local meteorological data is input into the long short-term memory network module to extract the characteristics and trends of meteorological elements in the time dimension, thereby obtaining the time feature data. The long short-term memory network module includes several long short-term memory network structures connected in sequence. The step of inputting the forecast information from the surrounding meteorological stations into the attention module for spatial feature extraction specifically includes: The forecast information from the surrounding meteorological stations is input into the attention module, and the correlation between the forecast information from different meteorological stations is calculated to obtain the spatial feature data.

2. The microclimate prediction method based on an attention mechanism according to claim 1, characterized in that, The training process of the climate prediction model specifically includes: Acquire training data, which includes meteorological training data at different times; An initial climate prediction model is constructed. The training data is input into the initial climate prediction model for prediction and classification. The goal is to minimize the loss between the initial training results after classification and the meteorological training data at the next moment corresponding to the input meteorological training data. The trained climate prediction model is obtained.

3. A climate prediction system based on an attention mechanism, using the method as described in any one of claims 1-2, characterized in that, include: The data acquisition module is used to acquire meteorological data of the area to be predicted, including historical local meteorological data of the area to be predicted and forecast information from surrounding meteorological stations. The climate prediction module is used to input the meteorological data into the climate prediction model for prediction and classification to obtain climate prediction data. The climate prediction model includes a feature extraction module, a residual connection module, a normalization module, and a prediction module connected in sequence. The feature extraction module includes a long short-term memory network module and an attention module set in parallel.

4. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to enable the electronic device to perform a microclimate prediction method based on an attention mechanism according to any one of claims 1-2.

5. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements a microclimate prediction method based on an attention mechanism as described in any one of claims 1-2.