Meteorological element prediction method and related equipment
By using the multi-head attention prediction module based on the Koopman operator in meteorological prediction for parallel prediction, the problem of uncharacterized initial value perturbation sensitivity and nonlinear coupling relationship in meteorological factor prediction is solved, and efficient and high-precision meteorological prediction is achieved .
Patent Information
- Application Number
- CN202311049445.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
In numerical meteorological prediction, as the meteorological elements and prediction time range increase, the system's sensitivity to initial disturbance increases, resulting in a decrease in prediction accuracy; in the multi-meteorological element prediction task, the complex nonlinear coupling relationship between meteorological elements cannot be effectively portrayed. , resulting in a cumulative error increase; the single-channel prediction framework is not friendly to accelerated prediction, resulting in low prediction efficiency.
The multi-head attention prediction module based on the Koopman operator is used to predict multiple meteorological elements in parallel. By constructing the multi-head attention prediction module, the historical data of meteorological elements are encoded and sparsely constrained to analyze and predict the coupling relationship between meteorological elements.
It significantly improves the accuracy and efficiency of meteorological factor prediction, is suitable for real scenes with complex terrain and chaotic effects in meteorological systems, and supports high-precision meteorological prediction.
Smart Images

Figure CN119494234A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for predicting meteorological elements and related equipment. Background Art
[0002] Numerical weather forecasting has become a mainstream tool in the meteorological industry since the mid-twentieth century and is one of the national infrastructures that maintain industrial production and economic activities. From the perspective of high-performance computing, all numerical weather forecasting systems are numerical solution systems for a specific set of differential equations of multiple meteorological elements. In the task of numerical meteorological forecasting, as the number of meteorological elements (i.e., system dimension) and the forecast time range involved in the forecast task increase, the system will introduce more nonlinear factors and potential chaotic mechanisms, which will inevitably increase the time consumption of computational solution and lead to lower efficiency in forecasting meteorological elements. Summary of the invention
[0003] The embodiment of the present application provides a meteorological element prediction method and related equipment, which uses a multi-head attention prediction module built based on the Koopman operator to perform parallel prediction of multiple meteorological elements, which can improve the prediction efficiency and prediction accuracy of meteorological elements.
[0004] In a first aspect, an embodiment of the present application provides a method for predicting meteorological elements, which is applied to an electronic device, and the method includes:
[0005] Obtain historical data of multiple meteorological elements in the region;
[0006] Encoding historical data of multiple meteorological elements to obtain a first matrix representing a coupling relationship between the multiple meteorological elements;
[0007] The column data or row data of the first matrix is processed in parallel by the constructed multi-head attention prediction module to obtain the prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the column data of the first matrix one by one; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the row data of the first matrix one by one;
[0008] The prediction results of the multi-head attention prediction module are decoded to obtain the prediction results of multiple meteorological elements.
[0009] It can be seen that in the embodiment of the present application, the electronic device processes the prediction tasks of multiple meteorological elements in parallel through the constructed multi-head attention prediction module, which is conducive to reducing the difficulty of engineering deployment for real scenes, and is suitable for depicting the complex dynamics of multiple meteorological elements in the medium and long term, and improves the prediction efficiency of multiple meteorological elements with a parallel acceleration architecture. In addition, the multi-head attention prediction module analyzes and predicts the coupling relationship between each meteorological element, which significantly improves the accuracy of meteorological element prediction. Through the framework of the multi-head attention prediction module, the electronic device can capture the nonlinear relationship between meteorological elements, which is more suitable for real scenes with complex terrain and chaotic effects in the meteorological system, and can support high-precision meteorological forecasts.
[0010] In a possible implementation, historical data of multiple meteorological elements are encoded to obtain a first matrix representing a coupling relationship between the multiple meteorological elements, including:
[0011] The historical data of multiple meteorological elements are patch-embedded by an encoder to obtain a second matrix representing the coupling relationship between the multiple meteorological elements;
[0012] The second matrix is sparsely constrained to obtain the first matrix.
[0013] In this implementation, the first matrix obtained by patch embedding is not the weight matrix of each Token obtained based on consistent weights, but a matrix that characterizes the coupling relationship between various meteorological elements. It can describe the law of spatial mutual influence of various meteorological elements, and to a certain extent reflects the terrain information, which is more conducive to improving the prediction accuracy of various meteorological elements. Sparse constraints are imposed on each coupling relationship matrix (i.e., the first matrix) to ensure that the coupling relationship matrix is a sparse matrix, which not only reduces the computational pressure of data distribution in the parallel computing process, but also avoids the redundant characterization of the coupling relationship between meteorological elements by the prediction system.
[0014] In a possible implementation, each attention prediction module includes multiple fusion feature extraction modules, each fusion feature extraction module includes a Koopman operator; the input of the i-th fusion feature extraction module among the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; wherein i is greater than 1.
[0015] In this implementation, a set of serially connected fusion feature extraction modules is used in each attention prediction module to process the spatiotemporal distribution of the coupling relationship between a given meteorological element and all other meteorological elements, and the Koopman operator is used for prediction in each fusion feature extraction module. It is suitable for large-scale data structures and can cope with high-resolution and multi-meteorological element prediction tasks.
[0016] In a possible implementation, the constructed multi-head attention prediction module processes the column data or row data of the first matrix in parallel to obtain a prediction result of the multi-head attention prediction module, including:
[0017] In parallel, the following operations are performed in each attention prediction module:
[0018] For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features;
[0019] The low-frequency features are input into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain the initial prediction result;
[0020] Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and,
[0021] Perform convolution on the input data to obtain the corresponding high-frequency features;
[0022] The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module;
[0023] After being processed by multiple fusion feature extraction modules, the prediction results of each attention prediction module are obtained;
[0024] Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
[0025] In this implementation, the electronic device uses the Koopman operator in each fusion feature extraction module to predict the coupling data of meteorological elements, which continues the computational advantages of the Koopman operator, can be independent of the complexity of grid parameters during training, and can better control the computational time consumption during prediction. The mode of serial processing of multiple fusion feature extraction modules is very friendly to reducing the difficulty of solving the power system and improving the accuracy of long-range solutions. In addition, high-frequency information is compensated in each fusion feature extraction module, which is conducive to reducing the information loss of the prediction results output by the attention prediction module, thereby improving the prediction accuracy of multiple meteorological elements. In addition, the single-head attention prediction module does not process the spatiotemporal distribution of specific meteorological elements separately, but processes the spatiotemporal distribution of the coupling relationship of different meteorological elements. The data distributed between the multi-head attention prediction modules is not the same weight matrix for all elements, but the different column data or row data of the meteorological element coupling relationship matrix. While parallel prediction is performed, the mutual influence between multiple meteorological elements is considered, achieving a balance between efficiency and accuracy.
[0026] In a possible implementation, the prediction results of the multi-head attention prediction module are decoded to obtain the prediction results of multiple meteorological elements, including:
[0027] Obtaining a third matrix representing the coupling relationship between multiple meteorological elements;
[0028] Based on the third matrix, the prediction results of the multi-head attention prediction module are coupled to obtain a prediction result fusion matrix;
[0029] Perform sparse constraints on the prediction result fusion matrix to obtain the matrix to be decoded;
[0030] The matrix to be decoded is decoded back to the original space of historical data of multiple meteorological elements through a decoder to obtain the prediction results of multiple meteorological elements.
[0031] In this implementation, after multiple attention prediction modules complete the calculation, the prediction results of different attention prediction modules are coupled based on the coupling relationship matrix to improve the prediction accuracy. At the same time, sparse constraints on the prediction result fusion matrix can reduce the pressure of spatial conversion and avoid redundant characterization of the coupling relationship between meteorological elements by the prediction system.
[0032] In a possible implementation, the Koopman operator in each fusion feature extraction module is dynamically iterated according to a set number of iterations.
[0033] In this implementation, the electronic device controls the Koopman operator to dynamically iterate according to the set number of iterations, thereby being able to switch freely between any reasoning time series, which is conducive to achieving the portability and controllability of the prediction time series.
[0034] In a second aspect, an embodiment of the present application provides a meteorological element prediction device, the device comprising an acquisition unit and a processing unit.
[0035] An acquisition unit, used for acquiring historical data of multiple meteorological elements in a region;
[0036] A processing unit is used to encode the historical data of multiple meteorological elements to obtain a first matrix that characterizes the coupling relationship between the multiple meteorological elements; the column data or row data of the first matrix is processed in parallel by a constructed multi-head attention prediction module to obtain the prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the column data of the first matrix; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the row data of the first matrix; decoding is performed based on the prediction result of the multi-head attention prediction module to obtain the prediction results of multiple meteorological elements.
[0037] In a possible implementation, in encoding the historical data of multiple meteorological elements to obtain a first matrix representing the coupling relationship between the multiple meteorological elements, the processing unit is specifically used to:
[0038] The historical data of multiple meteorological elements are patch-embedded by an encoder to obtain a second matrix representing the coupling relationship between the multiple meteorological elements;
[0039] The second matrix is sparsely constrained to obtain the first matrix.
[0040] In a possible implementation, each attention prediction module includes multiple fusion feature extraction modules, each fusion feature extraction module includes a Koopman operator; the input of the i-th fusion feature extraction module among the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; wherein i is greater than 1.
[0041] In a possible implementation, in terms of performing parallel processing on column data or row data of the first matrix by constructing a multi-head attention prediction module to obtain a prediction result of the multi-head attention prediction module, the processing unit is specifically used to:
[0042] In parallel, the following operations are performed in each attention prediction module:
[0043] For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features;
[0044] The low-frequency features are input into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain the initial prediction result;
[0045] Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and,
[0046] Perform convolution on the input data to obtain the corresponding high-frequency features;
[0047] The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module;
[0048] After being processed by multiple fusion feature extraction modules, the prediction results of each attention prediction module are obtained;
[0049] Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
[0050] In a possible implementation, in decoding the prediction results based on the multi-head attention prediction module to obtain the prediction results of multiple meteorological elements, the processing unit is specifically used to:
[0051] Obtaining a third matrix representing the coupling relationship between multiple meteorological elements;
[0052] Based on the third matrix, the prediction results of the multi-head attention prediction module are coupled to obtain a prediction result fusion matrix;
[0053] Perform sparse constraints on the prediction result fusion matrix to obtain the matrix to be decoded;
[0054] The matrix to be decoded is decoded back to the original space of historical data of multiple meteorological elements through a decoder to obtain the prediction results of multiple meteorological elements.
[0055] In a possible implementation, the Koopman operator in each fusion feature extraction module is dynamically iterated according to a set number of iterations.
[0056] It can be understood that since the method embodiment and the device embodiment are different presentation forms of the same technical concept, the content of the first aspect of the embodiment of the present application should be synchronously adapted to the second aspect of the embodiment of the present application, and can achieve the same or similar beneficial effects, which will not be repeated here.
[0057] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and one or more programs, wherein the processor is connected to the memory, the one or more programs are stored in the memory, and are configured to implement the method in the first aspect when executed by the processor.
[0058] In a fourth aspect, an embodiment of the present application provides a chip, comprising: a processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the method in the first aspect described above.
[0059] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program for execution by a device, and when the computer program is executed, implements the method in the first aspect as described above.
[0060] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run by an electronic device, the electronic device executes the method in the first aspect as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0062] Figure 1 A schematic diagram of the advantages and disadvantages of a high-resolution grid and a low-resolution grid provided in an embodiment of the present application;
[0063] Figure 2 A schematic diagram of a prediction framework for multiple meteorological elements provided in an embodiment of the present application;
[0064] Figure 3 A schematic diagram of a flow chart of a method for predicting meteorological elements provided in an embodiment of the present application;
[0065] Figure 4 An overall schematic diagram of a prediction framework of multiple meteorological elements provided in an embodiment of the present application;
[0066] Figure 5 A schematic diagram of an attention prediction module in a prediction framework of multiple meteorological elements provided in an embodiment of the present application;
[0067] Figure 6 A schematic diagram of a flow chart of another method for predicting meteorological elements provided in an embodiment of the present application;
[0068] Figure 7 A schematic diagram of the structure of a meteorological element prediction device provided in an embodiment of the present application;
[0069] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0071] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0072] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process, a processor, an object, an executable file, an execution thread, a program and / or a computer running on a processor. By way of illustration, both applications running on a terminal device and a terminal device can be components. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).
[0073] First, the relevant terms and related technical background in this application are briefly described to facilitate understanding by those skilled in the art.
[0074] (1) Neural Operator (NO): A neural network used to learn the mapping operator between the parameter space and the solution space of partial differential equations (PDE).
[0075] (2) Koopman Neural Operator (KNO): A linear but infinite-dimensional neural operator that can use the data of a nonlinear system to elevate it to an infinite-dimensional state space, in which the system evolves in a linear manner.
[0076] (3) Numerical weather forecasting system (NWFS): A computing system that predicts future short-, medium- and long-range weather based on a certain digital solution tool.
[0077] (4) Meteorological element correlation prediction: In numerical meteorological prediction, instead of predicting a single meteorological element, we analyze the relationship between multiple meteorological elements and then make a unified meteorological prediction based on this relationship.
[0078] The underlying technology of numerical weather forecasting is PDE numerical solution and high performance computing (HPC). In classic numerical solution schemes, such as the Finite Difference Method (FDM) and the Finite Element Method (FEM), the differential equation solution framework is divided into two parts: grid generation and differential solution. Among them, grid generation refers to defining a spatial discretization scheme to parameterize the target differential equation into a differential equation in the grid space. In meteorological forecasting, the grid resolution usually needs to be 0.5 degrees or less. Differential solution generally refers to the iterative solution of the differential format of the target equation in the grid space. The solution process requires strict completion of numerical iteration (the so-called "ab initio calculation"), and steps cannot be skipped at will. The design of parallel solutions is difficult.
[0079] Therefore, existing numerical global weather forecasting systems often face the trade-off between computational complexity and computational accuracy. Figure 1 As shown in the figure, on the one hand, although high-resolution grids support differential solutions to obtain higher-precision differential equation solutions, thus supporting more detailed and accurate weather forecasts, they cause an exponential explosion in computational complexity, put forward huge demands on computing hardware capabilities (for example, the deployment of the Integrated Forecast System (IFS) requires large-scale computing clusters or supercomputers), and also cause huge computing time consumption, which is often difficult to apply to the rapid prediction of short-term weather. On the other hand, although low-resolution grids control the computational complexity, the resolution of the forecast results of the meteorological system is limited, and it can only reveal the macroscopic meteorological system on a global scale, and it is difficult to make accurate predictions of the weather in local areas.
[0080] One of the existing technologies is the mainstream numerical weather forecasting framework represented by IFS. The deployment of these forecasting frameworks is relatively dependent on grid solutions or finite element solutions. The calculations need to strictly follow the given initial values and boundary conditions. It is difficult to achieve skip calculations and direct migration between different solution conditions, which will inevitably lead to longer solution delays, and cannot be separated from large-scale computing clusters. In addition, there are usually multiple coupled meteorological element differential equations in the forecast system. The iterative solution implemented by each differential equation does not consider the coupling relationship between the meteorological elements, and it is difficult to achieve parallel solution.
[0081] The second existing technology is FourCastNet, a numerical weather forecasting platform based on Fourier Neural Operator (FNO) released by NVIDIA. It is designed for high-resolution input, and projects the input variables on the 720*1440 grid into the 2D space of the patch, and then feeds the patch sequence together with the position code to a series of Adaptive Fourier Neural Operator (AFNO) layers. FourCastNet is usually trained under a specific forecast time course. If it is migrated to other forecast time conditions for prediction, it may lead to a decrease in prediction accuracy. FNO performs frequency truncation during the Fourier transform process, losing high-frequency information. In the process of migrating from low-resolution grids to high-resolution grids, due to the failure to characterize high-frequency disturbances, there may be fluctuations in accuracy on data with nonlinear and chaotic phenomena. In addition, the number of parameters of the FNO module is huge, and the computing resources occupied during training are large. The prediction framework based on FNO integration is difficult to compress.
[0082] The third existing technology is an autoregressive model based on graph neural network and new high-resolution multi-scale grid representation, GraphCast, which can make 10-day forecasts for five surface variables and six atmospheric variables at 6-hour intervals on a 0.25-degree latitude-longitude grid. GraphCast is a pure black box solution that requires a lot of graph theory, graph algorithms, and database management. The model training is complex, the data input format is also complex, and it lacks good interpretability. It is not a cost-effective solution.
[0083] The fourth prior art discloses a distribution network line meteorological forecasting method based on wavelet neural network, which is used to predict the coupling relationship between four elements: wind direction, wind speed, temperature and humidity. Wavelet neural network is an improved neural network model that uses wavelet basis function as the excitation function of neurons in the neural network. According to the actual observed temperature data, a wavelet neural network is constructed to forecast the short-term temperature. However, wavelet neural network can only characterize the coupling relationship between the time series of single coordinate points of a few meteorological elements, and there are certain applicability limitations for the characterization of the coupling relationship of any number of meteorological elements.
[0084] Based on the deficiencies of the prior art, the technical problems to be solved by this application mainly include: (1) In numerical meteorological forecasting, as the number of meteorological elements involved and the forecast time increases, the system's sensitivity to initial value disturbances also increases. A very small disturbance in the initial value can cause a large deviation in the state of the dynamic system after a period of evolution, which makes it particularly difficult to accurately predict and characterize the changes in meteorological elements in a limited data set; (2) In the forecasting task of multiple meteorological elements, there are complex nonlinear coupling relationships between meteorological elements. The forecast of a single meteorological element often ignores the mutual influence between meteorological elements. The forecast error of a single meteorological element will also affect the forecast accuracy of other meteorological elements, and the cumulative error of the system will explode; (3) The single-channel forecasting framework is not friendly to accelerated forecasting, and it is difficult to reduce the forecasting time, and the forecasting efficiency is low.
[0085] The following is a brief description of the architecture or framework to which this application can be applied.
[0086] See also Figure 2 , Figure 2 A schematic diagram of a forecast framework for multiple meteorological elements provided in an embodiment of the present application, such as Figure 2 As shown in the figure, the prediction framework mainly includes a data encoding and meteorological element coupling relationship matrix generation and sparseness module, a multi-head attention prediction module based on neural operators, and a data coupling and decoding module. Among them, the data encoding and meteorological element coupling relationship matrix generation and sparseness module is used to convert the input meteorological element data from "length × width × height × meteorological element type" to the "patch × meteorological element type × meteorological element type" format, and perform sparse constraints on the converted data; the multi-head attention prediction module based on neural operators uses the Koopman operator as the basic calculation unit to construct Head 1, Head 2, ..., Head N multi-head attention prediction modules, where N is greater than 1. Each Head (i.e., each head attention prediction module) takes a single column or single row of the matrix in the format of "patch × meteorological element type × meteorological element type" as input, and uses multiple Koopman operators to dynamically iterate the meteorological element data. Different heads are connected in parallel to implement parallel prediction of multiple meteorological elements. The data coupling and decoding module is used to fuse all the prediction data based on the coupling relationship matrix after each Head completes the prediction, decode and sparsely constrain the fused data, and obtain the prediction results of each meteorological element.
[0087] The technical solution provided by this application is introduced in detail below in conjunction with specific implementation methods.
[0088] See also Figure 3 , Figure 3A flow chart of a method for predicting meteorological elements provided in an embodiment of the present application, which can be based on Figure 2 The framework shown is implemented and can be executed by an electronic device. Figure 3 As shown, the method includes steps 301-304:
[0089] 301: Obtain historical data of multiple meteorological elements in the region.
[0090] In the embodiment of the present application, the multiple meteorological elements may be temperature, air pressure, wind speed, visibility, precipitation, humidity, radiation, etc. The specific number is not limited. The format of historical data is "length × width × height × meteorological element type". As time goes by, the time dimension can be added. It should be noted that the historical data may not include terrain information or some additional information, which reduces the limitation that terrain and other information must be used for prediction. The historical data of multiple meteorological elements constitute the meteorological variable γ 1 ,…,γ h , meteorological variables γ 1 ,…,γ h They are coupled to each other and are all defined on the D×T domain. Where h represents the dimension of the meteorological variable. D represents the spatial domain and T represents the temporal domain. The dynamics of these variables are controlled by a set of partial differential equations. This application can be achieved by Figure 2 The framework shown learns the solution of the partial differential equation to accurately represent the meteorological variable γ 1 ,…,γ h 's dynamics.
[0091] 302: Encode historical data of multiple meteorological elements to obtain a first matrix representing a coupling relationship between the multiple meteorological elements.
[0092] In the embodiment of the present application, under the overall prediction framework, the implementation of the prediction of multiple meteorological elements is divided into 7 parts, and the first part (part 1) is mainly implemented in the data encoding and meteorological element coupling relationship matrix generation and sparseness module. Exemplarily, the electronic device uses an encoder to perform block patch embedding on the historical data of multiple meteorological elements to obtain a matrix (called the second matrix) representing the coupling relationship between multiple meteorological elements, and then performs sparse constraints on the second matrix to obtain a first matrix representing the coupling relationship between multiple meteorological elements. Exemplarily, as Figure 4 As shown, historical data can be represented by a latitude and longitude grid of length × height, and the encoder can be an encoder component. In part 1, the encoder component transforms the historical data in the grid through the characteristic function φ, which is represented as R is a real number, d φ×h represents the dimension. For the converted data, the observation function g(·) is used to map it to the observation space where the patch is located to obtain a three-dimensional token tensor For ease of description, the three-dimensional Token tensor is jointly represented as Exemplarily, a nonlinear LASSO method may be used to perform sparse constraints on each second matrix.
[0093] The observation function g(·) is implemented through the Token embedding layer of the Vision Transformer (ViT), which is implemented through the convolutional layer Embed it. The embedded patch can be found in Figure 4 . Each patch is a square, non-overlapping macrogrid. Assuming the spatial resolution of the patch is 4×4, the grid containing historical data is discretized into (length / 4)×(height / 4) patches in the spatial domain D. Where l represents the embedding dimension of the patch, and the N×N matrix (i.e., the second matrix) corresponding to the patch after token embedding is used to characterize the coupling relationship between N meteorological elements.
[0094] In this implementation, the first matrix obtained by patch embedding is not the weight matrix of each Token obtained based on consistent weights, but a matrix that characterizes the coupling relationship between various meteorological elements. It can describe the law of spatial mutual influence of various meteorological elements, and to a certain extent reflects the terrain information, which is more conducive to improving the prediction accuracy of various meteorological elements. Sparse constraints are imposed on each coupling relationship matrix (i.e., the first matrix) to ensure that the coupling relationship matrix is a sparse matrix, which not only reduces the computational pressure of data distribution in the parallel computing process, but also avoids the redundant characterization of the coupling relationship between meteorological elements by the prediction system.
[0095] 303: The column data or row data of the first matrix is processed in parallel by the constructed multi-head attention prediction module to obtain a prediction result of the multi-head attention prediction module.
[0096] Among them, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the column data of the first matrix; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the row data of the first matrix.
[0097] In the embodiment of the present application, part 2 to part 6 (part2-part6) are implemented in a multi-head attention prediction module based on a neural operator. For example, please continue to refer to Figure 4, each attention prediction module includes multiple fusion feature extraction modules, and the input of the i-th fusion feature extraction module in the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; where i is greater than 1. Each fusion feature extraction module predicts the input data through part2-part6. The third part (part3) is the Koopman operator module.
[0098] In this implementation, a set of serially connected fusion feature extraction modules is used in each attention prediction module to process the spatiotemporal distribution of the coupling relationship between a given meteorological element and all other meteorological elements, and the Koopman operator is used for prediction in each fusion feature extraction module. It is suitable for large-scale data structures and can cope with high-resolution and multi-meteorological element prediction tasks.
[0099] Exemplarily, the electronic device performs the following operations in each attention prediction module in parallel:
[0100] For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features;
[0101] The low-frequency features are input into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain the initial prediction result;
[0102] Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and,
[0103] Perform convolution on the input data to obtain the corresponding high-frequency features;
[0104] The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module;
[0105] After being processed by multiple fusion feature extraction modules, the prediction results of each attention prediction module are obtained;
[0106] Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
[0107] See also Figure 5 In each attention prediction module, the column data or row data input into the first fusion feature extraction module is Fourier transformed in part 2. Specifically, The longitude and latitude of the truncated Fourier transform are used to obtain the Fourier series of each embedded variable s∈1,…,l Will As low-frequency features, Represents Fourier transform. Part 2 outputs each moment t∈εN + After the corresponding low-frequency features are obtained, the Koopman operator is used as the basis for calculating the unit pair in part 3. Perform dynamic iteration to obtain the initial prediction result of the first fusion feature extraction module, where ε represents the iteration step. Specifically, the Koopman operator mainly acts on the time dimension of each Token, so the dynamic iteration can be expressed as: Indicates is the initial value, and the prediction result with ε as the iteration step length, represents the Koopman operator, which is learned through linear transformation. The network layer Indicates that the prediction process of the Koopman operator first passes through a linear layer Then it is activated by the nonlinear activation function η; express In the fourth part (part4), the first two dimensions (i.e., longitude and latitude) of the initial prediction result output by part3 are inversely transformed by Fourier transform to map the initial prediction result back to the observation space (i.e., the space where the data in the first matrix is located) to obtain the prediction result after inverse Fourier transform. Specifically, the inverse Fourier transform can be expressed as: This is a standard inverse Fourier transform formula, ξ represents the frequency variable, x t+ε Represents the time domain parameters. The fifth part (part5) is used as a high-frequency information compensation module through the convolution layer The column data or row data input into the first fusion feature extraction module is convolved to extract high-frequency features, that is, In part 6, the prediction result after the inverse Fourier transform output of part 4 is High frequency characteristics of the output of part 5 The high and low frequency fusion features output by the first fusion feature extraction module are obtained by fusion. For example, the fusion of high and low frequency information can be performed by linear combination, which is expressed as:
[0108] The second fusion feature extraction module takes the high- and low-frequency fusion features output by the first fusion feature extraction module as input, performs Fourier transform in one branch by part2, performs dynamics based on the Koopman operator by part3, and performs inverse Fourier transform by part4 to obtain the prediction result after inverse Fourier transform; extracts high-frequency features in another branch by part5; and fuses the high-frequency features with the prediction result after inverse Fourier transform in part6 to obtain the high- and low-frequency fusion features output by the second fusion feature extraction module. The processing process of the subsequent fusion feature extraction module can refer to the first fusion feature extraction module and the second fusion feature extraction module, and will not be described one by one here. In each attention prediction module, after multiple fusion feature extraction modules process the input column data or row data, the last fusion feature extraction module outputs the prediction result of the corresponding attention prediction module (i.e., the high- and low-frequency fusion features output by the last fusion feature extraction module).
[0109] Exemplarily, the Koopman operator in each fusion feature extraction module is dynamically iterated according to the set number of iterations. For example, for the one-hour prediction schedule from 0 o'clock to 1 o'clock, the Koopman operator can output the result after iterating 100 times, or it can output the result after iterating 1000 times. Thus, it can switch freely between any reasoning schedules, which is conducive to realizing the portability and controllability of the prediction schedule.
[0110] In this implementation, the electronic device uses the Koopman operator in each fusion feature extraction module to predict the coupling data of meteorological elements, which continues the computational advantages of the Koopman operator, can be independent of the complexity of grid parameters during training, and can better control the computational time consumption during prediction. The mode of serial processing of multiple fusion feature extraction modules is very friendly to reducing the difficulty of solving the power system and improving the accuracy of long-range solutions. In addition, high-frequency information is compensated in each fusion feature extraction module, which is conducive to reducing the information loss of the prediction results output by the attention prediction module, thereby improving the prediction accuracy of multiple meteorological elements. In addition, the single-head attention prediction module does not process the spatiotemporal distribution of specific meteorological elements separately, but processes the spatiotemporal distribution of the coupling relationship of different meteorological elements. The data distributed between the multi-head attention prediction modules is not the same weight matrix for all elements, but the different column data or row data of the meteorological element coupling relationship matrix. While parallel prediction is performed, the mutual influence between multiple meteorological elements is considered, achieving a balance between efficiency and accuracy.
[0111] 304: Decode the prediction results of the multi-head attention prediction module to obtain prediction results of multiple meteorological elements.
[0112] In the embodiment of the present application, since the entire framework is used to learn a multi-meteorological variable system controlled by unknown coupled partial differential equations, it is necessary to describe the coupling relationship between the variables. To capture the coupling relationship between the meteorological elements, a third matrix representing the coupling relationship between multiple meteorological elements is obtained. It should be noted that the third matrix is a coupling relationship matrix obtained based on the prediction results of the multi-head attention prediction module, and the second matrix is a coupling relationship matrix obtained based on the original data of multiple meteorological elements. The electronic device couples the prediction results of the multi-head attention prediction module based on the third matrix to obtain a prediction result fusion matrix, which is expressed as: Please continue to see Figure 4 or Figure 5 In part 7, the prediction result fusion matrix is decoded back to the original space of historical data of multiple meteorological elements through the decoder to obtain the prediction results of multiple meteorological elements, that is, the matrix to be decoded is decoded from the space of "Patch*N*N" back to the space of "length*width*height*time*N". The decoder can be the inverse function g of the observation function g(·) -1 (·). Exemplarily, the decoding process of part7 can be expressed as:
[0113] in, It represents the prediction results of each meteorological element. Decoder is the decoder. The decoder and encoder are jointly trained to ensure that the two constitute a unit mapping.
[0114] Exemplarily, after obtaining the prediction result fusion matrix, the electronic device may also perform sparse constraints on the prediction result fusion matrix to obtain a matrix to be decoded, and then decode the matrix to be decoded back to the original space of historical data of multiple meteorological elements through a decoder in part 7 to obtain prediction results of multiple meteorological elements, wherein the sparse constraint can be implemented using a nonlinear LASSO method.
[0115] In this implementation, after multiple attention prediction modules complete the calculation, the prediction results of different attention prediction modules are coupled based on the coupling relationship matrix to improve the prediction accuracy. At the same time, sparse constraints on the prediction result fusion matrix can reduce the pressure of spatial conversion and avoid redundant characterization of the coupling relationship between meteorological elements by the prediction system.
[0116] It can be seen that in the embodiment of the present application, the electronic device processes the prediction tasks of multiple meteorological elements in parallel through the constructed multi-head attention prediction module, which is conducive to reducing the difficulty of engineering deployment for real scenes, and is suitable for depicting the complex dynamics of multiple meteorological elements in the medium and long term, and improves the prediction efficiency of multiple meteorological elements with a parallel acceleration architecture. In addition, the multi-head attention prediction module analyzes and predicts the coupling relationship between each meteorological element, which significantly improves the accuracy of meteorological element prediction. Through the framework of the multi-head attention prediction module, the electronic device can capture the nonlinear relationship between meteorological elements, which is more suitable for real scenes with complex terrain and chaotic effects in the meteorological system, and can support high-precision meteorological forecasts.
[0117] In order to verify the beneficial effects that can be achieved by this application, researchers conducted experiments on ERA5 (the fifth-generation atmospheric reanalysis dataset of the European Center for Medium-Term Weather Forecasts for the global climate from January 1950 to the present), a large meteorological dataset, a wave dataset of a domestic shipyard, and a meteorological dataset of a domestic meteorological forecast bureau. Compared with the prediction accuracy of FourCastNet, the prediction accuracy of each element in the experiment of this application has been improved by about 5%. Compared with the computing speed of the IFS system, the scheme in the embodiment of this application has been improved by an order of magnitude, and single-card reasoning can be performed. On the ERA5 dataset, the reasoning speed of the 20-element prediction task is 0.02 seconds / single. At the same time, direct migration across prediction tasks or migration tasks after a small amount of training are realized, which can support switching between different prediction tasks.
[0118] Table 1 shows the relevant data of the migration application of training one epoch for the framework provided by this application:
[0119] Table 1
[0120]
[0121] Table 2 shows the relevant data of the direct migration application without training for the framework provided by this application:
[0122] Table 2
[0123]
[0124] Based on the experimental data, it can be seen that the multi-meteorological element prediction framework provided by this application has achieved significant improvements in prediction efficiency, prediction accuracy and transferability.
[0125] See also Figure 6 , Figure 6 A flow chart of another method for predicting meteorological elements provided in an embodiment of the present application, which method can also be based on Figure 2 The framework shown is implemented as Figure 6 As shown, the method includes steps 601-605:
[0126] 601: Obtain historical data of multiple meteorological elements in the region;
[0127] 602: Performing patch embedding on the historical data of multiple meteorological elements through an encoder to obtain a second matrix representing the coupling relationship between the multiple meteorological elements;
[0128] 603: Perform sparse constraints on the second matrix to obtain a first matrix;
[0129] 604: Processing the column data or row data of the first matrix in parallel through the constructed multi-head attention prediction module to obtain a prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the column data of the first matrix one by one; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the row data of the first matrix one by one;
[0130] Among them, each attention prediction module includes multiple fusion feature extraction modules, each fusion feature extraction module includes a Koopman operator; the input of the i-th fusion feature extraction module among the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; among them, i is greater than 1.
[0131] The constructed multi-head attention prediction module processes the column data or row data of the first matrix in parallel to obtain the prediction result of the multi-head attention prediction module, including:
[0132] In parallel, the following operations are performed in each attention prediction module:
[0133] For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features;
[0134] The low-frequency features are input into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain the initial prediction result;
[0135] Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and,
[0136] Perform convolution on the input data to obtain the corresponding high-frequency features;
[0137] The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module;
[0138] After being processed by multiple fusion feature extraction modules, the prediction results of each attention prediction module are obtained;
[0139] Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
[0140] Among them, the Koopman operator in each fusion feature extraction module is dynamically iterated according to the set number of iterations.
[0141] 605: Decode the prediction results of the multi-head attention prediction module to obtain prediction results of multiple meteorological elements.
[0142] Among them, the prediction results based on the multi-head attention prediction module are decoded to obtain the prediction results of multiple meteorological elements, including:
[0143] Obtaining a third matrix representing the coupling relationship between multiple meteorological elements;
[0144] Based on the third matrix, the prediction results of the multi-head attention prediction module are coupled to obtain a prediction result fusion matrix;
[0145] Perform sparse constraints on the prediction result fusion matrix to obtain the matrix to be decoded;
[0146] The matrix to be decoded is decoded back to the original space of historical data of multiple meteorological elements through a decoder to obtain the prediction results of multiple meteorological elements.
[0147] It should be noted that the specific implementation of steps 601-605 is Figure 3-Figure 5 The embodiments shown have been described above and can achieve the same or similar beneficial effects.
[0148] The method of the embodiment of the present application is described above, and the device of the embodiment of the present application is provided below.
[0149] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a meteorological element prediction device provided in an embodiment of the present application. Figure 7 As shown, the device includes an acquisition unit 701 and a processing unit 702; wherein:
[0150] An acquisition unit 701 is used to acquire historical data of multiple meteorological elements in a region;
[0151] The processing unit 702 is used to encode the historical data of multiple meteorological elements to obtain a first matrix that characterizes the coupling relationship between the multiple meteorological elements; the column data or row data of the first matrix is processed in parallel by the constructed multi-head attention prediction module to obtain the prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the column data of the first matrix; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the row data of the first matrix; the prediction result based on the multi-head attention prediction module is decoded to obtain the prediction results of multiple meteorological elements.
[0152] Exemplarily, in encoding the historical data of multiple meteorological elements to obtain a first matrix representing the coupling relationship between the multiple meteorological elements, the processing unit 702 is specifically configured to:
[0153] The historical data of multiple meteorological elements are patch-embedded by an encoder to obtain a second matrix representing the coupling relationship between the multiple meteorological elements;
[0154] The second matrix is sparsely constrained to obtain the first matrix.
[0155] Exemplarily, each attention prediction module includes multiple fusion feature extraction modules, each fusion feature extraction module includes a Koopman operator; the input of the i-th fusion feature extraction module among the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; wherein i is greater than 1.
[0156] Exemplarily, in terms of performing parallel processing on the column data or row data of the first matrix by constructing the multi-head attention prediction module to obtain the prediction result of the multi-head attention prediction module, the processing unit 702 is specifically used to:
[0157] In parallel, the following operations are performed in each attention prediction module:
[0158] For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features;
[0159] The low-frequency features are input into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain the initial prediction result;
[0160] Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and,
[0161] Perform convolution on the input data to obtain the corresponding high-frequency features;
[0162] The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module;
[0163] After being processed by multiple fusion feature extraction modules, the prediction results of each attention prediction module are obtained;
[0164] Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
[0165] Exemplarily, in decoding the prediction results based on the multi-head attention prediction module to obtain the prediction results of multiple meteorological elements, the processing unit 702 is specifically used to:
[0166] Obtaining a third matrix representing the coupling relationship between multiple meteorological elements;
[0167] Based on the third matrix, the prediction results of the multi-head attention prediction module are coupled to obtain a prediction result fusion matrix;
[0168] Perform sparse constraints on the prediction result fusion matrix to obtain the matrix to be decoded;
[0169] The matrix to be decoded is decoded back to the original space of historical data of multiple meteorological elements through a decoder to obtain the prediction results of multiple meteorological elements.
[0170] Exemplarily, the Koopman operator in each fusion feature extraction module is dynamically iterated according to a set number of iterations.
[0171] It can be seen that in Figure 7 In the device shown, the prediction tasks of multiple meteorological elements are processed in parallel through the constructed multi-head attention prediction module, which is conducive to reducing the difficulty of engineering deployment in real scenes, and is suitable for describing the complex dynamics of multiple meteorological elements in the medium and long term, and improves the prediction efficiency of multiple meteorological elements with a parallel acceleration architecture. In addition, the multi-head attention prediction module analyzes and predicts the coupling relationship between each meteorological element, which significantly improves the accuracy of meteorological element prediction. The framework of the multi-head attention prediction module can capture the nonlinear relationship between meteorological elements, which is more suitable for real scenes with complex terrain and chaotic effects in the meteorological system, and can support high-precision meteorological forecasts.
[0172] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides an electronic device. Figure 8 , Figure 8A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device at least includes a processor 801, a memory 802, an input device 803 and an output device 804, and one or more programs, one or more programs are stored in the memory 802, and the various parts are interconnected through a bus or other means, wherein the input device 803 and the output device 804 can be the same device, the input device 803 can be used to receive user input (such as: trigger event), and the output device 804 can be used to output the interface rendered by the electronic device. Among them, the input device 803 can be a keyboard, a touch screen, a radio frequency receiver, etc.; the output device 804 can be a speaker, a display, a radio frequency transmitter, etc. Figure 8 Each unit shown may be implemented by the processor 801 , memory 802 , input device 803 , and output device 804 described above.
[0173] The memory 802 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), and is used to store relevant computer programs and data.
[0174] The processor 801 may be one or more central processing units (CPUs). When the processor 801 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
[0175] The processor 801 in the electronic device is used to read one or more programs stored in the memory 802 and perform the following operations:
[0176] Obtain historical data of multiple meteorological elements in the region;
[0177] Encoding historical data of multiple meteorological elements to obtain a first matrix representing a coupling relationship between the multiple meteorological elements;
[0178] The column data or row data of the first matrix is processed in parallel by the constructed multi-head attention prediction module to obtain the prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the column data of the first matrix one by one; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the row data of the first matrix one by one;
[0179] The prediction results of the multi-head attention prediction module are decoded to obtain the prediction results of multiple meteorological elements.
[0180] In a possible implementation, the processor 801 performs encoding of historical data of multiple meteorological elements to obtain a first matrix representing a coupling relationship between the multiple meteorological elements, including:
[0181] The historical data of multiple meteorological elements are patch-embedded by an encoder to obtain a second matrix representing the coupling relationship between the multiple meteorological elements;
[0182] The second matrix is sparsely constrained to obtain the first matrix.
[0183] In a possible implementation, each attention prediction module includes multiple fusion feature extraction modules, each fusion feature extraction module includes a Koopman operator; the input of the i-th fusion feature extraction module among the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; wherein i is greater than 1.
[0184] In a possible implementation, the processor 801 executes parallel processing of column data or row data of the first matrix by the constructed multi-head attention prediction module to obtain a prediction result of the multi-head attention prediction module, including:
[0185] In parallel, the following operations are performed in each attention prediction module:
[0186] For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features;
[0187] The low-frequency features are input into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain the initial prediction result;
[0188] Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and,
[0189] Perform convolution on the input data to obtain the corresponding high-frequency features;
[0190] The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module;
[0191] After being processed by multiple fusion feature extraction modules, the prediction results of each attention prediction module are obtained;
[0192] Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
[0193] In a possible implementation, the processor 801 performs decoding based on the prediction result of the multi-head attention prediction module to obtain the prediction results of multiple meteorological elements, including:
[0194] Obtaining a third matrix representing the coupling relationship between multiple meteorological elements;
[0195] Based on the third matrix, the prediction results of the multi-head attention prediction module are coupled to obtain a prediction result fusion matrix;
[0196] Perform sparse constraints on the prediction result fusion matrix to obtain the matrix to be decoded;
[0197] The matrix to be decoded is decoded back to the original space of historical data of multiple meteorological elements through a decoder to obtain the prediction results of multiple meteorological elements.
[0198] In a possible implementation, the Koopman operator in each fusion feature extraction module is dynamically iterated according to a set number of iterations.
[0199] It can be seen that in Figure 8 In the electronic device shown, the multi-head attention prediction module is constructed to process the prediction tasks of multiple meteorological elements in parallel, which is conducive to reducing the difficulty of engineering deployment in real scenes. It is suitable for describing the complex dynamics of multiple meteorological elements in the medium and long term, and improves the prediction efficiency of multiple meteorological elements with a parallel acceleration architecture. In addition, the multi-head attention prediction module analyzes and predicts the coupling relationship between each meteorological element, which significantly improves the accuracy of meteorological element prediction. The electronic device can capture the nonlinear relationship between meteorological elements through the framework of the multi-head attention prediction module, which is more suitable for real scenes with complex terrain and chaotic effects in the meteorological system, and can support high-precision meteorological forecasts.
[0200] It should be noted that the implementation of each operation can also refer to Figure 3 or Figure 6 The corresponding description of the method of any one of the embodiments shown.
[0201] It should be noted that although Figure 8The electronic device shown only shows a processor 801, a memory 802, an input device 803, and an output device 804. However, in the specific implementation process, those skilled in the art should understand that the electronic device also includes other devices necessary for normal operation, such as: memory, power supply, application client module, etc. At the same time, according to specific needs, those skilled in the art should understand that the electronic device may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the electronic device may also include only the devices necessary for implementing the embodiments of the present application, and does not necessarily include Figure 8 All devices shown in .
[0202] The present application also provides a chip, including: a processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the above-mentioned Figure 3 or Figure 6 The method according to any one of the embodiments. The chip may be a chip in an electronic device.
[0203] The present application also provides a computer-readable storage medium (Memory), which stores a computer program. When the computer program is executed, the above-mentioned Figure 3 or Figure 6 The method described in any one of the embodiments. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the device and the extended storage medium supported by the device. The computer-readable storage medium provides a storage space, which stores the operating system of the device. In addition, one or more computer programs suitable for being loaded and executed by the processor of the device are also stored in the storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0204] The present application also provides a computer program product, which includes: a computer program code. When the computer program code is executed by an electronic device, Figure 3 or Figure 6 The method process described in any one of the embodiments is implemented.
[0205] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0206] It should be understood that the processor mentioned in the embodiments of the present application may be a CPU, or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0207] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a ROM, a programmable read-only memory (Programmable ROM, PROM), an EPROM, an electrically erasable programmable read-only memory (ElectricallyEPROM, EEPROM) or a flash memory. The volatile memory may be a RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
[0208] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) is integrated in the processor.
[0209] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0210] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0211] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely exemplary. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0212] 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
[0214] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the text description of this application, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0215] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0216] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0217] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for predicting meteorological elements, characterized in that: The method comprises: Obtain historical data of multiple meteorological elements in the region; Encoding the historical data of the plurality of meteorological elements to obtain a first matrix representing the coupling relationship between the plurality of meteorological elements; The multi-head attention prediction module is constructed to process the column data or row data of the first matrix in parallel to obtain the prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the column data of the first matrix one by one; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds to the row data of the first matrix one by one; Decoding is performed based on the prediction results of the multi-head attention prediction module to obtain the prediction results of the multiple meteorological elements.
2. The method according to claim 1, characterized in that The encoding of the historical data of the plurality of meteorological elements to obtain a first matrix representing the coupling relationship between the plurality of meteorological elements includes: Performing patch embedding on the historical data of the plurality of meteorological elements through an encoder to obtain a second matrix representing the coupling relationship between the plurality of meteorological elements; Perform sparse constraint on the second matrix to obtain the first matrix.
3. The method according to claim 1 or 2, characterized in that: Each attention prediction module includes multiple fusion feature extraction modules, each of which includes a Koopman operator; the input of the i-th fusion feature extraction module among the multiple fusion feature extraction modules is the output of the (i-1)th fusion feature extraction module; wherein i is greater than 1.
4. The method according to claim 3, characterized in that The constructed multi-head attention prediction module performs parallel processing on the column data or row data of the first matrix to obtain a prediction result of the multi-head attention prediction module, including: In parallel, the following operations are performed in each attention prediction module: For the i-th fusion feature extraction module, a truncated Fourier transform is performed on the input data to obtain the corresponding low-frequency features; Inputting the low-frequency features into the Koopman operator in the i-th fusion feature extraction module for dynamic iteration to obtain an initial prediction result; Performing an inverse Fourier transform on the initial prediction result to map the initial prediction result back to the observation space to obtain an inverse Fourier transformed prediction result; and, Perform convolution on the input data to obtain the corresponding high-frequency features; The prediction result after inverse Fourier transformation is fused with the high-frequency feature to obtain the high- and low-frequency fusion feature output by the i-th fusion feature extraction module; After being processed by the multiple fusion feature extraction modules, a prediction result of each attention prediction module is obtained; Among them, when i is equal to 1, the input data is the column data or row data of the first matrix; the high- and low-frequency fusion features output by the last fusion feature extraction module in each attention prediction module are the prediction results of the attention prediction module.
5. The method according to any one of claims 1 to 4, characterized in that: The prediction results based on the multi-head attention prediction module are decoded to obtain the prediction results of the multiple meteorological elements, including: Acquire a third matrix representing the coupling relationship between the plurality of meteorological elements; Based on the third matrix, the prediction results of the multi-head attention prediction module are coupled to obtain a prediction result fusion matrix; Performing sparse constraints on the prediction result fusion matrix to obtain a matrix to be decoded; The matrix to be decoded is decoded back to the original space of the historical data of the multiple meteorological elements by a decoder to obtain the prediction results of the multiple meteorological elements.
6. The method according to claim 4, characterized in that The Koopman operator in each of the fusion feature extraction modules is dynamically iterated according to a set number of iterations.
7. A meteorological element prediction device, characterized in that: The device comprises an acquisition unit and a processing unit; The acquisition unit is used to acquire historical data of multiple meteorological elements in the area; The processing unit is used to encode the historical data of the plurality of meteorological elements to obtain a first matrix representing the coupling relationship between the plurality of meteorological elements; The column data or row data of the first matrix is processed in parallel by the constructed multi-head attention prediction module to obtain the prediction result of the multi-head attention prediction module; wherein, when the column data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the column data of the first matrix; when the row data of the first matrix is processed in parallel, the multi-head attention prediction module corresponds one-to-one to the row data of the first matrix; decoding is performed based on the prediction result of the multi-head attention prediction module to obtain the prediction results of the multiple meteorological elements.
8. An electronic device, characterized in that: The system comprises a processor, a memory, and one or more programs, wherein the processor is connected to the memory, the one or more programs are stored in the memory, and are configured to implement the method according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for execution by a device, and when the computer program is executed, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that When the computer program product is run by an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 6.
Citation Information
Cited By
Physical information guidance artificial intelligence weather forecast method and device for wind power plant
CN121522781A