Target file generation method and device, equipment, medium and product
By extracting necessary meteorological variables and data from the original meteorological data according to business needs and generating target files suitable for WRF, the problem of low processing efficiency caused by the large size of the GFS downloaded grib2 file is solved, and more efficient file processing is achieved.
Patent Information
- Application Number
- CN202411845838.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-13
AI Technical Summary
GFS downloaded grib2 files are large in size, resulting in less efficient use of WRF to process grib2 files.
Generate target files according to business needs, and by obtaining necessary meteorological variables in the original meteorological data, extracting latitude and longitude grid data of the target area and target resolution, and extracting data from multiple moments at time intervals to generate a background field file suitable for WRF.
Reduces useless data in the target file, reduces file size, and improves the efficiency of the pre-processing system in WRF processing target files.
Smart Images

Figure CN119623451A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of meteorology, and in particular to a method, device, equipment, medium and product for generating a target file. Background Art
[0002] The forecast data of the Global Forecast System (GFS) is widely used in numerical weather forecasting and is one of the important global meteorological data. Currently, GFS provides free download of global forecast data with a resolution of 0.25 degrees, 0.5 degrees and 1.0 degrees. The download file format is grib2.
[0003] The Weather Research and Forecasting Model (WRF) is a numerical weather forecast model that can be used to generate the background field required for numerical weather forecasting. The main data source for WRF to generate the background field is GFS, but the grib2 file downloaded from GFS is large in size, which contains data corresponding to more than 700 meteorological variables, resulting in low efficiency in processing grib2 files using WRF. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, medium and product for generating a target file, so as to solve the problem that the grib2 file downloaded by GFS is large in size, resulting in low efficiency in processing the grib2 file using WRF.
[0005] In a first aspect, the present application provides a method for generating a target file, comprising:
[0006] Acquire original meteorological data, wherein the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions, and the multiple target meteorological variables are meteorological variables required by WRF to generate a background field;
[0007] Acquiring business requirements, wherein the business requirements include a target area, a target resolution, and a time interval;
[0008] Acquiring surface potential data and land and sea distribution data of the target area;
[0009] According to the target area and the target resolution, extracting latitude and longitude grid data corresponding to a plurality of target meteorological variables from the original meteorological data;
[0010] According to the time intervals, extracting data corresponding to multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data, and the land and sea distribution data, to obtain array files corresponding to the multiple moments;
[0011] Generate a target file according to the array files corresponding to the multiple moments;
[0012] The target file is output, and the target file is used to generate the background field in the WRF.
[0013] In this embodiment, the target file is generated based on business needs, and the target meteorological variables included in the original meteorological data are the meteorological variables required for WRF to generate the background field. For example, there are only 133 target meteorological variables, which makes the target file contain less useless data. Compared with the target file provided by GFS, the data volume is smaller, which can improve the efficiency of the pre-processing system in WRF in processing the target file.
[0014] Optionally, the method as described above, generating a target file according to the array files corresponding to the multiple moments, includes:
[0015] Obtaining a template file corresponding to the target file;
[0016] The array files corresponding to the multiple moments are compressed according to the encoding method corresponding to the template file to obtain multiple compressed array files; and the multiple compressed array files are written into the template file to generate the target file.
[0017] In this embodiment, data can be written into the template file to generate a target file, which can improve processing efficiency and generate a file that is compatible with the background field generated by WRF.
[0018] Optionally, in the method described above, the multiple target meteorological variables in the template file are sorted in the order required by the WRF to generate the background field; the multiple target meteorological variables are consistent with the order of the multiple target meteorological variables in the template file;
[0019] Compressing the array files corresponding to the multiple moments according to the encoding method corresponding to the template file to obtain multiple compressed array files; and writing the multiple compressed array files into the template file to generate the target file, including:
[0020] Based on the sorting of the multiple target meteorological variables, compressing the target meteorological variables in the array files corresponding to each moment in sequence according to the encoding method to obtain compressed array files corresponding to the multiple moments;
[0021] According to the order of the plurality of target meteorological variables, the target meteorological variables in the compressed array file corresponding to each moment are sequentially written into the template file to generate the target file.
[0022] In this embodiment, the variables in the text template file are written in order to avoid writing errors, thereby improving the accuracy of the target file.
[0023] Optionally, in the method described above, obtaining the template file corresponding to the target file includes:
[0024] Get the sample forecast file of Global Forecast System GFS;
[0025] Extracting the grid format and meteorological variables extracted from the forecast file sample to obtain a first output file;
[0026] Based on the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids, the first output file is updated to obtain a second output file;
[0027] Based on the second output file, extract the multiple target meteorological variables from the forecast file sample to obtain files corresponding to the multiple target meteorological variables;
[0028] The files corresponding to the multiple target meteorological variables are merged to obtain the template file.
[0029] In this embodiment, since GFS is a common data source for WRF to generate background fields, a template file can be generated according to the forecast file sample of GFS to generate the target file required for WRF to generate background fields.
[0030] Optionally, the method as described above, according to the time intervals, extracting data corresponding to multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data, and the land and sea distribution data, to obtain array files corresponding to the multiple moments, includes:
[0031] Based on the sorting of the multiple target meteorological variables, extracting meteorological data corresponding to the multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables in sequence according to the time intervals;
[0032] Extracting geographic data corresponding to the multiple moments from the surface potential data and the land-sea distribution data respectively according to the time intervals;
[0033] The array files corresponding to the multiple moments are determined according to the meteorological data corresponding to the multiple moments and the geographical data corresponding to the multiple moments.
[0034] In this embodiment, data is extracted according to the order of variables in the text template file, thereby generating an ordered array file, which is convenient for subsequent writing into the template file.
[0035] Optionally, the method as described above, extracting latitude and longitude grid data corresponding to a plurality of target meteorological variables from the original meteorological data according to the target area and the target resolution, comprises:
[0036] Divide the longitude and latitude intervals corresponding to the target area according to the target resolution, and generate a remapping file corresponding to the target area, wherein the remapping file is used to represent a plurality of longitude and latitude grid points divided by the target area;
[0037] According to the remapping file, the data of each target meteorological variable in the multiple longitude and latitude grid points are determined from the original meteorological data to obtain the longitude and latitude grid data corresponding to the multiple target meteorological variables.
[0038] In this embodiment, the target area can be first divided according to the target resolution to obtain a remapping file corresponding to the latitude and longitude grid of the target area, and then the data of multiple target meteorological variables in multiple longitude and latitude grids can be determined in the original data based on the remapping file to improve processing efficiency.
[0039] In a second aspect, the present application provides a device for generating a target file, comprising:
[0040] A first acquisition module is used to acquire original meteorological data, wherein the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions, and the multiple target meteorological variables are meteorological variables required by WRF to generate a background field;
[0041] A second acquisition module is used to acquire business requirements, wherein the business requirements include a target area, a target resolution and a time interval;
[0042] A third acquisition module is used to acquire surface potential data and land and sea distribution data of the target area;
[0043] A first processing module, configured to extract latitude and longitude grid data corresponding to a plurality of target meteorological variables from the original meteorological data according to the target area and the target resolution;
[0044] A second processing module is used to extract data corresponding to multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data and the land and sea distribution data according to the time intervals, and obtain array files corresponding to the multiple moments;
[0045] A generating module, used for generating a target file according to the array files corresponding to the plurality of moments;
[0046] An output module is used to output the target file, and the target file is used to generate a background field in the WRF.
[0047] Optionally, in the above device, the generating module is specifically used for:
[0048] Obtaining a template file corresponding to the target file;
[0049] The array files corresponding to the multiple moments are compressed according to the encoding method corresponding to the template file to obtain compressed array files corresponding to the multiple moments; and the compressed array files corresponding to the multiple moments are written into the template file to generate the target file.
[0050] Optionally, in the above device, the multiple target meteorological variables in the template file are sorted in the order required by the WRF to generate the background field; the multiple target meteorological variables are consistent with the order of the multiple target meteorological variables in the template file;
[0051] The generation module is specifically used for:
[0052] Based on the sorting of the multiple target meteorological variables, compressing the target meteorological variables in the array files corresponding to each moment in sequence according to the encoding method to obtain compressed array files corresponding to the multiple moments;
[0053] According to the order of the plurality of target meteorological variables, the target meteorological variables in the compressed array file corresponding to each moment are sequentially written into the template file to generate the target file.
[0054] Optionally, in the above device, the generating module is specifically used for:
[0055] Get the sample forecast file of Global Forecast System GFS;
[0056] Extracting the grid format and meteorological variables extracted from the forecast file sample to obtain a first output file;
[0057] Based on the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids, the first output file is updated to obtain a second output file;
[0058] Based on the second output file, extract the multiple target meteorological variables from the forecast file sample to obtain files corresponding to the multiple target meteorological variables;
[0059] The files corresponding to the multiple target meteorological variables are merged to obtain the template file.
[0060] Optionally, in the above device, the second processing module is specifically used for:
[0061] Based on the sorting of the multiple target meteorological variables, extracting meteorological data corresponding to the multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables in sequence according to the time intervals;
[0062] Extracting geographic data corresponding to the multiple moments from the surface potential data and the land-sea distribution data respectively according to the time intervals;
[0063] The array files corresponding to the multiple moments are determined according to the meteorological data corresponding to the multiple moments and the geographical data corresponding to the multiple moments.
[0064] Optionally, in the above device, the first processing module is specifically used for:
[0065] Divide the longitude and latitude intervals corresponding to the target area according to the target resolution, and generate a remapping file corresponding to the target area, wherein the remapping file is used to represent a plurality of longitude and latitude grid points divided by the target area;
[0066] According to the remapping file, the data of each target meteorological variable in the multiple longitude and latitude grid points are determined from the original meteorological data to obtain the longitude and latitude grid data corresponding to the multiple target meteorological variables.
[0067] The target file generation device provided in the embodiment of the present application can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be repeated here.
[0068] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0069] The memory stores computer-executable instructions;
[0070] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.
[0071] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer, they are used to implement the method described in the first aspect.
[0072] The computer-readable storage medium provided in the embodiment of the present application can execute the technical solution in the above method embodiment, and its beneficial effects are similar, which will not be repeated here.
[0073] In a fifth aspect, the present application provides a computer program product, including a computer program, which is used to implement the method described in the first aspect when executed by a computer.
[0074] The computer program product provided in the embodiment of the present application can execute the technical solution in the above method embodiment, and its beneficial effects are similar and will not be described in detail here.
[0075] The present application provides a method, device, equipment, medium and product for generating a target file, which extracts latitude and longitude grid data corresponding to multiple target meteorological variables from the original meteorological data according to the target area and target resolution in the business requirements; and extracts data corresponding to multiple moments from the latitude and longitude grid data corresponding to multiple target meteorological variables, the surface potential data of the target area and the land and sea distribution data according to the time interval in the business requirements, and obtains array files corresponding to multiple moments. Then, a target file is generated according to the array files corresponding to the multiple moments, and the target file is output, and the target file is used to generate a background field in WRF. In an embodiment of the present application, the target file is generated based on business requirements, and the target meteorological variables included in the original meteorological data are meteorological variables necessary for WRF to generate a background field, so that there are fewer useless data in the target file, and the data volume of the target file provided by GFS is smaller, which can improve the efficiency of the pre-processing system in WRF in processing the target file. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0077] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0078] Figure 2 A flowchart of a method for generating a target file provided in an embodiment of the present application;
[0079] Figure 3 A flowchart of another method for generating a target file provided in an embodiment of the present application;
[0080] Figure 4 A flowchart of another method for generating a target file provided in an embodiment of the present application;
[0081] Figure 5 A flowchart of another method for generating a target file provided in an embodiment of the present application;
[0082] Figure 6 A schematic diagram of a flow chart of a method for generating a background field based on a target file provided in an embodiment of the present application;
[0083] Figure 7 A schematic diagram of the structure of a device for generating a target file provided in an embodiment of the present application;
[0084] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0085] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0086] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0087] The grib2 file output by GFS is the main data source for WRF to generate the background field. Taking the resolution of 0.25 degrees as an example, the file size at each moment can reach 515MB, which contains data corresponding to more than 700 meteorological variables. If you want to download the meteorological data for the next 240 hours at a time interval of 6 hours, the total amount of data can reach 20.06GB.
[0088] To reduce the data volume, a lower resolution (e.g. 0.5 degrees) and a larger time interval can be chosen, but this will reduce the accuracy of the data.
[0089] Since most of the meteorological variables included in the grib2 file output by GFS are not required by WRF to generate the background field, this will result in a large amount of useless data in the GFS data. This data not only takes up storage space, but also leads to low efficiency in WRF processing of grib2 files.
[0090] Therefore, the present application provides a method for generating a target file, which can generate the original meteorological data of the target meteorological variables required for the background field based on WRF, and then generate the target file according to business needs, wherein the target file refers to a file in grib2 format. In an embodiment of the present application, the target file is generated based on business needs, and the target meteorological variables included in the original meteorological data are the meteorological variables required when WRF generates the background field, for example, there are only 133 target meteorological variables, so that there are less useless data in the target file, and the data volume of the target file provided by GFS is smaller, which can improve the efficiency of the pre-processing system in WRF in processing the target file.
[0091] In a possible implementation, the following is combined Figure 1 , the application scenarios to which the embodiments of the present application are applicable are described.
[0092] Figure 1A schematic diagram of an application scenario provided in an embodiment of the present application, such as Figure 1 As shown, the meteorological model 101 can be used to generate raw meteorological data, and based on the raw meteorological data, a target file is generated for outputting to WRF102 a background field required for generating weather forecast. The background field refers to the initial state or initial condition used to initialize the weather forecast model. It is usually obtained by combining the previous forecast results (such as the forecast of the previous time step) with observation data (such as ground observations, satellite observations, radar data, etc.). The background field provides a rough and continuous meteorological state as the starting point for the weather forecast model to make the next forecast.
[0093] In one possible implementation, meteorological model 101 can generate meteorological data for a spherical cube grid, dividing the globe into six regions, effectively resolving the theoretical bottleneck of the North Pole and South Pole convergence. Through a more uniform grid distribution, the super computing power of modern large-scale parallel computing supercomputers can be maximized, and the weather process at any location in the world can be more accurately simulated on the basis of more efficient computing load balancing.
[0094] WRF102 is an open source numerical model for weather research and forecasting. As a unified meteorological model, it is widely used in weather forecasting, climate simulation, disaster warning and other fields, providing important support for meteorological research and applications. WRF102 can be used to generate the required background field to provide different models with different business functions, such as air quality models.
[0095] Among them, WRF102 can define the simulation area and grid through the preprocessing system (WRF preprocessing system, WPS) in WRF102, and extract meteorological data, such as the above-mentioned target file, from the meteorological model 101. WRF102 can read the target file through the real module in WRF102, and generate a corresponding background field according to the target file.
[0096] The meteorological variables required for the background field generated by WRF102 may be, for example, 135, including surface potential and land-sea distribution, because these two variables are fixed geographical data and do not change with time. The meteorological model 101 may output meteorological data with 135 meteorological variables and generate a smaller target file based on these data.
[0097] In a possible implementation, the meteorological model 101 can be deployed on a first server, and the WRF 102 can be deployed on a second server. The first server and the second server can communicate via the Internet, so that the WRF 102 can obtain the target file generated by the meteorological model 101.
[0098] In a possible implementation, the meteorological model 101 and the WRF 102 may be deployed on the same server, that is, the server may be used to generate the target file, and may also be used to generate the background field according to the target file.
[0099] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0100] Figure 2 A flowchart of a method for generating a target file provided in an embodiment of the present application, the method can be executed by a device for generating a target file, and the device for generating a target file can be implemented by a computer program; it can also be implemented by a medium storing relevant computer programs, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with relevant computer programs, such as a chip or electronic device. The electronic device can be a server, a server cluster, a terminal device such as a computer, etc. The following takes a server as an example, Figure 2 As shown, the method may include the following steps.
[0101] S201. Acquire original meteorological data, where the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions, and the multiple target meteorological variables are meteorological variables required by WRF to generate a background field.
[0102] The meteorological variables required by WRF to generate background fields include pressure layer variables, ground layer variables, and soil layer variables:
[0103] Among them, the pressure layer variables can include: air temperature, zonal wind, radial wind, potential height and relative humidity corresponding to 23 pressure layers, that is, the pressure layer variables can include 5×25 (i.e. 115) variables.
[0104] Exemplarily, the 23 pressure layers include 50 hPa, 70 hPa, 100 hPa, 150 hPa, 200 hPa, 250 hPa, 300 hPa, 350 hPa, 400 hPa, 450 hPa, 500 hPa, 550 hPa, 600 hPa, 650 hPa, 700 hPa, 750 hPa, 800 hPa, 850 hPa, 900 hPa, 925 hPa, 950 hPa, 975 hPa and 1000 hPa, respectively. That is to say, the data of the 18 pressure layers below 50 hPa are useless data and are not used in this application as necessary meteorological variables required to generate the target file.
[0105] The ground layer variables include surface air pressure, sea level pressure, surface air temperature, air temperature at 2 meters, relative humidity (or water vapor mixing ratio) at 2 meters, 10-meter zonal wind, 10-meter radial wind, sea ice distribution ratio, surface snow depth, surface snow water equivalent and physical snow depth, a total of 12 variables. The ground layer variables also include surface potential height and sea and land distribution. These two variables can be regarded as fixed physical data and generally do not change with time.
[0106] The soil layer variables include soil moisture and soil temperature at four different depth ranges, i.e., eight variables.
[0107] Exemplarily, the four different depth ranges may include 0 cm~10 cm, 10 cm~40 cm, 40 cm~100 cm, and 100 cm~200 cm.
[0108] From the above, we can see that the number of target meteorological variables can be 135, of which 133 target meteorological variables are variables that change with time, and the surface potential height and sea-land distribution generally do not change with time.
[0109] For example, the raw meteorological data may be Figure 1 The output of the weather model 101 is shown.
[0110] In one possible implementation, the variable output table of the meteorological model 101 can be used to output meteorological data corresponding to meteorological variables that change over time. Then the variable output table may include the above 133 variables to output data corresponding to the above 133 target meteorological variables.
[0111] S202: Obtain business requirements, which include a target area, a target resolution, and a time interval.
[0112] The server can obtain the business requirements for background field generation, including the target area, target resolution and time interval, wherein the target area can be, for example, a simulation area for weather forecast. Taking the study of typhoons in the northwest Pacific as an example, the target area can be 75 to 160 degrees east longitude and -10 to 60 degrees north latitude.
[0113] The target resolution refers to the size of the grid when the earth's surface can be divided into multiple grids. It can be understood that the target resolution is related to the number of grids, that is, the larger the target resolution, the smaller the number of grids. For example, if the target resolution is 0.25 degrees, it means that the earth's surface is divided into grids with an interval of 0.25 degrees between longitude and latitude, and each grid has a specific longitude and latitude coordinate. The server can obtain the data corresponding to each grid (including data corresponding to multiple target meteorological variables) according to the target resolution.
[0114] The time interval can be any value between 1 hour and 12 hours, for example, which means that data at corresponding times can be obtained from the original meteorological data according to the time interval, and data at corresponding times can be obtained according to actual business needs, without obtaining data at all times, thereby reducing the amount of data.
[0115] S203, obtaining surface potential data and land and sea distribution data of the target area.
[0116] After obtaining the business requirements, the server can obtain the surface potential data and land and sea distribution data of the target area according to the target area.
[0117] S204: extracting latitude and longitude grid data corresponding to a plurality of target meteorological variables from the original meteorological data according to the target area and the target resolution.
[0118] The server can extract latitude and longitude grid data corresponding to multiple target meteorological variables from the original meteorological data according to the target area and target resolution.
[0119] The latitude and longitude grid data includes data of multiple longitude and latitude grid points.
[0120] That is to say, the data extracted from the original meteorological data are data corresponding to multiple longitude and latitude grid points in the target area. For the data corresponding to each longitude and latitude grid point, the data includes meteorological data of multiple target meteorological variables at the longitude and latitude grid point. For any target meteorological variable, there is one meteorological data for the target meteorological variable at each longitude and latitude grid point.
[0121] It can be understood that, for the data corresponding to any longitude and latitude grid point, the data includes data of multiple target meteorological variables at multiple consecutive moments, that is, includes data of multiple target meteorological variables at each moment.
[0122] S205. According to time intervals, extract data corresponding to multiple time periods from the latitude and longitude grid data, surface potential data, and land and sea distribution data corresponding to multiple target meteorological variables to obtain array files corresponding to the multiple time periods.
[0123] The server may extract data corresponding to multiple time points from the data extracted in S204, the surface potential data, and the land-sea distribution data according to time intervals. Exemplarily, the multiple time points may be multiple hourly time points. For example, if the time interval is 3 hours, the server may extract data corresponding to 0 o'clock, 3 o'clock, 6 o'clock, 9 o'clock, 12 o'clock, 15 o'clock, 18 o'clock, 21 o'clock, and 24 o'clock from the data of multiple consecutive time points (i.e., the data extracted in S204, the surface potential data, and the land-sea distribution data) every 3 hours.
[0124] In a possible implementation, the business requirement may further include a target time length, which may be, for example, 50 days or any value less than 50 days, and the server may obtain data at multiple times of each day in the target time length.
[0125] After the server extracts the data corresponding to multiple moments, the array files corresponding to the multiple moments can be obtained. For ease of understanding, the array files corresponding to the multiple moments can be represented in the form of Table 1. Table 1 only shows the data of moment 1 and moment 2, and the data of other moments are similar. In Table 1, A to W represent different values.
[0126] In a possible implementation, when the multiple target meteorological variables in the template file are sorted in the order required by WRF to generate the background field, and the order of the multiple target meteorological variables is consistent with the order of the multiple target meteorological variables in the template file, the server can determine the array files corresponding to the multiple moments in the following manner:
[0127] The server can sort multiple target meteorological variables and extract meteorological data corresponding to multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables in turn according to time intervals. And according to the time intervals, the server can extract geographical data corresponding to multiple moments from the surface potential data and the sea and land distribution data respectively. Then, according to the meteorological data corresponding to the multiple moments and the geographical data corresponding to the multiple moments, the array files corresponding to the multiple moments are determined.
[0128] Table 1
[0129]
[0130] In one possible implementation, since the surface potential data and the land and sea distribution data generally do not change with time, the server can use the surface potential data and the land and sea distribution data as geographic data corresponding to multiple time periods, that is, the surface potential data and the land and sea distribution data corresponding to multiple time periods are the same.
[0131] In this embodiment, the server extracts data according to the order of variables in the text template file, thereby generating an ordered array file to facilitate subsequent writing into the template file.
[0132] S206: Generate a target file according to the array files corresponding to the multiple time points.
[0133] After the server obtains the array files corresponding to the multiple time points, it can generate the target file according to the array files corresponding to the multiple time points.
[0134] Exemplarily, the server generates a target file according to the array files corresponding to multiple moments in time by, for example, generating the target file based on the template file corresponding to the target file. The target file is a file in grib2 format. The template file is a file in grib2 format. Exemplarily, the template file can be generated according to a forecast file sample in grib2 format, then the multiple target meteorological variables in the target file are in one-to-one correspondence with the meteorological variables in the template file and the meteorological variables required for WRF to generate the background field, that is, the order and quantity of the meteorological variables are consistent.
[0135] S207. Output a target file, where the target file is used to generate a background field in WRF.
[0136] After the server generates the target file, it can output the target file, which can be used to generate the background field in WRF. Figure 1 In the scenario shown, the meteorological model 101 can output a target file, and the pre-processing system in the WRF 102 can read the target file to generate a background field.
[0137] In this embodiment, the latitude and longitude grid data corresponding to multiple target meteorological variables can be extracted from the original meteorological data according to the target area and target resolution in the business requirements; and according to the time interval in the business requirements, the data corresponding to multiple moments are extracted from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data of the target area, and the sea and land distribution data, to obtain array files corresponding to multiple moments. Then, a target file is generated according to the array files corresponding to the multiple moments, and the target file is output. The target file is used to generate a background field in WRF. In an embodiment of the present application, the target file is generated based on business requirements, and the target meteorological variables included in the original meteorological data are meteorological variables necessary for WRF to generate a background field. For example, there are only 133 target meteorological variables, so that there are fewer useless data in the target file, and the data volume of the target file provided by GFS is smaller, which can improve the efficiency of the WRF pre-processing system in processing the target file.
[0138] Next, it is explained how to generate a target file based on array files corresponding to multiple time points.
[0139] Figure 3A flowchart of another method for generating a target file provided in an embodiment of the present application, the method can be executed by a device for generating a target file, and the device for generating a target file can be implemented by a computer program; it can also be implemented by a medium storing relevant computer programs, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with relevant computer programs, such as a chip or electronic device. The electronic device can be a server, a server cluster, a terminal device such as a computer, etc. The following takes a server as an example. Figure 3 As shown, the method may include the following steps.
[0140] S301, obtaining a template file corresponding to a target file.
[0141] The server may obtain a template file corresponding to the target file. For example, the template file may be generated based on a forecast file sample in the grib2 format downloaded from GFS. The forecast file sample may include data corresponding to multiple meteorological variables at non-zero times.
[0142] S302, compressing array files corresponding to multiple time points according to the encoding method corresponding to the template file to obtain multiple compressed array files, and writing the multiple compressed array files into the template file to generate a target file.
[0143] The server can compress the array files corresponding to the multiple moments according to the encoding method corresponding to the template file to obtain multiple compressed array files. For example, the encoding method can be the grib2 encoding method. After compressing the array files corresponding to the multiple moments, the multiple compressed array files are written into the template file to generate the target file, which can reduce the size of the target file and facilitate outputting the file in the required format to WRF.
[0144] In a possible implementation, the multiple target meteorological variables in the template file are sorted in the order required by WRF to generate the background field; the multiple target meteorological variables are sorted in the same order as the multiple target meteorological variables in the template file. In other words, the multiple target meteorological variables in the target file are in a one-to-one correspondence with the meteorological variables in the template file and the meteorological variables required by WRF to generate the background field.
[0145] Based on the sorting of multiple target meteorological variables, the server can compress the target meteorological variables in the array file corresponding to each moment in accordance with the encoding method corresponding to the template file, and obtain the compressed array files corresponding to the multiple moments. Then, according to the sorting of multiple target meteorological variables, the target meteorological variables in the compressed array file corresponding to each moment are written into the template file in order to generate the target file. The server writes in the order of variables in the template file to avoid writing errors and improve the accuracy of the target file.
[0146] In this embodiment, the array files corresponding to multiple moments can be compressed according to the encoding method corresponding to the template file, and then the compressed array files can be written into the template file of the target file to generate the target file, which can improve the processing efficiency and generate a file adapted to the background field generated by WRF.
[0147] Next, how to generate a template file for the target file is described.
[0148] Figure 4 A flowchart of another method for generating a target file provided in an embodiment of the present application, the method can be executed by a device for generating a target file, and the device for generating a target file can be implemented by a computer program; it can also be implemented by a medium storing relevant computer programs, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with relevant computer programs, such as a chip or electronic device. The electronic device can be a server, a server cluster, a terminal device such as a computer, etc. The following takes a server as an example. Figure 4 As shown, the method may include the following steps.
[0149] S401. Obtain a sample of the GFS forecast file.
[0150] Exemplarily, the forecast file sample may include data corresponding to multiple meteorological variables at non-zero time points. Exemplarily, the forecast file sample downloaded based on GFS may include data corresponding to more than 700 meteorological variables.
[0151] S402: extracting the grid format and meteorological variables in the forecast file sample to obtain a first output file.
[0152] The server can extract the grid format and meteorological variables in the forecast file sample to obtain the first output file. Since GFS is a common data source for WRF to generate background fields, the format framework in the forecast file sample can be extracted so that a file in a format adapted to the WRF generated background field can be generated based on the format framework.
[0153] It can be understood that the first output file is a file in a format adapted to the background field generated by WRF, except that there are redundant meteorological variables in the meteorological variables in the first output file, and the initial values of the number of grids and longitude and latitude do not match the target area.
[0154] S403: Based on the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids, the first output file is updated to obtain a second output file.
[0155] The server may update the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids based on the first output file, thereby modifying the grid information of the first output file to obtain the second output file.
[0156] In a possible implementation, the server may update the first output file in response to the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids input by the user to obtain the second output file, wherein the number of grids may be determined according to the size of the target area and the target resolution.
[0157] It can be understood that the second output file is a file in a format adapted to the background field generated by WRF, and the number of grids and the starting values of longitude and latitude in the second output file are consistent with the target area, but there are redundant meteorological variables in the second output file.
[0158] S404. Based on the second output file, extract multiple target meteorological variables from the forecast file sample to obtain files corresponding to the multiple target meteorological variables.
[0159] After obtaining the second output file, the server can extract multiple target meteorological variables from the forecast file sample based on the second output file. That is, the server can extract multiple target meteorological variables from multiple meteorological variables in the forecast file sample based on multiple target meteorological variables, and generate a file corresponding to each target meteorological variable based on the second output file. That is, each target meteorological variable is generated.
[0160] Among them, each target meteorological variable corresponds to an independent grib2 file.
[0161] S405. Merge files corresponding to multiple target meteorological variables to obtain a template file.
[0162] After obtaining the files corresponding to the multiple target meteorological variables, the server may merge the files corresponding to the multiple target meteorological variables to obtain a template file, wherein the template file may include the sorting sequence numbers and corresponding variable names of the multiple target meteorological variables.
[0163] In this embodiment, since GFS is a common data source for WRF to generate background fields, a template file can be generated according to the forecast file sample of GFS to generate the target file required for WRF to generate background fields.
[0164] Next, S204 in the above embodiment is described.
[0165] Figure 5A flowchart of another method for generating a target file provided in an embodiment of the present application, the method can be executed by a device for generating a target file, and the device for generating a target file can be implemented by a computer program; it can also be implemented by a medium storing relevant computer programs, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with relevant computer programs, such as a chip or electronic device. The electronic device can be a server, a server cluster, a terminal device such as a computer, etc. The following takes a server as an example. Figure 5 As shown, the method may include the following steps.
[0166] S501. Divide the longitude and latitude intervals corresponding to the target area according to the target resolution, and generate a remapping file corresponding to the target area, where the remapping file is used to represent a plurality of longitude and latitude grid points of the target area.
[0167] The server may divide the longitude and latitude intervals corresponding to the target area according to the target resolution, and generate a remapping file of a plurality of longitude and latitude grid points for representing the division of the target area.
[0168] S502: According to the remapping file, determine the data of each target meteorological variable in multiple longitude and latitude grid points from the original meteorological data, and obtain the longitude and latitude grid data corresponding to the multiple target meteorological variables.
[0169] The server can determine the data of each target meteorological variable in multiple longitude and latitude grid points from the original meteorological data according to the remapping file.
[0170] Specifically, the server may calculate the data of each target meteorological variable in multiple longitude and latitude grid points in the remapping file according to the original meteorological data, that is, calculate the value corresponding to each target meteorological variable for each longitude and latitude grid point.
[0171] Exemplarily, the server may calculate the data of multiple longitude and latitude grid points of each target meteorological variable in the heavy impact file by an aggregation method or a downscaling method. Exemplarily, the aggregation method may be, for example, arithmetic mean, weighted mean or cumulative sum.
[0172] In this embodiment, the target area can be first divided according to the target resolution to obtain a remapping file corresponding to the latitude and longitude grid of the target area, and then the data of multiple target meteorological variables in multiple longitude and latitude grids can be extracted from the original data based on the remapping file to improve processing efficiency.
[0173] After obtaining the target file, the server can output the target file. The following describes how to generate a background field based on the target file.
[0174] The server can obtain the variable correspondence table of the original meteorological data, which includes multiple target meteorological variables arranged in order. Then the variable correspondence table is soft-linked to the WRF pre-processing system to identify multiple target meteorological variables in the target file and generate an intermediate format file. Then the target meteorological variables in the intermediate format file are horizontally interpolated to the simulation area grid in the pre-processing system, and the interpolated file is output. At this time, the stratification in the vertical direction remains unchanged. The interpolated file is interpolated in the vertical direction through WRF to generate a background field.
[0175] Among them, the configuration parameter of the vertical layer number when WRF interpolates the interpolated file in the vertical direction is 24 layers, including 23 vertical pressure layers and 1 surface layer (including the ground layer and the soil layer). The default top layer pressure in WRF can be 100 Pa, and the minimum pressure is 5000 Pa, that is, the data of other layers between 100 Pa and 5000 Pa can be excluded, thereby reducing the invalid calculation of some data.
[0176] For details, please refer to the steps of generating background fields by WRF in the related technology, which will not be described in detail here.
[0177] For ease of understanding, the following Figure 6 The overall flow of the method for generating the target file is described. Figure 6 A flow chart of a method for generating a background field based on a target file provided in an embodiment of the present application is shown as follows: Figure 6 As shown, the method includes the following steps.
[0178] S601. Acquire original meteorological data, where the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions, and the multiple target meteorological variables are meteorological variables required by WRF to generate a background field.
[0179] S602: Obtain business requirements, which include a target area, a target resolution, and a time interval.
[0180] S603: Acquire surface potential data and land and sea distribution data of the target area.
[0181] S604 , dividing the longitude and latitude intervals corresponding to the target area according to the target resolution, and generating a remapping file corresponding to the target area, where the remapping file is used to represent a plurality of longitude and latitude grid points divided into the target area.
[0182] S605 . According to the remapping file, determine the data of each target meteorological variable in multiple longitude and latitude grid points from the original meteorological data, and obtain the longitude and latitude grid data corresponding to the multiple target meteorological variables.
[0183] S606: Based on the sorting of the multiple target meteorological variables, extract meteorological data corresponding to multiple time points from the latitude and longitude grid data corresponding to the multiple target meteorological variables in sequence according to time intervals.
[0184] S607, extracting geographic data corresponding to multiple time periods from the surface potential data and the land and sea distribution data respectively according to time intervals.
[0185] S608. Determine the array files corresponding to the multiple time periods according to the meteorological data corresponding to the multiple time periods and the geographical data corresponding to the multiple time periods.
[0186] S609: Generate a target file according to the array files corresponding to the multiple time points.
[0187] S610: Output the target file.
[0188] S611. Generate a background field through WRF according to the target file.
[0189] It is understood that S601-S610 can be as follows Figure 1 The meteorological model 101 shown is generated, and S611 may be generated by WRF102. This embodiment is described by taking an example where the meteorological model 101 and WRF102 are deployed on the same server.
[0190] The specific implementation method and technical effects of this embodiment are similar to those of the above embodiment and will not be repeated here.
[0191] Figure 7 A schematic diagram of a target file generation device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device 70 includes: a first acquisition module 701 , a second acquisition module 702 , a third acquisition module 703 , a first processing module 704 , a second processing module 705 , a generation module 706 and an output module 707 .
[0192] In a possible implementation, the generating module 706 is specifically configured to:
[0193] Get the template file corresponding to the target file.
[0194] The array files corresponding to the multiple moments are compressed according to the encoding method corresponding to the template file to obtain the compressed array files corresponding to the multiple moments; and the compressed array files corresponding to the multiple moments are written into the template file to generate the target file.
[0195] In a possible implementation, the multiple target meteorological variables in the template file are sorted in the order required by WRF to generate the background field; the multiple target meteorological variables are consistent with the order of the multiple target meteorological variables in the template file.
[0196] The generation module 706 is specifically used for:
[0197] Based on the sorting of multiple target meteorological variables, the target meteorological variables in the array files corresponding to each time are compressed in sequence according to the encoding method to obtain compressed array files corresponding to multiple time points.
[0198] According to the order of multiple target meteorological variables, the target meteorological variables in the compressed array files corresponding to each moment are written into the template file in turn to generate a target file.
[0199] In a possible implementation, the generating module 706 is specifically configured to:
[0200] Get a sample forecast file from GFS.
[0201] Extract the grid format and meteorological variables extracted from the forecast file sample to obtain the first output file.
[0202] Based on the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids, the first output file is updated to obtain a second output file.
[0203] Based on the second output file, multiple target meteorological variables are extracted from the forecast file sample to obtain files corresponding to the multiple target meteorological variables.
[0204] Merge the files corresponding to multiple target meteorological variables to obtain a template file.
[0205] In a possible implementation, the second processing module 705 is specifically configured to:
[0206] Based on the sorting of multiple target meteorological variables, meteorological data corresponding to multiple time periods are extracted from the latitude and longitude grid data corresponding to the multiple target meteorological variables in sequence according to time intervals.
[0207] According to the time intervals, the geographic data corresponding to multiple moments are extracted from the surface potential data and the land and sea distribution data.
[0208] According to the meteorological data corresponding to the multiple time periods and the geographical data corresponding to the multiple time periods, the array files corresponding to the multiple time periods are determined.
[0209] In a possible implementation, the first processing module 704 is specifically configured to:
[0210] The longitude and latitude intervals corresponding to the target area are divided according to the target resolution, and a remapping file corresponding to the target area is generated. The remapping file is used to represent multiple longitude and latitude grid points divided into the target area.
[0211] According to the remapping file, the data of each target meteorological variable in multiple longitude and latitude grid points are determined from the original meteorological data, and the longitude and latitude grid data corresponding to the multiple target meteorological variables are obtained.
[0212] The device of this embodiment can be used to execute the technical solution of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0213] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the electronic device 80 may include: at least one processor 801 and a memory 802 .
[0214] The memory 802 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer-executable instructions.
[0215] The memory 802 may include a random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory), such as at least one disk memory.
[0216] The processor 801 is used to execute the computer-executable instructions stored in the memory 802 to implement the method described in the above method embodiment. The processor 801 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0217] Optionally, the electronic device 80 may further include: a communication interface 803. In a specific implementation, if the communication interface 803, the memory 802 and the processor 801 are implemented independently, the communication interface 803, the memory 802 and the processor 801 may be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0218] Optionally, in a specific implementation, if the communication interface 803, the memory 802 and the processor 801 are integrated on a chip, the communication interface 803, the memory 802 and the processor 801 can communicate through an internal interface.
[0219] The electronic device 80 may be a server or the like.
[0220] The electronic device of this embodiment can be used to execute the technical solution of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0221] An embodiment of the present application provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a RAM, a disk or an optical disk, and other media that can store computer-executable instructions. Specifically, the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer, the technical solution shown in the above method embodiment is executed. The specific implementation method and technical effect are similar and will not be repeated here.
[0222] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a computer, the technical solution shown in the above method embodiment is executed. The specific implementation method and technical effect are similar and will not be repeated here.
[0223] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0224] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0225] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0226] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0227] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.
[0228] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, ROM, RAM, mobile hard disks, magnetic disks or optical disks.
[0229] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0230] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0231] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for generating a target file, characterized in that: include: Acquire original meteorological data, wherein the original meteorological data includes data corresponding to a plurality of target meteorological variables in a plurality of regions, wherein the plurality of target meteorological variables are meteorological variables required for a weather research and forecasting model WRF to generate a background field; Acquiring business requirements, wherein the business requirements include a target area, a target resolution, and a time interval; Acquiring surface potential data and land and sea distribution data of the target area; According to the target area and the target resolution, extracting latitude and longitude grid data corresponding to a plurality of target meteorological variables from the original meteorological data; According to the time intervals, extracting data corresponding to multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data, and the land and sea distribution data, to obtain array files corresponding to the multiple moments; Generate a target file according to the array files corresponding to the multiple moments; The target file is output, and the target file is used to generate the background field in the WRF.
2. The method according to claim 1, characterized in that Generate a target file according to the array files corresponding to the multiple moments, including: Obtaining a template file corresponding to the target file; The array files corresponding to the multiple moments are compressed according to the encoding method corresponding to the template file to obtain compressed array files corresponding to the multiple moments; and the compressed array files corresponding to the multiple moments are written into the template file to generate the target file.
3. The method according to claim 2, characterized in that The multiple target meteorological variables in the template file are sorted in the order required by the WRF to generate the background field; the multiple target meteorological variables are consistent with the order of the multiple target meteorological variables in the template file; Compressing the array files corresponding to the multiple moments according to the encoding method corresponding to the template file to obtain compressed array files corresponding to the multiple moments; and writing the compressed array files corresponding to the multiple moments into the template file to generate the target file, including: Based on the sorting of the multiple target meteorological variables, compressing the target meteorological variables in the array files corresponding to each moment in sequence according to the encoding method to obtain compressed array files corresponding to the multiple moments; According to the order of the plurality of target meteorological variables, the target meteorological variables in the compressed array file corresponding to each moment are sequentially written into the template file to generate the target file.
4. The method according to claim 2, characterized in that: Obtaining the template file corresponding to the target file includes: Get the sample forecast file of Global Forecast System GFS; Extracting the grid format and meteorological variables extracted from the forecast file sample to obtain a first output file; Based on the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids, the first output file is updated to obtain a second output file; Based on the second output file, extract the multiple target meteorological variables from the forecast file sample to obtain files corresponding to the multiple target meteorological variables; The files corresponding to the multiple target meteorological variables are merged to obtain the template file.
5. The method according to claim 3, characterized in that: According to the time intervals, data corresponding to multiple moments are extracted from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data, and the land and sea distribution data to obtain array files corresponding to the multiple moments, including: Based on the sorting of the multiple target meteorological variables, extracting meteorological data corresponding to the multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables in sequence according to the time intervals; Extracting geographic data corresponding to the multiple moments from the surface potential data and the land-sea distribution data respectively according to the time intervals; The array files corresponding to the multiple moments are determined according to the meteorological data corresponding to the multiple moments and the geographical data corresponding to the multiple moments.
6. The method according to any one of claims 1 to 5, characterized in that: According to the target area and the target resolution, latitude and longitude grid data corresponding to a plurality of target meteorological variables are extracted from the original meteorological data, including: Divide the longitude and latitude intervals corresponding to the target area according to the target resolution, and generate a remapping file corresponding to the target area, wherein the remapping file is used to represent a plurality of longitude and latitude grid points divided by the target area; According to the remapping file, the data of each target meteorological variable in the multiple longitude and latitude grid points are determined from the original meteorological data to obtain the longitude and latitude grid data corresponding to the multiple target meteorological variables.
7. A device for generating a target file, characterized in that: include: A first acquisition module is used to acquire original meteorological data, wherein the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions, and the multiple target meteorological variables are meteorological variables required by WRF to generate a background field; A second acquisition module is used to acquire business requirements, wherein the business requirements include a target area, a target resolution and a time interval; A third acquisition module is used to acquire surface potential data and land and sea distribution data of the target area; A first processing module, configured to extract latitude and longitude grid data corresponding to a plurality of target meteorological variables from the original meteorological data according to the target area and the target resolution; A second processing module is used to extract data corresponding to multiple moments from the latitude and longitude grid data corresponding to the multiple target meteorological variables, the surface potential data and the land and sea distribution data according to the time intervals, and obtain array files corresponding to the multiple moments; A generating module, used for generating a target file according to the array files corresponding to the plurality of moments; An output module is used to output the target file, and the target file is used to generate a background field in the WRF.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.
Citation Information
Patent Citations
Wind power plant wind speed prediction method and device and electronic equipment
CN110968929A
Atmospheric turbulence structure constant forecasting method based on mesoscale numerical mode WRF
CN111123409A
Watering operation control method and device, electronic equipment and storage medium
CN115094815A
Meteorological data processing method and device, electronic equipment and storage medium
CN117313378A
Weather forecasting method based on AI weather forecasting model and WRF model
CN119001918A
Cited By
Bay environment simulation forecasting method and device
CN120409326A