Method and device for predicting weather and electronic equipment

The meteorological forecasting model using the Swin-Transformer and hybrid attention mechanism addresses the shortcomings of traditional models in handling small-scale weather evolution and large-scale circulation, achieving greater accuracy and dynamic adaptability in highway micro-meteorological forecasting and improving the ability to issue early warnings for severe weather.

CN122018043APending Publication Date: 2026-05-12ZHEJIANG COMM INVESTMENT GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG COMM INVESTMENT GRP CO LTD
Filing Date
2025-11-12
Publication Date
2026-05-12

Smart Images

  • Figure CN122018043A_ABST
    Figure CN122018043A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a weather prediction method and device and electronic equipment. The method comprises the steps that static features, dynamic features, time features and spatial features related to multi-source meteorological data are generated based on the multi-source meteorological data, the multi-source meteorological data comprise a plurality of pixels, the pixels have corresponding meteorological static data and meteorological dynamic data, the meteorological dynamic data comprise meteorological observation data of one or more historical time points, and the meteorological observation data comprise meteorological observation data of one or more historical time points; the meteorological observation data comprises surface observation data and vertical observation data, and the vertical observation data comprises barometric layer observation data corresponding to one or more barometric layers. The method further comprises the step of generating a weather prediction result of a future preset time through a weather prediction model based on the static features, the dynamic features, the time features and the spatial features, and the weather prediction model comprises a model obtained by training an initial neural network model based on a Swin-Transform mechanism and a mixed attention mechanism by using a training set. The method can improve the precision and adaptability of meteorological prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments disclosed herein generally relate to the field of weather forecasting technology, and specifically to a method, apparatus, and electronic device for forecasting weather in a highway scenario. Background Technology

[0002] By using artificial intelligence technologies, especially machine learning algorithms, it is possible to analyze collected historical and real-time data to identify patterns and predict future weather conditions.

[0003] Artificial intelligence-based micro-weather forecasting for highways can improve highway safety under adverse weather conditions, reduce traffic accidents, optimize traffic flow, and provide timely decision support for drivers and traffic management departments. To achieve accurate micro-weather forecasting, artificial intelligence technology must be able to capture the complex correlation between small-scale weather evolution and large-scale circulation patterns in weather prediction. Summary of the Invention

[0004] Embodiments of this disclosure provide a method, apparatus, and electronic device for forecasting weather, designed to address one or more of the problems described above and other potential problems.

[0005] According to a first aspect of this disclosure, a method for weather forecasting is provided. This method includes generating static features, dynamic features, temporal features, and spatial features related to multi-source meteorological data. The multi-source meteorological data includes multiple pixels, each pixel having corresponding static and dynamic meteorological data. The dynamic meteorological data includes meteorological observation data from one or more historical time points. The meteorological observation data includes surface observation data and vertical observation data, and the vertical observation data includes barometric strata observation data corresponding to one or more barometric strata. Furthermore, the method also includes generating a future weather forecast result for a predetermined time based on the static, dynamic, temporal, and spatial features using a weather forecasting model. The weather forecasting model includes a model obtained by training an initial neural network model based on a Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

[0006] According to a second aspect of this disclosure, an apparatus for weather forecasting is provided. The apparatus includes a feature generation module configured to generate static features, dynamic features, temporal features, and spatial features related to multi-source meteorological data. The multi-source meteorological data includes multiple pixels, each pixel having corresponding static and dynamic meteorological data. The dynamic meteorological data includes meteorological observation data from one or more historical time points, and the observation data includes surface observation data and vertical observation data. The vertical observation data includes barometric strata observation data corresponding to one or more barometric strata. The apparatus also includes a result generation module configured to generate a future weather forecast result for a predetermined time based on the static, dynamic, temporal, and spatial features, using a trained weather forecast model. The weather forecast model includes a model obtained by training an initial neural network model based on a Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

[0007] According to a third aspect of this disclosure, an electronic device is provided. The electronic device includes one or more processors. Furthermore, the electronic device includes a memory associated with the one or more processors, the memory for storing program instructions that, when read and executed by the one or more processors, perform the steps of the method according to the first aspect. Attached Figure Description

[0008] The above and other objects, features, and advantages of embodiments of the present disclosure will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated in the drawings by way of example and not limitation.

[0009] Figure 1 The diagram illustrates an example environment in which embodiments of the present disclosure may be implemented.

[0010] Figure 2 A flowchart illustrating a method for forecasting weather according to an embodiment of the present disclosure is shown.

[0011] Figure 3A This diagram illustrates the processing of a portion of the first training samples during the first training process of the initial neural network model according to an embodiment of the present disclosure.

[0012] Figure 3B This diagram illustrates the processing of another portion of the first training samples during the first training process of the initial neural network model according to an embodiment of the present disclosure.

[0013] Figure 4 A schematic block diagram of an example apparatus according to an embodiment of the present disclosure is shown.

[0014] Figure 5 A block diagram of an example device according to an embodiment of the present disclosure is shown.

[0015] In the various figures, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0016] Preferred embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.

[0017] The term "comprising" and its variations as used herein signify an open-ended inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". Terms such as "upper", "lower", "front", and "rear", indicating placement or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings and are used only for the purpose of describing the principles of this disclosure, and are not intended to indicate or imply that the elements referred to must have a specific orientation, be constructed or operated in a specific orientation, and therefore should not be construed as limiting this disclosure.

[0018] As mentioned earlier, to achieve accurate micro-meteorological forecasting, artificial intelligence technology is required to capture the complex relationship between small-scale weather evolution and large-scale circulation in meteorological forecasting. Small-scale weather evolution refers to local, short-term weather changes, such as sudden dense fog, localized heavy rainfall, or road icing on a highway section. These phenomena are influenced by local factors such as topography, surface temperature, and humidity, and their rate of change and spatial scope are small (kilometer-scale or even smaller). Large-scale circulation refers to the dynamic changes of weather systems (such as high pressure, low pressure, fronts, and monsoons), such as a southward movement of cold air covering hundreds of kilometers or a typhoon system. These systems are the "background driving factors" of small-scale weather phenomena, determining the potential weather conditions. However, small-scale weather requires high-resolution local observation data, while large-scale circulation relies on large-scale meteorological field data. Therefore, traditional models struggle to simultaneously process these two types of data with vastly different spatiotemporal resolutions, limiting the accuracy of micro-meteorological forecasts for highway sections and resulting in insufficient dynamic adaptability. For example, neglecting the influence of large-scale wind fields on local humidity makes it impossible to provide early warnings of sudden dense fog on a highway section.

[0019] To address this, according to embodiments of this disclosure, a method for weather forecasting is provided. This method can capture the complex correlation between small-scale weather evolution and large-scale circulation using a weather forecasting model based on the Swin-Transformer mechanism and a hybrid attention mechanism, thereby improving the accuracy and dynamic adaptability of weather forecasting. The method includes generating static features, dynamic features, temporal features, and spatial features related to multi-source meteorological data. The multi-source meteorological data includes multiple pixels, each pixel having corresponding static and dynamic meteorological data. The dynamic meteorological data includes meteorological observation data from one or more historical time points, and the observation data includes surface observation data and vertical observation data. The vertical observation data includes barometric strata observation data corresponding to one or more barometric strata. Furthermore, the method also includes generating a future weather forecast result for a predetermined time based on the static, dynamic, temporal, and spatial features using a weather forecasting model. The weather forecasting model includes a model obtained by training an initial neural network model based on the Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

[0020] Figure 1 A schematic diagram is shown illustrating an example environment 100 that can be implemented according to embodiments of the present disclosure. Figure 1As shown, in one or more embodiments of this disclosure, the computing unit 101 in the example environment 100 may include, but is not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multiprocessor systems, consumer electronics, minicomputers, mainframe computers, edge computing devices, and distributed computing systems including any of the above systems or devices. The computing unit 101 can acquire multi-source meteorological data 102 via wired or wireless means and generate meteorological forecasts for a future preset time based on the multi-source meteorological data. In one or more embodiments of this disclosure, the multi-source meteorological data 102 may include, but is not limited to, satellite data, radar data, and data from national and local meteorological bureaus, as well as data from meteorological monitoring equipment deployed along highways (e.g., visibility meters, road surface sensors, small weather stations, and video surveillance systems, etc.). In one or more embodiments of this disclosure, the Earth's surface can be divided into multiple pixels, and the multi-source meteorological data may include static meteorological data and dynamic meteorological data corresponding to each pixel. The static meteorological data may include, but is not limited to, data on one or more of the following parameters of each pixel: altitude, land area, glacier area, etc., which remain almost unchanged over time. Meteorological dynamic data may include, but is not limited to, meteorological observation data of one or more of the following, such as temperature, precipitation, wind speed, and humidity, which change dynamically over time for each pixel. In one or more embodiments of this disclosure, the meteorological dynamic data may include meteorological observation data from one or more historical time points, thereby providing information related to the changing trends of the meteorological dynamic data. Part of the meteorological observation data consists of surface observation data including only one observation value, such as surface temperature and precipitation. Part of the meteorological observation data consists of vertical observation data including multiple observation values ​​at different atmospheric pressure altitudes, such as wind speed and air pressure at different pressure layers. In one or more embodiments of this disclosure, the computing unit may predict the meteorological dynamic data for each hour after historical time point t as a meteorological prediction result 105 based on multi-source meteorological data including meteorological dynamic data from historical time point t and one or more time points before historical time point t. Figure 1As shown, the computing unit 101 can predict hourly meteorological data from 4 PM to 3 PM the following day based on multi-source meteorological data 102, including dynamic meteorological data at 3 PM and 12 PM of the current day, using a meteorological prediction model 104. In one or more embodiments of this disclosure, the meteorological prediction model can be deployed outside the computing unit 101 (e.g., in the cloud or on a standalone server). The computing unit can call the meteorological prediction model service deployed on a remote server via network requests (e.g., HTTP / HTTPS). The computing unit can also push multi-source meteorological data to a message queue (e.g., a Kafka queue). The meteorological prediction results output by the cloud-based meteorological prediction model service, which subscribes to the queue and performs inference, are written to the computing unit for subsequent use via callbacks or a database. In one or more embodiments of this disclosure, the meteorological prediction model can also be deployed inside the computing unit (e.g., on an edge device or a local server), allowing the computing unit to perform inference and generate meteorological prediction results without relying on an external network.

[0021] The following is combined Figure 2 A method flow for forecasting weather according to embodiments of the present disclosure is described. Figure 2 A flowchart of a method 200 for weather forecasting according to an embodiment of the present disclosure is shown. In some embodiments, in Figure 1 In the example environment 100 shown, method 200 can be executed by computing unit 101. It should be understood that method 200 may also include additional actions not shown and / or actions shown may be omitted; the scope of this disclosure is not limited in this respect. Method 200 can be executed at any suitable computing device or by any suitable number of computing devices cooperating with each other. Figure 2 As shown in box 202, based on multi-source meteorological data, static features, dynamic features, temporal features, and spatial features related to the multi-source meteorological data are generated. The multi-source meteorological data includes multiple pixels, each with corresponding meteorological static data and meteorological dynamic data. The meteorological dynamic data includes meteorological observation data at one or more historical time points. The meteorological observation data includes surface observation data and vertical observation data. The vertical observation data includes barometric strata observation data corresponding to one or more barometric strata.

[0022] At box 204, based on static features, dynamic features, temporal features, and spatial features, a meteorological prediction model is used to generate a meteorological prediction result for a future preset time. The meteorological prediction model includes a model obtained by training an initial neural network model based on the Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

[0023] In this way, multi-source meteorological data can provide global meteorological information for meteorological prediction models. Meteorological prediction models based on the Swin-Transformer mechanism and the hybrid attention mechanism can simultaneously process local small-scale weather evolution patterns, thereby enabling the meteorological prediction results generated by the meteorological prediction models to take into account both small-scale weather evolution patterns and large-scale weather circulation influences, thus improving the accuracy and adaptability of predictions.

[0024] In one or more embodiments of this disclosure, the meteorological dynamic data may include observational data (15 surface observations and 5 vertical observations) of 20 atmospheric variables from GFS (Global Forecast System) reanalysis data, with a time step of 2, a temporal resolution of 3 hours, a spatial resolution of 0.25° × 0.25°, and 15 pressure layers, constituting a meteorological dynamic data tensor of 180 × 720 × 1440. The temporal resolution of 3 hours indicates that the time interval of the meteorological dynamic data is 3 hours. For example, the meteorological dynamic data may include observational data of atmospheric variables such as temperature, precipitation, wind speed, humidity, and cloud cover at 00:00 and 03:00. The multi-source meteorological data with a spatial resolution of 0.25° × 0.25° may include 720 × 1140 pixels, each pixel covering an area of ​​0.25° longitude and latitude (approximately 28 km × 28 km, near the equator). The 15 pressure layers refer to the vertical division of atmospheric space into 15 different pressure layers based on atmospheric pressure. The same vertical observation data can have independent observation values ​​at different pressure layers (altitudes). In one or more embodiments of this disclosure, the meteorological static data may include static parameters such as the altitude, land area, and glacier area of ​​the region corresponding to each pixel. These parameter values ​​hardly change over time in the short term.

[0025] In one or more embodiments of this disclosure, a 180×720×1440 meteorological dynamic data tensor can be processed using convolutional layers to generate a token sequence that the model can process, serving as the dynamic features of the multi-source meteorological data. In one or more embodiments of this disclosure, meteorological static parameters can also be processed using convolutional layers to generate a token sequence that the model can process, serving as the static features of the multi-source meteorological data. In one or more embodiments of this disclosure, pixels and historical time points in the multi-source meteorological data can be encoded using sine or cosine encoding based on the periodic features of time and Earth's latitude and longitude, respectively, to generate spatial and temporal features of the multi-source meteorological data. The dynamic, static, temporal, and spatial features of the multi-source meteorological data are concatenated and input into a meteorological prediction model for inference to predict meteorological dynamic data for the next 24 hours.

[0026] In one or more embodiments of this disclosure, meteorological dynamic data can be represented in a standardized form. For example, the prediction results of meteorological dynamic data for a preset future time in meteorological forecast results can be represented in the form of climate bias. By replacing the forecast target of the meteorological forecast model from time trend to climatological bias in this way, overfitting of short-term fluctuations can be reduced. In one or more embodiments of this disclosure, the meteorological dynamic data of multi-source meteorological data can also be parameter-standardized first to generate meteorological dynamic standardized data of multi-source meteorological data. Subsequently, the meteorological dynamic standardized data is radially processed through a convolutional layer to obtain the dynamic characteristics of the multi-source meteorological data. In one or more embodiments of this disclosure, the multi-source meteorological data can be parameter-standardized by calculating the climatological mean C and standard deviation in the spatial-temporal dimension. The climatological mean C refers to the long-term statistical average of the observed values ​​of each climate element (e.g., surface temperature, precipitation, etc.) in the meteorological dynamic data. For example, the standard climate average of each climate element calculated using 1981-2010 or 1991-2020 as the baseline period. The standard deviation can quantify the dispersion of climate elements and reflect the range of data fluctuation around the mean. Furthermore, meteorological dynamic data can be transformed into a standard global distribution according to Formula 1-1 to eliminate the influence of dimensions:

[0027] Where X represents meteorological dynamic data, and represents meteorological dynamic standardized data.

[0028] In this way, meteorological dynamic data can be transformed into a distribution with a mean of 0 and a standard deviation of 1, eliminating the dimensional differences between different climate pixels (such as different units for temperature and wind speed), making it easier for meteorological prediction models to capture and identify outliers of extreme weather events, thereby improving prediction accuracy.

[0029] In one or more embodiments of this disclosure, the weather forecasting model can be trained based on an initial neural network model including an encoder, a decoder, and a task adapter head, wherein the encoder-decoder architecture can perform a hybrid attention mechanism based on Transformer. In one or more embodiments of this disclosure, the encoder can include 20 Transformer modules that alternately perform local and global attention mechanisms. In one or more embodiments of this disclosure, the decoder can include 5 Transformer modules that alternately perform local and global attention mechanisms, and a Swing shift operation can be introduced into the decoder to reduce redundant computation.

[0030] The task adapter head can process specific target tasks and generate target task prediction results based on the weather forecast results obtained from encoder-decoder inference. In one or more embodiments of this disclosure, the target task can be higher-resolution weather forecast data. Accordingly, the task adapter head may include a downscaling head component for reconstructing low-resolution data into high-resolution output. For example, reconstructing GFS data with a spatial resolution of 0.25°×0.25° to a spatial resolution of 0.1°×0.1° enhances spatial details. In one or more embodiments of this disclosure, the downscaling head may include an upsampling layer, residual connections, and final sampling. The upsampling layer may include four convolutional blocks, each with an progressively increasing number of feature channels, capable of extracting low-frequency components such as the overall trend of atmospheric circulation. The residual connections can combine shallow and deep features, preserving low-frequency information. The final upsampling can refine the high-frequency structure through three upsampling layers.

[0031] In one or more embodiments of this disclosure, the target task may be to predict one or more of the following parameters: road surface temperature, visibility, probability of water accumulation, and probability of icing. Accordingly, the task adapter head may also include a parameterized head capable of jointly analyzing one or more meteorological forecasts such as humidity, precipitation, and surface temperature to predict road surface temperature, visibility, probability of water accumulation, and probability of icing. In one or more embodiments of this disclosure, the parameterized head may employ a U-Net architecture. The first four convolutional blocks in the U-Net architecture are used to extract relevant features from the meteorological forecast results output by the encoder-decoder architecture. The four convolutional blocks in the U-Net architecture generate prediction results for parameters such as road surface temperature, visibility, probability of water accumulation, and probability of icing based on the features extracted by the first four convolutional blocks.

[0032] In one or more embodiments of this disclosure, training the initial neural network model may include a first training process that determines the model parameters of the encoder and decoder based on a training set, and a second training process that determines the model parameters of the multi-task adapter head based on the training set. The weather forecast results include a global weather forecast generated by the encoder of the trained weather forecast model and a target task forecast generated by the task adapter head of the trained weather forecast model. In this way, the second training process does not involve adjusting the model parameters of the encoder-decoder backbone network of the first training process, but only adjusts the model parameters of the task adapter head, which can reduce the deployment cost of edge devices.

[0033] In one or more embodiments of this disclosure, the training set for the initial neural network model may include multiple first training samples. Each first training sample includes historical multi-source meteorological data and the corresponding historical sample true climate deviation. The data structure of the historical multi-source meteorological data is the same as that of the multi-source meteorological data input during meteorological prediction model inference, and will not be elaborated further here. The historical sample true climate deviation may be the true climate deviation of the hourly meteorological dynamic data corresponding to the historical multi-source meteorological data for each of the next 24 hours.

[0034] In one or more embodiments of this disclosure, the first training samples in the training set can be divided into two parts. Figure 3A and Figure 3B The diagrams illustrate the processing of two parts of the first training samples during the first training process of the initial neural network model according to embodiments of the present disclosure. In one or more embodiments of the present disclosure, the first training process 300 of the initial neural network model may include generating first unmasked data 3351 and random masked data related to the first training samples 335. In one or more embodiments of the present disclosure, similar to the inference process, meteorological dynamic data in historical multi-source meteorological data can be parameter standardized to generate meteorological dynamic standardized data of historical multi-source meteorological data. Furthermore, static features related to historical multi-source meteorological data are generated based on the meteorological static data of historical multi-source meteorological data; dynamic features related to historical multi-source meteorological data are generated based on the meteorological dynamic standardized data of historical multi-source meteorological data; temporal features related to historical multi-source meteorological data are generated based on all historical time points of historical multi-source meteorological data; and spatial features related to historical multi-source meteorological data are generated based on all pixels of historical multi-source meteorological data.

[0035] like Figure 3A As shown, in one or more embodiments of this disclosure, first unmasked data 3351 and partially masked data 3352 can be generated based on static features, dynamic features, temporal features, and spatial features related to historical multi-source meteorological data. For example, the static features, temporal features, and spatial features of historical multi-source meteorological data can be concatenated together to obtain the first unmasked data 3351. Simultaneously, the dynamic features, temporal features, and spatial features of historical multi-source meteorological data are concatenated together to obtain third unmasked data. Subsequently, local labeling and masking processing (95% masking rate) is performed on the third unmasked data to obtain partially masked data 3352. Figure 3B As shown, with Figure 3AThe difference lies in that, in one or more embodiments of this disclosure, a global window masking process (75% masking rate) can be applied to the third unmasked data to obtain global masked data 3353. Through this hybrid mechanism of local and global masking, the model inference stage can accurately predict multi-source meteorological data with non-uniform distribution (missing some pixel data). The model can also capture global meteorological dependencies in multi-source meteorological data, compensating for the insufficient spatiotemporal continuity of coefficient observations.

[0036] In one or more embodiments of this disclosure, the first training process 300 may further include generating second unmasked data of the first training samples based on the first unmasked data 3351 using an encoder 341 based on a hybrid attention mechanism. In one or more embodiments of this disclosure, the 20 Transformer modules 345 of the encoder 341 may alternately perform local and global attention on the first unmasked data 3351 to generate the second unmasked data. In one or more embodiments of this disclosure, the first unmasked data 3351 may be divided into multiple pixel windows (e.g., 30µs). (60-pixel window) Local attention mechanisms can achieve self-attention within a window, while global attention mechanisms can interact with the nth label of each window and the nth labels of all other windows. Through cross-window interaction of the global attention mechanism, large-scale meteorological information can be integrated, enabling the global attention mechanism to transfer information between windows and avoid the "field-of-view limitation" of local attention.

[0037] In one or more embodiments of this disclosure, the first training process 300 may further include, based on local mask data 3352 (or global mask data 3353) and second unmasked data generated by encoder 341, data reorganization processing by data reorganization module 344, unifying the data arrangement, and inputting it into decoder 342 based on a hybrid attention mechanism to generate sample predicted climate bias 351 for the first training samples. In one or more embodiments of this disclosure, the five Transformer modules 345 of decoder 342 may alternately perform local attention and global attention on the data input to data reorganization module 344. In one or more embodiments of this disclosure, decoder 342 may also incorporate a Swing shift operation capable of dividing the input into non-overlapping local windows. In this way, a balance between computational load and receptive field can be achieved, facilitating deployment in devices with limited computing resources.

[0038] Furthermore, in one or more embodiments of this disclosure, the first training process 300 may further include adjusting the model parameters of the encoder 341 and the decoder 342 based on the historical sample true climate deviation and the sample predicted climate deviation of the first training samples. In one or more embodiments of this disclosure, formulas 1-2 may be used as the objective function of the first training process 300 based on the statistical results of all first training samples in the training set.

[0039]

[0040] N represents the number of the first training samples, and i represents the i-th first training sample. This represents the sample predicted climate bias corresponding to historical multi-source meteorological data, where the input parameters are... This represents the dynamic standardized meteorological data from historical multi-source meteorological data. The input parameter S represents the static meteorological data from historical multi-source meteorological data, and the input parameter M represents the global mask used to generate the global mask data. This represents the sample true climate bias of historical multi-source meteorological data. By replacing the forecasting objective of meteorological prediction models from time trends to climatological biases in this way, overfitting to short-term fluctuations can be reduced.

[0041] In one or more embodiments of this disclosure, after the first training process is completed, the model parameters of the encoder and decoder in the initial neural network model can be frozen, and a second training process can be performed to determine the model parameters of the task adapter head. In one or more embodiments of this disclosure, the training set includes multiple second training samples, which include historical multi-source meteorological data and the target task's true results at a future preset time corresponding to the historical multi-source meteorological data. For example, the target task can be higher-resolution meteorological forecast data, or it can be one or more of the following: predicting the surface temperature, visibility, probability of water accumulation, and probability of icing of the target road. Correspondingly, the target task's true results of the historical multi-source meteorological data can be higher-resolution meteorological forecast results, or it can be predicted values ​​of the target road's surface temperature, visibility, probability of water accumulation, probability of icing, etc. Similar to the first training process 300, in one or more embodiments of this disclosure, the second training process can include generating first unmasked data and random masked data related to the second training samples based on the second training samples, wherein the random masked data is local random masked data or global random masked data generated based on the second training samples. Based on this, using the first unmasked data, the encoder that has completed the first training process generates the second unmasked data for the second training samples. Based on the second unmasked data and the masked data, the decoder that has completed the first training process generates sample weather prediction results for the second training samples. In one or more embodiments of this disclosure, the second training process can also generate sample target task prediction results based on the sample weather prediction results using a task adaptation head. In one or more embodiments of this disclosure, the model parameters of the task adaptation head can also be adjusted based on the actual target task results and the sample target task prediction results to minimize the difference between the actual target task results and the sample target task prediction results. The weather prediction model trained in this way has multi-task adaptation capabilities and can support road icing probability prediction, visibility assessment, and traffic flow correlation analysis.

[0042] Figure 4 A schematic block diagram of an example apparatus 400 according to some embodiments of the present disclosure is shown. Apparatus 400 may be implemented in software, hardware, or a combination of both. Figure 4 As shown, the device 400 includes a feature generation module 401 and a result generation module 402.

[0043] In some embodiments, the feature generation module 401 can be configured to generate static features, dynamic features, temporal features, and spatial features related to multi-source meteorological data based on multi-source meteorological data. The multi-source meteorological data includes multiple pixels, each pixel having corresponding static and dynamic meteorological data. The dynamic meteorological data includes meteorological observation data from one or more historical time points, and the meteorological observation data includes surface observation data and vertical observation data. The vertical observation data includes barometric strata observation data corresponding to one or more barometric strata. The result generation module 402 can be configured to generate meteorological forecast results for a predetermined future time based on the static, dynamic, temporal, and spatial features, using a trained meteorological prediction model. The meteorological prediction model includes a model obtained by training an initial neural network model based on a Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

[0044] Figure 4 The device 400 can be used to achieve the above-mentioned combination. Figures 1 to 3A and Figure 3B For the sake of brevity, the process described will not be repeated here.

[0045] The division of modules or units in the embodiments of this disclosure is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the disclosed embodiments may be integrated into one unit, exist as separate physical entities, or two or more units may be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.

[0046] Figure 5 A block diagram of an example device 500 that can be used to implement embodiments of the present disclosure is shown. It should be understood that... Figure 5 The device 500 shown is merely an example and should not be construed as limiting the functionality and scope of the implementation described herein. For example, device 500 can be used to perform the functions described above. Figures 1 to 3A and Figure 3B The process described.

[0047] like Figure 5As shown, device 500 is in the form of a general-purpose computing device. Components of computing device 500 may include, but are not limited to, one or more processors or processing units 501, memory 502, storage device 503, one or more communication units 504, one or more input devices 505, and one or more output devices 506. Processing unit 501 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 502. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of computing device 500.

[0048] Computing device 500 typically includes multiple computer storage media. Such media can be any available media accessible to computing device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 502 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof). Storage device 503 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media capable of storing information and / or data (e.g., training data for training) and accessible within computing device 500.

[0049] The computing device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 5 As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 502 may include computer program product 521 having one or more program modules configured to perform various methods or actions of various implementations of this disclosure.

[0050] The communication unit 504 enables communication with other computing devices via a communication medium. Additionally, the components of the computing device 500 can function as a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the computing device 500 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.

[0051] Input device 505 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 506 can be one or more output devices, such as a monitor, speaker, printer, etc. Computing device 500 can also communicate with one or more external devices (not shown) via communication unit 504 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with computing device 500, or with any device that enables computing device 500 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication can be performed via an input / output (I / O) interface (not shown).

[0052] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is provided that stores a computer program thereon, which, when executed by a processor, implements the methods described above.

[0053] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0054] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0055] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0056] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0057] Various implementations of this disclosure have been described above. The foregoing description is exemplary and not exhaustive, nor is it limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method (200) for forecasting weather, characterized in that, include: Based on multi-source meteorological data, static features, dynamic features, temporal features, and spatial features related to the multi-source meteorological data are generated (202). The multi-source meteorological data includes multiple pixels, each pixel having corresponding static and dynamic meteorological data. The dynamic meteorological data includes meteorological observation data from one or more historical time points, and the meteorological observation data includes surface observation data and vertical observation data. The vertical observation data includes barometric strata observation data corresponding to one or more barometric strata. Based on the static features, the dynamic features, the temporal features, and the spatial features, a meteorological prediction model is used to generate (204) a meteorological prediction result for a future preset time. The meteorological prediction model includes a model obtained by training an initial neural network model based on the Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

2. The method according to claim 1, characterized in that, The meteorological forecast results include the predicted climate deviation for the preset future time; and the generation of static features, dynamic features, temporal features, and spatial features related to the multi-source meteorological data based on multi-source meteorological data includes: The meteorological dynamic data of the multi-source meteorological data are parameter standardized to generate meteorological dynamic standardized data of the multi-source meteorological data; and Based on the meteorological static data, meteorological dynamic standardized data, historical time points, and pixels of the multi-source meteorological data, static features, dynamic features, temporal features, and spatial features related to the multi-source meteorological data are generated respectively.

3. The method according to claim 2, characterized in that, The initial neural network model includes an encoder, a decoder, and a task adapter. The training of the initial neural network includes a first training process to determine the model parameters of the encoder and the decoder based on the training set, and a second training process to determine the model parameters of the multi-task adapter based on the training set. The meteorological prediction results include global meteorological prediction results generated by the encoder of the trained meteorological prediction model and target task prediction results generated by the task adapter of the trained meteorological prediction model.

4. The method according to claim 3, characterized in that, The training set includes multiple first training samples, which include historical multi-source meteorological data and the corresponding historical sample true climate deviations. The first training process of the initial neural network model includes: Based on the first training sample, first unmasked data and random mask data related to the first training sample are generated, wherein the random mask data is local random mask data or global random mask data generated based on the first training sample. Based on the first unmasked data, the encoder based on the hybrid attention mechanism generates the second unmasked data of the first training sample; Based on the second unmasked data and the masked data, a sample prediction climate bias for the first training samples is generated using the decoder based on a hybrid attention mechanism; and Based on the historical sample real climate bias and sample predicted climate bias of the first training sample, the model parameters of the encoder and the decoder are adjusted.

5. The method according to claim 4, characterized in that, The process of generating first unmasked data and random masked data related to the first training sample, based on the first training sample, includes: The meteorological dynamic data of the historical multi-source meteorological data is standardized by parameters to generate the meteorological dynamic standardized data of the historical multi-source meteorological data. Based on the historical multi-source meteorological data, including static meteorological data, standardized dynamic meteorological data, historical time points, and pixels, static features, dynamic features, temporal features, and spatial features related to the historical multi-source meteorological data are generated; and Based on the static, dynamic, temporal, and spatial characteristics related to the historical multi-source meteorological data, the first unmasked data and the random masked data are generated.

6. The method according to claim 5, characterized in that, The first unmasked data is obtained by splicing the static, temporal, and spatial features of the historical multi-source meteorological data, and the random masked data is generated by splicing the dynamic, temporal, and spatial features of the historical multi-source meteorological data to obtain the third unmasked feature.

7. The method according to any one of claims 3-6, characterized in that, The encoder includes at least two Transformer modules, and the at least two Transformer modules alternately perform local attention and global attention mechanisms on the first mask data; and The decoder includes at least two Transformer modules, which alternately perform local attention and global attention mechanisms on the second mask data, and the decoder calculates attention based on a shift window.

8. The method according to claim 2, characterized in that, The training set includes multiple second training samples, which include historical multi-source meteorological data and the actual results of the target task at a future preset time corresponding to the historical multi-source meteorological data. The second training process of the initial neural network model includes: Based on the second training sample, first unmasked data and random mask data related to the second training sample are generated, wherein the random mask data is local random mask data or global random mask data generated based on the second training sample; Based on the first unmasked data, the encoder that has completed the first training process generates the second unmasked data of the second training sample; Based on the second unmasked data and the masked data, a sample weather prediction result for the second training sample is generated by the decoder that has completed the first training process. Based on the sample meteorological forecast results, the target task forecast results for the sample are generated through the task adaptation head; and Based on the actual results of the target task and the predicted results of the sample target task, the model parameters of the task adapter head are adjusted.

9. A device (400) for forecasting weather, characterized in that, include: The feature generation module is configured to generate static features, dynamic features, temporal features, and spatial features related to the multi-source meteorological data based on the multi-source meteorological data. The multi-source meteorological data includes multiple pixels, each pixel having corresponding static meteorological data and dynamic meteorological data. The dynamic meteorological data includes meteorological observation data at one or more historical time points. The meteorological observation data includes surface observation data and vertical observation data. The vertical observation data includes barometric observation data corresponding to one or more barometric layers. as well as The result generation module is configured to generate a weather forecast result for a future preset time based on the static features, the dynamic features, the temporal features, and the spatial features, using a trained weather forecast model. The weather forecast model includes a model obtained by training an initial neural network model based on the Swin-Transformer mechanism and a hybrid attention mechanism using a training set.

10. Electronic devices (500), including: One or more processors, and A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any one of claims 1-8.