Weather forecasting method and device based on time coding autoregression and electronic equipment
By using time-coded autoregression method in meteorological forecasting, using deep learning self-attention model combined with time information for meteorological forecasting, the problem of rapid accumulation of errors in the existing technology is solved, and higher accuracy of medium and short-term meteorological forecasting is achieved.
Patent Information
- Application Number
- CN202510091099.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-30
AI Technical Summary
The problem of low accuracy of medium- and short-term meteorological forecasts caused by rapid accumulation of errors in the prior art.
The meteorological forecasting method based on time encoding autoregression is adopted. By obtaining meteorological factor data with time resolution as the target time length, using the deep learning self-attention model, the meteorological factor data is used as input, and combining the time information of multiple times as constraints, weather forecasting is performed. The method includes iteratively performing the forecasting step until we obtain the weather forecast result for each target time for each of the target days.
Through this method, the subtle characteristics of meteorological changes can be captured more accurately, the accumulation of errors can be reduced, and the accuracy and stability of medium- and short-term meteorological forecasts can be improved.
Smart Images

Figure CN120065377A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of meteorological forecasting, and particularly to a meteorological forecasting method, device and electronic device based on time-coded autoregression. Background Art
[0002] In recent years, artificial intelligence has been widely studied and applied in medium- and short-term weather forecasting, and has reached or even exceeded the existing best operational numerical model forecasting results.
[0003] In related technologies, a deep learning method is used to construct a medium- and short-term weather forecasting model to achieve the forecasting of conventional meteorological elements (such as temperature, wind speed, precipitation, air pressure, etc.) every 6 hours for the next 7 days. Aiming at the problem of rapid accumulation of errors in medium- and short-term weather forecasting, methods such as gradual fine-tuning have alleviated the rapid accumulation of forecasting errors over time to a certain extent, but the accumulated forecasting errors have not been optimally processed.
[0004] It can be seen that the meteorological forecasting method in related technologies has the technical problem of low accuracy of medium- and short-term meteorological forecasting due to the rapid accumulation of errors. Summary of the Invention
[0005] The present invention provides a meteorological forecasting method, device and electronic device based on time-coded autoregression, so as to solve the defect of low accuracy of medium- and short-term meteorological forecasting caused by rapid error accumulation in the prior art, and achieve more accurate medium- and short-term meteorological forecasting.
[0006] The present invention provides a meteorological forecasting method based on time-coded autoregression, including the following steps.
[0007] Obtain meteorological element data, where the time resolution of the meteorological element data is the target duration; based on the deep learning self-attention model of the current day, use the meteorological element data as the input and the time information corresponding to multiple time instances as the constraint conditions to perform meteorological forecasting, and obtain the meteorological forecasting results corresponding to the multiple time instances respectively in the current day, where the product of the target duration and the multiple time instances is 24 hours; for the meteorological forecasting of the target days, iteratively execute the following steps until the meteorological forecasting results of each target time instance of each day in the target days are obtained, where the model structures of each day in the target days are the same: based on the deep learning self-attention model of the next day, use the meteorological forecasting results corresponding to the multiple time instances respectively in the current day as the input and the time information corresponding to the multiple time instances as the constraint conditions to perform meteorological forecasting, and obtain the meteorological forecasting results corresponding to the multiple time instances respectively in the next day; use the meteorological forecasting results corresponding to the multiple time instances respectively in the next day as the new input; use the deep learning self-attention model of the day after the next day as the new deep learning self-attention model of the next day.
[0008] According to a meteorological forecasting method based on time-coded autoregression provided by the present invention, for the deep learning self-attention model of the current day, take each of the multiple time instances as the target time instance respectively, and iteratively execute the following steps until the meteorological forecasting results corresponding to the multiple time instances respectively in the current day are obtained: input the meteorological element data and the target time instance into the deep learning self-attention model of the current day, and obtain the meteorological forecasting result of the target time instance output by the deep learning self-attention model of the current day.
[0009] According to a meteorological forecasting method based on time-coded autoregression provided by the present invention, the meteorological element data includes: upper-air meteorological elements and surface meteorological elements; the meteorological forecasting results include upper-air meteorological element forecasting and surface meteorological element forecasting.
[0010] According to a meteorological forecasting method based on time-coded autoregression provided by the present invention, after obtaining the meteorological element data, the method further includes: based on the meteorological element data, generate meteorological element samples according to a preset input-output format; normalize the meteorological element samples to obtain the normalized meteorological element samples, where including: perform logarithmic transformation normalization on the precipitation element in the meteorological element samples; perform mean-standard deviation normalization on other elements in the meteorological element samples.
[0011] A weather forecasting method based on time-coded autoregression provided by the present invention, wherein the deep learning self-attention model includes: a patch embedding module, an encoding module, a multi-head attention mechanism module, and a fully connected layer; the patch embedding module is used to divide the upper-air meteorological elements and the surface meteorological elements into slices of a target size; and use position encoding to match each slice to obtain the position encoding of the slice; the encoding module is used to perform upper-air meteorological element feature extraction and surface meteorological element feature extraction based on the slice and the position encoding of the slice to obtain upper-air meteorological features and surface meteorological features; the multi-head attention mechanism module is used to perform feature fusion based on the multi-head attention mechanism on the upper-air meteorological features and the surface meteorological features to obtain fused features; the fully connected layer is used to restore the dimension of the fused features and output the upper-air meteorological element forecast and the surface meteorological element forecast.
[0012] A weather forecasting method based on time-coded autoregression provided by the present invention, after obtaining the meteorological element data, the method further includes: dividing the meteorological element data in chronological order to obtain a training set, a validation set, and a test set, wherein there is no time overlap between the training set, the validation set, and the test set; determining the mean and standard deviation of each meteorological element in the meteorological element data of the training set; and normalizing the validation set and the test set based on the mean and the standard deviation.
[0013] The present invention also provides a weather forecasting device based on time-coded autoregression, including the following modules: an acquisition module for acquiring meteorological element data, wherein the time resolution of the meteorological element data is a target duration; A same-day forecasting module for performing weather forecasting based on the deep learning self-attention model of the current day, using the meteorological element data as input and the time information corresponding to multiple time steps as constraint conditions to obtain the weather forecasting results corresponding to the multiple time steps in the current day, wherein the product of the target duration and the multiple time steps is 24 hours; a medium- and long-term forecasting module for performing weather forecasting for a target number of days, iteratively executing the following steps until the weather forecasting results for each target time step of each day in the target number of days are obtained, wherein the model structures of each day in the target number of days are the same: performing weather forecasting based on the deep learning self-attention model of the next day, using the weather forecasting results corresponding to the multiple time steps in the current day as input and the time information corresponding to the multiple time steps as constraint conditions to obtain the weather forecasting results corresponding to the multiple time steps in the next day; using the weather forecasting results corresponding to the multiple time steps in the next day as new input; and using the deep learning self-attention model of the day after the next day as the new deep learning self-attention model of the next day.
[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the time-coded autoregressive-based weather forecasting method as described in any one of the above.
[0015] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the time-coded autoregressive-based weather forecasting method as described in any one of the above.
[0016] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the time-coded autoregressive-based weather forecasting method as described in any one of the above.
[0017] The time-coded autoregressive-based weather forecasting method, device, and electronic device provided by the present invention can capture the subtle features of weather changes by obtaining meteorological element data with a time resolution of the target duration; using a deep learning self-attention model, taking the meteorological element data as input and combining the time information of multiple time steps as constraint conditions, it can accurately forecast the weather conditions of each time step in the current day; the deep learning self-attention model can capture the long-term dependence relationships and periodic features in the data, improving the forecasting accuracy; using the model of the next day with the forecasting result of the previous day as input to continuously forecast the weather conditions of each day in the target number of days, since the model structures of each day are the same, it helps to maintain the coherence and stability of the forecasting, reducing the errors introduced due to changes in the model structure; during the forecasting process, taking the time information corresponding to multiple time steps as constraint conditions helps the model understand the temporal continuity and improve the rationality of the forecasting result; during the iterative forecasting process, as the forecasting result of each day is updated, the model can be gradually fine-tuned to adapt to the new weather conditions; the strategy of gradual fine-tuning helps the model maintain accuracy during continuous forecasting and reduce the accumulation of errors. The final weather forecasting results of each target time step of each day in the target number of days are highly practical and readable. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art one by one. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is a schematic flowchart of the time-coded autoregressive-based weather forecasting method provided by the present invention.
[0020] Figure 2 It is a schematic structural diagram of the deep learning self-attention model provided by the present invention.
[0021] Figure 3 It is a schematic diagram of piecewise autoregression provided by the present invention.
[0022] Figure 4 It is a schematic diagram of time-coded autoregressive coding prediction provided by the present invention.
[0023] Figure 5 It is a schematic structural diagram of a weather forecasting device based on time-coded autoregression provided by the present invention.
[0024] Figure 6 It is a schematic structural diagram of an electronic device provided by the present invention. Detailed implementation manners
[0025] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] In recent years, artificial intelligence has been widely studied and applied in medium- and short-term weather forecasting, and has reached or even exceeded the existing best operational numerical model forecasting results.
[0027] Currently, a complete dataset is mainly established based on the ERA5 reanalysis data of the European Centre for Medium-Range Weather Forecasts, and then deep learning methods (such as Transformer, graph neural network, etc.) are used to construct a medium- and short-term weather forecasting model to achieve the forecasting of conventional meteorological elements (such as temperature, wind speed, precipitation, air pressure, etc.) every 6 hours for the next 7 days. To address the problem of rapid error accumulation in medium- and short-term weather forecasting, the Pangu-Weather meteorological large model is based on the 3D Swin-Transformer model and combines time stacking technology, that is, models for 4 different forecasting times (the 1st, 6th, 12th, and 24th hours) are trained with single-moment input, and then iterative forecasting at any time is achieved by combining models with different forecasting times.
[0028] In the related art, the Graph Neural Network GraphCast was proposed. By training a prediction model for a single moment, that is, using a single time step as the input to predict the next time step, and then using a step-by-step fine-tuning of 2-12 steps to achieve a 10-day weather forecast; the FuXi meteorological large model is based on the swin-transformer model. On the basis of the GraphCast model strategy, a single-time-step prediction model is also trained, and then multi-step fine-tuning is used, and the problem of rapid accumulation of prediction errors is alleviated by means of piecewise autoregression, that is, one model is trained for 0-5 days and another model is trained for 5-10 days. The prediction results for 0-5 days are used as the input of the model for 5-10 days to drive the model prediction.
[0029] Although the existing technologies have alleviated the rapid accumulation of prediction errors over time to a certain extent by using methods such as time stacking (Pangu-Weather), piecewise autoregression (FuXi), and step-by-step fine-tuning (GraphCast), they still do not optimally handle the accumulated prediction errors. The time stacking technology adopted by Pangu-Weather reduces the number of iteration steps by training single-time-step models for different prediction time horizons, but the prediction does not consider long-term information and there are obvious discontinuity problems; the step-by-step fine-tuning of the single-time-step model adopted by GraphCast reduces the error accumulation of direct autoregressive training, but for long-term prediction, it is difficult for the model trained based on short-term training to characterize the growth characteristics of medium- and long-term prediction errors; the piecewise autoregressive step-by-step fine-tuning adopted by FuXi considers the error growth characteristics of different short, medium, and long prediction time periods respectively, but still does not optimally handle the accumulated prediction errors.
[0030] The present invention aims to comprehensively integrate the autoregressive prediction strategies of current large meteorological prediction models, and propose a more optimized general strategy for medium- and short-term weather prediction based on time-coded autoregression in deep learning to alleviate the problem of rapid accumulation of errors caused by long-term prediction of large meteorological models for medium- and short-term weather prediction.
[0031] It should be noted that time-coded autoregression involves the combined application of time series analysis and autoregressive models.
[0032] Among them, time series analysis is a statistical method used to explore the regularity and trend in time series data; time series data is a set of data points arranged in chronological order, and there is usually a certain correlation between these data points.
[0033] The autoregressive model (AutoRegressive Model, AR) is a common method in time series analysis. It assumes that the value of a given time variable is linearly related to its past values, which makes them available for modeling and predicting time-related data. The core of the autoregressive model is to use past values to predict future values.
[0034] Optionally, the time-coded autoregressive-based weather forecasting method according to the embodiments of the present application can be executed by a server, or by a terminal device, or jointly by a server and a terminal device. Taking the execution of the time-coded autoregressive-based weather forecasting method in this embodiment by a server as an example.
[0035] Figure 1 It is a schematic flowchart of the time-coded autoregressive-based weather forecasting method provided by the present invention, as Figure 1 shown, the method includes the following: Step 101, obtain meteorological element data, where the time resolution of the meteorological element data is the target duration.
[0036] In the embodiments of the present invention, meteorological element data for multiple years in the target area is obtained, including upper-air meteorological elements and surface meteorological elements. The upper-air meteorological elements are geopotential height, relative humidity, temperature, U and V wind components at 200, 300, 400, 500, 600, 700, 850, 925 and 1000 hPa, while the surface meteorological elements are 2m temperature, U and V wind components at 10m, precipitation and sea-level pressure.
[0037] The time resolution of the above meteorological elements is 6 hours, and the spatial resolution is 0.25 degrees. Finally, check the integrity and consistency of the data.
[0038] Step 102, based on the deep learning self-attention model of the current day, use the meteorological element data as input and the time information corresponding to multiple time steps as constraint conditions for weather forecasting, and obtain the weather forecasting results corresponding to multiple time steps in the current day.
[0039] Among them, the product of the target duration and multiple time steps is 24 hours; In the embodiments of the present invention, the time information corresponding to multiple time steps is preset. For example, multiple time steps can be the next 6 hours, the next 12 hours, the next 18 hours, and the next 24 hours, and a unique timestamp or time code is assigned to each time step.
[0040] Perform standardization or normalization processing on the meteorological element data to ensure the stability and efficiency during the model processing; convert the time information corresponding to multiple time steps into a format that the model can understand, such as encoding the time as periodic features using sine and cosine functions, or using the timestamp as an additional input feature.
[0041] The self-attention mechanism of the deep learning self-attention model (Vision Transformer) can capture long-range dependencies in the input data, which is very effective for time series forecasting. The meteorological element data and time encoding are used as input features and input into the model. The correlation between the input features is calculated through the self-attention layer, and attention weights are generated to emphasize the features that have an important impact on the forecasting results. According to the output of the self-attention layer, meteorological forecasting results corresponding to multiple time steps are generated. The output layer may include a fully connected layer, activation functions (such as softmax or sigmoid), etc.
[0042] It should be noted that the deep learning self-attention model for the current day contains 4 time steps at 6-hour intervals within a day (i.e., the above-mentioned future 6 hours, future 12 hours, future 18 hours, and future 24 hours). The time encoding autoregressive technique is adopted, that is, the meteorological element data and the current time step are used as inputs, and the time information of the 4 time steps is used as a constraint condition to respectively forecast the meteorological forecasting results of the future 4 time steps, avoiding the continuous accumulation of errors caused by autoregressive iteration.
[0043] Through the embodiments of the present invention, during the forecasting process, using the time information corresponding to multiple time steps as a constraint condition helps the model better understand the temporal continuity and improve the rationality of the forecasting results. The introduction of time information enables the model to consider the variation characteristics of meteorological elements in different time periods, thereby improving the forecasting accuracy.
[0044] Step 103, for the meteorological forecasting of the target days, iteratively execute the following steps until the meteorological forecasting results of each target time step of each day in the target days are obtained, where the model structures of each day in the target days are the same.
[0045] In the embodiments of the present invention, the meteorological forecasting results of each target time step of each day in the target days can be the weather forecast every 6 hours for the next 10 days.
[0046] Considering that the current meteorological large model is prone to rapid error accumulation when trained in an autoregressive manner. Considering the daily variation characteristics of meteorological elements and the daily variation of meteorological element forecasting errors, the present invention adopts a segmented multi-time-scale joint time encoding autoregressive strategy, that is, segmented by day. In the 10-day forecast, it is divided into 10 segments, and then within each day, there are 4 time steps at 6-hour intervals. Each day is a model, and cold start and gradual fine-tuning strategies are adopted.
[0047] Step 1031: Based on the deep learning self-attention model for the next number of days, using the meteorological forecast results corresponding to multiple time periods on the current day as inputs and the time information corresponding to multiple time periods as constraint conditions for meteorological forecasting, to obtain the meteorological forecast results corresponding to multiple time periods on the next number of days.
[0048] The conventional autoregressive training method uses the current time period as the input to forecast the next time period (the next 6 hours in the future), and then uses it as the input of the model to forecast the next time period (the next 12 hours in the future), and so on, iteratively forecasting multiple time periods in the future.
[0049] The time-coded autoregression proposed in the present invention is different from the conventional autoregressive training method. Instead, the inputs of the model on the first day are all the observations at the current time period, and then the time of different forecasting time periods is used as a constraint to achieve the forecasting of different time periods, avoiding the rapid accumulation of errors caused by iterative autoregression.
[0050] Step 1032: Use the meteorological forecast results corresponding to multiple time periods on the next number of days as new inputs; use the deep learning self-attention model for the number of days after the next day as the new deep learning self-attention model for the next number of days.
[0051] In the embodiment of the present invention, after the forecasting of the model on the first day is completed, use the forecasting result at the 24th hour of the model on the first day and the time of multiple time periods in the next 24 hours (i.e., the next 6 hours, the next 12 hours, the next 18 hours, and the next 24 hours) as inputs to perform the forecasting of the model on the second day, and so on, until the forecasting of the model on the tenth day is completed.
[0052] Reference Figure 2 , Figure 2 is the structural schematic diagram of the deep learning self-attention model (Vision Transformer model) provided by the present invention, which includes: input (including geopotential, humidity, temperature, U-wind, V-wind, and surface variables), encoder, Vision Transformer, decoder, and output (including geopotential, humidity, temperature, U-wind, V-wind, and surface variables).
[0053] Among them, the Vision Transformer includes an Embedded Patches module, a Norm module, a Multi-Head Attention module, and a Multilayer Perceptron (MLP) module.
[0054] Reference Figure 3 , Figure 3It is a schematic diagram of piecewise autoregression provided by the present invention, which includes an input, a plurality of forecasting modules, a plurality of intermediate outputs, and a final output.
[0055] Among them, the meteorological elements of the input, the plurality of intermediate outputs, and the final output are all geopotential, humidity, temperature, U-wind, V-wind, and surface variables; the forecasting module includes an encoder, a Vision Transformer (for the specific structure, refer to the above), and a decoder.
[0056] Here, each forecasting module (Block) represents a model (deep learning self-attention model). In the embodiment of the present invention, there are a total of 10 Blocks, one Block per day, and the model structures of each Block are exactly the same, but the weights are different.
[0057] Reference Figure 4 , Figure 4 is a schematic diagram of time-coded autoregressive forecasting provided by the present invention.
[0058] Init represents the initial current moment input, which is used to drive the model of the first day. With time constraints, it forecasts the meteorological elements at the 6th, 12th, 18th, and 24th hours in the future (that is, when forecasting the next 4 frames, the input is the initial condition of Init at the current moment, and the additional constraint condition is the time information corresponding to the next 4 frames). Then, the 24-hour forecast of the first-day model is used as the input of the second-day model to forecast the meteorological elements at the 6th, 12th, 18th, and 24th hours in the future of the second day, and so on, to achieve the forecast of meteorological elements in the next 10 days.
[0059] Through the above steps of the embodiments of the present invention, by obtaining meteorological element data with a time resolution of the target duration, the subtle features of meteorological changes can be captured; using a deep learning self-attention model, taking the meteorological element data as input and combining the time information of multiple time instances as constraint conditions, the meteorological conditions of each time instance in the current day can be accurately predicted; the deep learning self-attention model can capture the long-term dependence relationships and periodic features in the data, improving the prediction accuracy; using the model of the next day with the prediction result of the previous day as input to continuously predict the meteorological conditions of each day in the target number of days, since the model structures of each day are the same, it helps to maintain the coherence and stability of the prediction and reduce the errors introduced due to changes in the model structure; during the prediction process, taking the time information corresponding to multiple time instances as constraint conditions helps the model understand the temporal continuity and improve the rationality of the prediction results; during the iterative prediction process, as the prediction results of each day are updated, the model can be gradually fine-tuned to adapt to the new meteorological conditions; the strategy of gradual fine-tuning helps the model maintain accuracy during continuous prediction and reduce the accumulation of errors. The finally obtained meteorological prediction results of each target time instance of each day in the target number of days are highly practical and readable.
[0060] According to a meteorological prediction method based on time-coded autoregression provided by the present invention, based on the deep learning self-attention model of the current day, using the meteorological element data as input and the time information corresponding to multiple time instances as constraint conditions for meteorological prediction, to obtain the meteorological prediction results corresponding to multiple time instances in the current day, including: Taking each of the multiple time instances as the target time instance, iteratively execute the following steps until the meteorological prediction results corresponding to the multiple time instances in the current day are obtained: Input the meteorological element data and the target time instance into the deep learning self-attention model of the current day to obtain the meteorological prediction result of the target time instance output by the deep learning self-attention model of the current day.
[0061] In the embodiments of the present invention, the meteorological element data of the current time instance (including upper-air meteorological elements and surface meteorological elements) is used as the input of the deep learning self-attention model (Vision Transformer) of the current day to predict the upper-air meteorological elements and surface meteorological elements in the next 4 frames (i.e., the next 4 time instances).
[0062] The conventional autoregressive training method is to use the current time instance as input to predict the next time instance (the 6th hour in the future), and then use it as the input of the model to predict the next time instance (the 12th hour in the future), and so on to iteratively predict the next 4 frames. The time-coded autoregression proposed by the present invention is different from the conventional autoregressive training method.
[0063] In the embodiments of the present invention, a frame-by-frame prediction method is adopted. That is, the current observation (meteorological element data at the current time) and the time (time step) of the 6th hour in the future are used as inputs to predict the meteorological elements at different altitude levels and on the ground at the 6th hour in the future. Then, the current observation and the time of the 12th hour in the future are used as inputs to predict the meteorological elements at different altitude levels and on the ground at the 12th hour in the future, and so on until the 24-hour prediction is completed.
[0064] Here, within a day, there are 4 time steps at 6-hour intervals (i.e., 6 hours in the future, 12 hours in the future, 18 hours in the future, and 24 hours in the future). The time-coded autoregressive technique is adopted, that is, the meteorological element data and the target time step are used as inputs, and the time information of the 4 time steps is used as a constraint condition to predict the meteorological forecast results of the 4 time steps in the future respectively, avoiding the continuous accumulation of errors caused by autoregressive iteration.
[0065] Considering that the current meteorological large model is prone to rapid error accumulation when trained in an autoregressive manner. Considering the diurnal variation characteristics of meteorological elements and the diurnal variation of meteorological element prediction errors, the present invention will adopt a segmented multi-time-step joint time-coded autoregressive strategy during training. That is, it is segmented by day. In a 10-day prediction, it is divided into 10 segments. Then, within each day, there are 4 time steps at 6-hour intervals. Each day is a model, and a cold start and gradual fine-tuning strategy are adopted. Each day's model contains 4 time steps, and the time-coded autoregressive technique is adopted, that is, the current time step is used as an input, and the time information of the 4 time steps is used as a constraint condition to predict the 4 time steps in the future respectively, avoiding the continuous accumulation of errors caused by autoregressive iteration. Based on the combination of the above strategies and techniques, the problem of error accumulation caused by autoregressive prediction is fully solved.
[0066] Among them, cold start is used to indicate that for each day's model, it is trained (or initialized) from scratch, rather than relying on the parameters of the previous day's model. This cold start method helps the model adapt to the unique meteorological conditions and change characteristics of each day. Gradual fine-tuning is used to indicate that although each day's model is independently trained, in continuous multi-day predictions, the parameters of the model can be gradually fine-tuned to optimize the model performance by using the difference between the prediction results of the previous day or previous days and the real data. This gradual fine-tuning method helps the model maintain stability and accuracy in continuous predictions.
[0067] Within each segment of a day, the model not only focuses on the meteorological elements at the current time step but also considers the forecasts for multiple future time steps (such as the next 4 time steps with a 6-hour interval each). This multi-time-step joint approach helps the model learn the continuity and trend of meteorological elements over time. Different from traditional autoregressive models, within each segment (i.e., each day), the time-coded autoregressive technique is adopted. When the model forecasts the meteorological elements at a certain future time step, instead of relying on the forecast results of previous time steps (which would lead to error accumulation), it directly uses the meteorological elements at the current time step as input and combines the time information of all relevant time steps as constraints. By introducing time-coded autoregression and constraints, the problem of continuous error accumulation in the iterative process of traditional autoregressive models is avoided.
[0068] Through the embodiments of the present invention, the forecast for each time step is independent and based on the data of the current time step and the time information of all time steps, thus improving the stability and accuracy of the forecast.
[0069] According to a meteorological forecasting method based on time-coded autoregression provided by the present invention, the meteorological element data includes: upper-air meteorological elements and surface meteorological elements; the meteorological forecast results include upper-air meteorological element forecasts and surface meteorological element forecasts.
[0070] Upper-air meteorological elements generally refer to meteorological parameters at higher levels in the atmosphere, such as temperature, humidity, wind speed, wind direction, air pressure, etc. Upper-air meteorological data is usually obtained through remote sensing means such as meteorological balloons, aircraft, and satellites. The resolution of these data in the vertical direction may be low, but they provide key information about the atmospheric structure.
[0071] Surface meteorological elements refer to meteorological parameters near the Earth's surface, such as temperature, humidity, air pressure, wind speed, wind direction, precipitation, etc. Surface meteorological data is usually obtained through fixed facilities such as surface observation stations and automatic weather stations. These data have high resolutions in both time and space and can reflect the changes in surface meteorological conditions in real time.
[0072] In the embodiments of the present invention, meteorological element data for multiple years in the target area is obtained, including upper-air meteorological elements and surface meteorological elements. The upper-air meteorological elements are the geopotential height, relative humidity, temperature, U and V wind components at 200, 300, 400, 500, 600, 700, 850, 925, and 1000 hPa, while the surface meteorological elements are the 2m temperature, U and V wind components at 10m, precipitation, and sea-level air pressure.
[0073] The time resolution of the above meteorological elements is 6 hours, and the spatial resolution is 0.25 degrees. Finally, the integrity and consistency of the data are checked.
[0074] The meteorological forecast result is the change situation of meteorological elements within a future period calculated through a model based on the meteorological element data input into the model.
[0075] Through the embodiments of the present invention, by adopting a segmented multi-time-scale combined time-coded autoregressive strategy, it is possible to more effectively process upper-air meteorological element and surface meteorological element data, and generate more accurate meteorological forecast results, which helps the model maintain stability and accuracy in continuous forecasting, and at the same time improves the forecasting ability for changes in meteorological elements at different levels.
[0076] According to a meteorological forecasting method based on time-coded autoregression provided by the present invention, after obtaining the meteorological element data, the above method further includes: Based on the meteorological element data, generate meteorological element samples according to a preset input-output format; Normalize the meteorological element samples to obtain the normalized meteorological element samples, where it includes: Perform logarithmic transformation normalization on the precipitation element in the meteorological element samples; Perform mean-standard deviation normalization on other elements in the meteorological element samples.
[0077] In the embodiments of the present invention, according to the input of one frame (6 hours) and the output of 40 frames (240 hours, that is, 10 days), samples of each sub-dataset are generated; after generating the samples, the meteorological elements of each sub-dataset are normalized. Considering that precipitation is all non-negative and has no fixed maximum value, and precipitation shows an obvious long-tailed distribution.
[0078] Therefore, except for precipitation, the remaining meteorological elements are normalized by the mean-standard deviation method, and precipitation is normalized by the logarithmic transformation normalization method.
[0079] Precipitation elements (such as precipitation amounts) usually have a large value range and a highly skewed distribution, that is, most data values are small, while a few data values are very large. This distribution characteristic may make it difficult for the model to balance data of different magnitudes during training, thus affecting the forecasting performance.
[0080] Logarithmic transformation normalization is a commonly used method for processing highly skewed data. By taking the logarithm (usually the natural logarithm or the common logarithm) of the precipitation element, its distribution can be made closer to the normal distribution, and at the same time, the value range of the data is reduced. The data processed in this way is not only easier for the model to process, but also can reduce the influence of extreme values on model training to a certain extent.
[0081] For other elements in the meteorological element samples (such as temperature, humidity, wind speed, etc.), they usually have relatively stable distribution characteristics, but there may be differences in dimensions and value ranges between different elements. Such differences may make it difficult for the model to learn the relative importance between different elements during training.
[0082] Mean standard deviation normalization is a commonly used method for processing data with different dimensions and value ranges. It converts the data values of each element by subtracting its mean and dividing by the standard deviation, transforming the data into a standard normal distribution with a mean of 0 and a standard deviation of 1. After such processing, the data not only eliminates the differences in dimensions and value ranges, but also makes different elements have the same weight in the model.
[0083] Through the embodiments of the present invention, after the above normalization processing, each element in the meteorological element sample will be converted into data with the same dimension and value range, and its distribution characteristics will be more suitable for model training. The data processed in this way not only helps to improve the training efficiency and prediction accuracy of the model, but also can reduce the risk of model overfitting to a certain extent.
[0084] According to a meteorological forecasting method based on time encoding autoregression provided by the present invention, the deep learning self-attention model includes: a patch embedding module, an encoding module, a multi-head attention mechanism module, and a fully connected layer; The patch embedding module is used to slice the upper-air meteorological elements and the surface meteorological elements into slices of a target size; and use position encoding to match each slice to obtain the position encoding of the slice. The encoding module is used to extract upper-air meteorological element features and surface meteorological element features based on the slices and the position encoding of the slices, to obtain upper-air meteorological features and surface meteorological features. The multi-head attention mechanism module is used to perform feature fusion based on the upper-air meteorological features and the surface meteorological features according to the multi-head attention mechanism to obtain fused features. The fully connected layer is used to restore the dimension of the fused features and output upper-air meteorological element forecasts and surface meteorological element forecasts.
[0085] In an embodiment of the present invention, the above-normalized meteorological element samples are input into a deep learning self-attention (Vision Transformer) model. First, through a patch embedding module, the input meteorological elements at different altitude levels and surface meteorological elements are sliced into fixed-size slices. Then, position encoding is used to match each slice, and the slice and its corresponding position encoding are input into an encoding module for three-dimensional feature extraction of upper-air meteorological elements and surface meteorological elements. Further important features are extracted and feature fusion is performed through a multi-head attention mechanism module. Finally, the dimension is restored through a fully connected layer to achieve the prediction of meteorological elements at different altitude levels and surface meteorological elements with the same size as the output.
[0086] Here, the patch embedding module slices the data of upper-air meteorological elements and surface meteorological elements into slices of a target size (or called patches). These slices can be regarded as the basic processing units of the data, which helps the model better capture local features. To retain the position information of the slices in the original data, the patch embedding module assigns a position encoding to each slice. The position encoding is the key for the model to understand the spatial relationship between slices.
[0087] The encoding module is used to perform feature extraction based on the slices and their position encodings. For upper-air meteorological elements and surface meteorological elements, the module will perform feature extraction separately to obtain upper-air meteorological features and surface meteorological features. The feature extraction process may involve convolution operations, pooling operations, or other types of neural network layers to extract the feature information useful for meteorological prediction.
[0088] The multi-head attention mechanism module uses the multi-head attention mechanism to fuse the upper-air meteorological features and surface meteorological features. The multi-head attention mechanism allows the model to simultaneously focus on multiple aspects of the data, so as to more comprehensively understand the relationship between the data. By calculating the attention weights between different features, the multi-head attention mechanism module can effectively fuse the upper-air meteorological features and surface meteorological features to generate fused features. These fused features contain both the information of upper-air meteorological elements and the information of surface meteorological elements.
[0089] The fully connected layer is used to map the fused features back to the original meteorological element prediction space. Specifically, the fully connected layer restores the dimension of the fused features and outputs the prediction of upper-air meteorological elements and surface meteorological elements. Since the dimension of the fused features may be different from that of the original meteorological elements, the fully connected layer needs to perform an appropriate transformation on it to ensure that the dimension of the output result matches that of the original meteorological elements.
[0090] Through the embodiments of the present invention, the deep learning self-attention model realizes the effective processing and forecasting of upper-air meteorological elements and surface meteorological elements through the combination of a patch embedding module, an encoding module, a multi-head attention mechanism module, and a fully connected layer. Such a model structure not only helps to capture the local features of the data but also enables understanding of the complex relationships between the data, thereby improving the accuracy of meteorological forecasting.
[0091] According to a meteorological forecasting method based on time-coded autoregression provided by the present invention, after obtaining meteorological element data, the method further includes: Dividing the meteorological element data in chronological order to obtain a training set, a validation set, and a test set, where there is no time overlap among the training set, the validation set, and the test set; Determining the mean and standard deviation of each meteorological element in the meteorological element data of the training set; Normalizing the validation set and the test set based on the mean and standard deviation.
[0092] In the embodiments of the present invention, the meteorological element data is divided in chronological order. For example, the meteorological element data from 2007 to 2021 is used as the training set, the meteorological element data in 2022 is used as the validation set, and the meteorological element data in 2023 is used as the test set; ensuring that there is no time overlap among the sub-datasets.
[0093] To prevent information leakage, calculate the mean and standard deviation of each meteorological element based on the training set, and then normalize the meteorological elements in the training set, the validation set, and the test set.
[0094] In some embodiments, for each meteorological element, traverse all samples in the training set to calculate the mean and standard deviation of the element. Use the calculated mean and standard deviation to normalize each meteorological element in the training set. Use the same mean and standard deviation as the training set to normalize each meteorological element in the validation set and the test set.
[0095] Through the embodiments of the present invention, information leakage can be effectively prevented, and it is ensured that the data distributions faced by the model during the training and evaluation processes are consistent, which helps to improve the generalization ability of the model and enables it to more accurately forecast unseen data.
[0096] Through the above embodiments of the present invention, considering the impacts of short-term and long-term forecasting errors comprehensively, a combined strategy of cold start and gradual fine-tuning is proposed, which better solves the problem of error accumulation caused by autoregressive forecasting of large meteorological forecasting models; a multi-time-scale joint optimization strategy of time-coded autoregression is proposed, which solves the problem of sharp error growth in forecast adjustment after cold start and improves the short-term forecasting skills at the same time.
[0097] The following describes an example of the meteorological forecasting method based on time-coded autoregression provided by the present invention in practical applications.
[0098] In the embodiments of the present invention, the data used is the ERA5 reanalysis data in the East Asian region from 2007 to 2023, including upper-air meteorological elements and surface meteorological elements. The upper-air meteorological elements are the geopotential height, relative humidity, temperature, U and V wind components at 200, 300, 400, 500, 600, 700, 850, 925, and 1000 hPa, and the surface meteorological elements are the 2 m temperature, U and V wind components at 10 m, precipitation, and sea-level pressure. The time resolution of the above data is 6 hours, and the spatial resolution is 0.25 degrees.
[0099] Check the integrity and consistency of the data, and then divide the dataset into a training set, a validation set, and a test set in chronological order to ensure that there is no time overlap in each sub-dataset and prevent information leakage; then calculate the mean and variance of each meteorological element (except precipitation) in the training set, and normalize the meteorological elements of each sub-dataset using the mean and variance of each meteorological element in the training set. For precipitation, a logarithmic transformation normalization method is used, mainly because precipitation is all non-negative and has an obvious long-tailed distribution. Then, samples are generated according to 1 frame of input (6-hour interval) and 40 frames of output (10-day forecast).
[0100] In the embodiments of the present invention, a segmented autoregressive strategy of time-coding technology is adopted. For the 10-day meteorological element forecast, it is divided into 10 segments in units of days, that is, the model structures of each day are the same, but the model weights are different. In each model, input the meteorological elements of different height levels and the surface at the current time step, and forecast the meteorological elements of different height levels and the surface in the next 4 frames (i.e., the next 24 hours). The specific training idea is as follows: First, train the model for the first day, take the meteorological elements of different height levels and the surface at the current time step as the input of the Vision Transformer model, and forecast the meteorological elements of different height levels and the surface in the next 4 frames (24 hours). When training, a frame-by-frame forecasting method is adopted, that is, use the current observation and the time of the next 6 hours as the input to forecast the meteorological elements of different height levels and the surface at the next 6 hours, and then use the current observation and the time of the next 12 hours as the input to forecast the meteorological elements of different height levels and the surface at the next 12 hours, and so on, until the 24-hour forecast is completed. The conventional autoregressive training method is to use the current time step as the input to forecast the next time step (the next 6 hours), and then use it as the input of the model to forecast the next time step (the next 12 hours), and iterate to forecast the next 4 frames.
[0101] The time-coded autoregression proposed by the present invention is different from the conventional autoregressive training method. Instead, the input of the model on the first day is the observation at the current time step, and then the time corresponding to different forecast time steps is used as a constraint to achieve forecasts at different time steps, avoiding the rapid accumulation of errors caused by iterative autoregression. After the model training on the first day is completed, the forecast result at the 24th hour of the first-day model and the time at different time steps in the next 24 hours are used as inputs to train the model for the second day, and so on until the model training for the tenth day is completed. During the training process, the MSE loss function is used to optimize the parameters of the model, and multiple experiments are carried out by adjusting the learning rate and other methods to optimize the parameters of the meteorological large model until the model reaches the optimal effect.
[0102] After the model training reaches the optimal state, the given samples are normalized using the calculated mean and standard deviation parameters, and then used as the input of the model to forecast the meteorological elements at different altitude levels and the ground every 6 hours for the next 10 days. After the forecasting is completed, the above mean and standard deviation parameters are used to denormalize the forecast results, so as to obtain the final meteorological element forecasts at different altitude levels and the ground.
[0103] Through the embodiments of the present invention, it is possible to fully consider the forecast error growth characteristics of the meteorological forecast large model, propose a multi-time-scale joint optimization strategy of time-coded autoregression, significantly overcome the problem of rapid accumulation and growth of errors in short- and medium-term forecasts, and compared with the current autoregressive forecast strategy of the meteorological forecast large model, the autoregressive forecast strategy of the present invention has significantly better short- and medium-term forecast skills.
[0104] The following describes the meteorological forecast device based on time-coded autoregression provided by the present invention. The meteorological forecast device based on time-coded autoregression described below can be mutually referred to the meteorological forecast method based on time-coded autoregression described above.
[0105] Refer to Figure 5 , Figure 5 which is a schematic structural diagram of the meteorological forecast device based on time-coded autoregression provided by the present invention.
[0106] An acquisition module 501, configured to acquire meteorological element data, wherein the time resolution of the meteorological element data is the target time length; A same-day forecast module 502, configured to perform meteorological forecasting based on the deep learning self-attention model of the current day, using the meteorological element data as the input and the time information corresponding to multiple time steps as the constraint conditions, to obtain the meteorological forecast results corresponding to multiple time steps respectively in the current day, wherein the product of the target time length and the multiple time steps is 24 hours; The medium- and long-term forecasting module 503 is used for weather forecasting for the target number of days. The following steps are iteratively executed until the weather forecasting results for each target time slot of each day in the target number of days are obtained. Among them, the model structures of each day in the target number of days are the same: Based on the deep learning self-attention model of the next day, using the weather forecasting results corresponding to multiple time slots in the current day as inputs and the time information corresponding to multiple time slots as constraint conditions for weather forecasting, to obtain the weather forecasting results corresponding to multiple time slots in the next day; Taking the weather forecasting results corresponding to multiple time slots in the next day as new inputs; taking the deep learning self-attention model of the day after as the new deep learning self-attention model of the next day.
[0107] Specifically, the above-mentioned weather forecasting device based on time-coded autoregression provided by the present invention can implement all the method steps implemented by the above-mentioned weather forecasting method embodiment based on time-coded autoregression, and can achieve the same technical effects. The same parts and beneficial effects as those in the method embodiment in this embodiment will not be specifically described here.
[0108] Figure 6 is a schematic physical structure diagram of the electronic device provided by the present invention, as Figure 6As shown in the figure, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communication bus 640. Among them, the processor 610, the communications interface 620, and the memory 630 complete communication with each other through the communication bus 640. The processor 610 may call logical instructions in the memory 630 to execute a weather forecasting method based on time-coded autoregression. The method includes: obtaining meteorological element data, where the time resolution of the meteorological element data is the target duration; based on a deep learning self-attention model of the current day, using the meteorological element data as input and the time information corresponding to multiple time instances as constraint conditions to perform weather forecasting, and obtaining weather forecasting results corresponding to multiple time instances respectively in the current day. Among them, the product of the target duration and multiple time instances is 24 hours; for the weather forecasting of the target days, the following steps are iteratively executed until the weather forecasting results of each target time instance of each day in the target days are obtained. Among them, the model structures of each day in the target days are the same: based on a deep learning self-attention model of the next day, using the weather forecasting results corresponding to multiple time instances respectively in the current day as input and the time information corresponding to multiple time instances as constraint conditions to perform weather forecasting, and obtaining weather forecasting results corresponding to multiple time instances respectively in the next day; using the weather forecasting results corresponding to multiple time instances respectively in the next day as new input; using the deep learning self-attention model of the day after as the new deep learning self-attention model of the next day.
[0109] In addition, when the logical instructions in the above-mentioned memory 630 can be implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0110] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the weather forecasting method based on time-coded autoregression provided by the above-mentioned various methods. The method includes: obtaining meteorological element data, wherein the time resolution of the meteorological element data is the target duration; based on the deep learning self-attention model of the current day, using the meteorological element data as input and the time information corresponding to multiple time instances as constraint conditions for weather forecasting, to obtain the weather forecasting results corresponding to multiple time instances in the current day respectively, wherein the product of the target duration and multiple time instances is 24 hours; for the weather forecasting of the target days, iteratively execute the following steps until the weather forecasting results of each target time instance of each day in the target days are obtained, wherein the model structures of each day in the target days are the same: based on the deep learning self-attention model of the next day, using the weather forecasting results corresponding to multiple time instances in the current day as input and the time information corresponding to multiple time instances as constraint conditions for weather forecasting, to obtain the weather forecasting results corresponding to multiple time instances in the next day respectively; using the weather forecasting results corresponding to multiple time instances in the next day as new input; using the deep learning self-attention model of the day after as the new deep learning self-attention model of the next day.
[0111] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the weather forecasting method based on time-coded autoregression provided by the above-mentioned various methods. The method includes: obtaining meteorological element data, wherein the time resolution of the meteorological element data is the target duration; based on the deep learning self-attention model of the current day, using the meteorological element data as input and the time information corresponding to multiple time instances as constraint conditions for weather forecasting, to obtain the weather forecasting results corresponding to multiple time instances in the current day respectively, wherein the product of the target duration and multiple time instances is 24 hours; for the weather forecasting of the target days, iteratively execute the following steps until the weather forecasting results of each target time instance of each day in the target days are obtained, wherein the model structures of each day in the target days are the same: based on the deep learning self-attention model of the next day, using the weather forecasting results corresponding to multiple time instances in the current day as input and the time information corresponding to multiple time instances as constraint conditions for weather forecasting, to obtain the weather forecasting results corresponding to multiple time instances in the next day respectively; using the weather forecasting results corresponding to multiple time instances in the next day as new input; using the deep learning self-attention model of the day after as the new deep learning self-attention model of the next day.
[0112] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0113] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A weather forecasting method based on time-coded autoregression, characterized in that: include: Acquire meteorological element data, wherein the time resolution of the meteorological element data is a target duration; Based on the deep learning self-attention model of the current day, the meteorological element data is used as input, and the time information corresponding to multiple time periods is used as a constraint condition to perform a meteorological forecast, and obtain meteorological forecast results corresponding to the multiple time periods in the current day, wherein the product of the target time length and the multiple time periods is 24 hours; For the weather forecast of the target days, the following steps are iteratively performed until the weather forecast result for each target time of each of the target days is obtained, wherein the model structure of each of the target days is the same: Based on the deep learning self-attention model of the next day, the weather forecast results corresponding to the multiple time periods in the current day are used as input, and the time information corresponding to the multiple time periods is used as a constraint condition to perform weather forecast, so as to obtain the weather forecast results corresponding to the multiple time periods in the next day; The weather forecast results corresponding to the multiple time periods in the next day are used as new input; the deep learning self-attention model of the next day is used as the new deep learning self-attention model of the next day.
2. The weather forecasting method based on time-coded autoregression according to claim 1, characterized in that: The deep learning self-attention model based on the current day takes the meteorological element data as input and the time information corresponding to the multiple time periods as a constraint condition to perform weather forecasting, and obtains the weather forecast results corresponding to the multiple time periods in the current day, including: Each of the multiple times is used as a target time, and the following steps are iteratively performed until the weather forecast results corresponding to the multiple times in the current day are obtained: The meteorological element data and the target time are input into the deep learning self-attention model of the current day to obtain the meteorological forecast result of the target time output by the deep learning self-attention model of the current day.
3. The weather forecasting method based on time-coded autoregression according to claim 1, characterized in that: The meteorological element data include: high-altitude meteorological elements and ground meteorological elements; the meteorological forecast results include high-altitude meteorological element forecasts and ground meteorological element forecasts.
4. The weather forecasting method based on time-coded autoregression according to claim 3, characterized in that: After obtaining the meteorological element data, the method further includes: Generate meteorological element samples based on the meteorological element data according to a preset input and output format; Normalizing the meteorological element samples to obtain normalized meteorological element samples, including: Performing logarithmic transformation and normalization on the precipitation elements in the meteorological element samples; The mean and standard deviation of other elements in the meteorological element sample are normalized.
5. The weather forecasting method based on time-coded autoregression according to claim 3, characterized in that: The deep learning self-attention model includes: a patch embedding module, an encoding module, a multi-head attention mechanism module and a fully connected layer; The patch embedding module is used to divide the high-altitude meteorological elements and the ground meteorological elements into slices of target size; and use position coding to match each slice to obtain the position coding of the slice; The encoding module is used to extract the features of high-altitude meteorological elements and the features of ground meteorological elements based on the slices and the position codes of the slices, so as to obtain high-altitude meteorological features and ground meteorological features; The multi-head attention mechanism module is used to perform feature fusion based on the high-altitude meteorological features and the ground meteorological features according to the multi-head attention mechanism to obtain fused features; The fully connected layer is used to restore the dimension of the fused features and output the high-altitude meteorological element forecast and the ground meteorological element forecast.
6. The weather forecasting method based on time-coded autoregression according to claim 1, characterized in that: After obtaining the meteorological element data, the method further includes: Dividing the meteorological element data in chronological order to obtain a training set, a validation set, and a test set, wherein the training set, the validation set, and the test set do not overlap in time; Determine the mean and standard deviation of each meteorological element of the meteorological element data of the training set; The validation set and the test set are normalized based on the mean and the standard deviation.
7. A weather forecasting device based on time-coded autoregression, characterized in that: include: An acquisition module, used for acquiring meteorological element data, wherein the time resolution of the meteorological element data is a target duration; The current day forecast module is used to perform weather forecast based on the deep learning self-attention model of the current day, taking the meteorological element data as input and the time information corresponding to multiple time periods as constraints, and obtain the weather forecast results corresponding to the multiple time periods in the current day, wherein the product of the target time period and the multiple time periods is 24 hours; The medium- and long-term forecast module is used to iteratively perform the following steps for the weather forecast of the target days until the weather forecast result of each target time of each day in the target days is obtained, wherein the model structure of each day in the target days is the same: Based on the deep learning self-attention model of the next day, the weather forecast results corresponding to the multiple time periods in the current day are used as input, and the time information corresponding to the multiple time periods is used as a constraint condition to perform weather forecast, so as to obtain the weather forecast results corresponding to the multiple time periods in the next day; The weather forecast results corresponding to the multiple time periods in the next day are used as new input; the deep learning self-attention model of the next day is used as the new deep learning self-attention model of the next day.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the weather forecasting method based on time-coded autoregression as claimed in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the weather forecasting method based on time-coded autoregression as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the weather forecasting method based on time-coded autoregression as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Daily precipitation prediction method based on Transform attention mechanism
CN114239971A
Multi-temporal-spatial-scale new energy power generation power prediction method based on large model
CN117293809A
Cited By
Intelligent thunderstorm weather forecasting method and system and medium
CN120993524A
Visibility prediction method
CN121071410A
A visibility prediction method
CN121071410B