Method, device, equipment, medium and product for generating target file
By extracting the necessary target meteorological variables for WRF from the original meteorological data and generating the adaptive target file, the problem of low processing efficiency caused by the large size of the GFS file is solved, and the processing efficiency of WRF is improved.
Patent Information
- Application Number
- CN202411845838.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2044-12-13
AI Technical Summary
GFS provides a large size of the grib2 file, which leads to low processing efficiency using WRF, because it contains a large amount of weather variable data that is not required by WRF.
According to business needs, the target weather variables necessary for WRF to generate the background field are extracted from the original meteorological data, and the target files are generated to reduce useless data. The template file compression and sorting process are used to generate target files that are adapted to WRF.
By reducing useless data, the target file size is smaller, which improves the processing efficiency of the WRF preprocessing system.
Smart Images

Figure CN119623451B_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] Global Forecast System (GFS) forecast data is widely used in numerical weather forecasting and is a vital component of global meteorological data. Currently, GFS provides free downloads of global forecast data at resolutions of 0.25, 0.5, and 1.0 degrees. The downloadable file format is grib2.
[0003] The Weather Research and Forecasting Model (WRF) is a numerical weather forecast model used to generate background data for numerical weather forecasting. WRF primarily sources its background data from the Global Forecasting System (GFS). However, the grib2 files downloaded from the GFS are large, containing data for over 700 meteorological variables. This results in low efficiency when 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, which are used 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, where the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions, where the multiple target meteorological variables are meteorological variables required by WRF to generate a background field;
[0007] Obtaining 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] 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;
[0010] Extracting data corresponding to a plurality of moments from the latitude and longitude grid data corresponding to the plurality of target meteorological variables, the surface potential data, and the land-sea distribution data according to the time intervals to obtain array files corresponding to the plurality of 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 when WRF generates 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 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 are written in the order of the variables in the template file to avoid writing errors and improve the accuracy of the target file.
[0023] Optionally, in the above method, obtaining the template file corresponding to the target file includes:
[0024] Get sample forecast files from the 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 based on the forecast file sample of GFS to generate the target file required by WRF to generate background fields.
[0030] Optionally, the method described above extracts data corresponding to multiple moments from the latitude and longitude grid data, the surface potential data, and the land-sea distribution data corresponding to the multiple target meteorological variables according to the time intervals to obtain array files corresponding to the multiple moments, including:
[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 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, includes:
[0036] 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, wherein the remapping file is used to represent a plurality of longitude and latitude grid points divided into the target area;
[0037] According to the remapping file, 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 based on the remapping file, the data of multiple target meteorological variables in multiple latitude and longitude grids can be determined in the original data 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 configured to acquire raw meteorological data, wherein the raw 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 obtain surface potential data and land and sea distribution data of the target area;
[0043] A first processing module is 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 configured 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, to obtain array files corresponding to the multiple moments;
[0045] A generating module, configured to generate 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 configured to:
[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 to:
[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 configured to:
[0055] Get sample forecast files from the 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 configured to:
[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 configured to:
[0065] 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, wherein the remapping file is used to represent a plurality of longitude and latitude grid points divided into the target area;
[0066] According to the remapping file, 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 solutions in the above method embodiments, and its beneficial effects are similar and will not be repeated here.
[0073] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, is used to implement the method described in the first aspect.
[0074] The computer program product provided in the embodiment of the present application can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, which 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 the 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 based on 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 required when WRF generates the background field, so that there is less useless data in the target file, and the data volume is smaller than that of the target file provided by GFS, 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 in 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 flowchart 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 illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0086] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0087] The grib2 files exported by the GFS are the primary data source for generating the background fields required by WRF. For example, at a resolution of 0.25 degrees, the file size for each moment can reach 515MB, containing data for over 700 meteorological variables. If you download meteorological data for the next 240 hours at six-hour intervals, the total data volume 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 selected, 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, there will be 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 a 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, which reduces the amount of useless data in the target file. 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.
[0091] In one possible implementation, the following is combined Figure 1 , describes the application scenarios to which the embodiments of the present application are applicable.
[0092] Figure 1A schematic diagram of an application scenario provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, meteorological model 101 can be used to generate raw meteorological data and, based on this raw meteorological data, generate a target file for output to WRF 102 for generating the background field required for weather forecasting. The background field refers to the initial state or initial conditions used to initialize the weather forecast model. It is typically obtained by combining previous forecast results (such as the forecast for the previous time step) with observational data (such as ground observations, satellite observations, radar data, etc.). The background field provides a rough, continuous meteorological state, serving as the starting point for the weather forecast model to generate the next forecast.
[0093] In one possible implementation, meteorological model 101 can generate meteorological data for a spherical cube grid, dividing the world into six regions, effectively solving the theoretical bottleneck of the convergence of the North and South Poles. Through a more uniform grid distribution, the super computing power of modern large-scale parallel computing supercomputers can be maximized, and on the basis of more efficient computing load balancing, weather processes at any location in the world can be more accurately simulated.
[0094] WRF102 is an open-source numerical model used 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 fields to provide different models with different business functions, such as air quality modeling.
[0095] WRF 102 can define the simulation area and grid through the WRF preprocessing system (WPS) in WRF 102 and extract meteorological data, such as the target file, from meteorological model 101. WRF 102 can read the target file through the real module in WRF 102 and generate the corresponding background field based on the target file.
[0096] The meteorological variables required for the background field generated by WRF 102 may be, for example, 135, including surface potential and land-sea distribution. Since these two variables are fixed geographic data and do not change over time, meteorological model 101 may output meteorological data having 135 meteorological variables and generate a smaller target file based on this data.
[0097] In one 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 also to generate the background field according to the target file.
[0099] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. 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 The present invention provides a flowchart of a method for generating a target file, which can be executed by a device for generating a target file. The device for generating a target file can be implemented by a computer program; it can also be implemented by a medium storing a relevant computer program, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with a relevant computer program, such as a chip or electronic device. The electronic device can be a server, a server cluster, a computer or other terminal device. The following takes a server as an example. Figure 2 As shown, the method may include the following steps.
[0101] S201. Obtain original meteorological data, where the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions. 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, geopotential height and relative humidity corresponding to 23 pressure layers, that is, the pressure layer variables can include 5×25 (i.e. 115) variables.
[0104] For example, 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 as necessary meteorological variables required to generate the target file in this application.
[0105] Ground layer variables include surface 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. Ground layer variables also include surface geopotential height and land-sea 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] Illustratively, the four different depth ranges may include 0 cm to 10 cm, 10 cm to 40 cm, 40 cm to 100 cm, and 100 cm to 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 can 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 can include the above 133 variables to output data corresponding to the above 133 target meteorological variables.
[0111] S202: Obtain business requirements, which include target area, target resolution, and time interval.
[0112] The server can obtain the business requirements for background field generation, including the target area, target resolution and time interval. The target area can be, for example, a simulation area for weather forecasting. 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] Target resolution refers to the size of the grids into which the Earth's surface is divided. It's understood that target resolution is related to the number of grids; a larger target resolution indicates a smaller number of grids. For example, a target resolution of 0.25 degrees means the Earth's surface is divided into grids with 0.25-degree intervals between longitude and latitude, with each grid having a specific latitude and longitude coordinate. The server can retrieve data corresponding to each grid (including data for multiple target meteorological variables) based on 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 moments can be obtained from the original meteorological data according to the time interval, and data at corresponding moments can be obtained according to actual business needs, without having to obtain data at all moments, thereby reducing the amount of data.
[0115] S203: Acquire 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 based on 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 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] In other words, the data extracted from the raw meteorological data corresponds to multiple longitude and latitude grid points in the target area. For each longitude and latitude grid point, the data includes meteorological data for multiple target meteorological variables at that longitude and latitude grid point. For any target meteorological variable, there is a meteorological data point for that target meteorological variable at each longitude and latitude grid point.
[0121] It can be understood that, for the data corresponding to any latitude and longitude grid point, the data includes data of multiple target meteorological variables at multiple consecutive moments, that is, the data includes data of multiple target meteorological variables at each moment.
[0122] S205 , extracting data corresponding to multiple moments from the latitude and longitude grid data, surface potential data, and land and sea distribution data corresponding to multiple target meteorological variables according to time intervals, and obtaining array files corresponding to the multiple moments.
[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 at time intervals. For example, the multiple time points may be multiple hourly times. For example, if the time interval is three hours, the server may extract data corresponding to 0:00, 3:00, 6:00, 9:00, 12:00, 15:00, 18:00, 21:00, and 24:00 from the data at multiple consecutive time points (i.e., the data extracted in S204, the surface potential data, and the land-sea distribution data) every three 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. The server may obtain data at multiple times of each day within the target time length.
[0125] After the server extracts the data corresponding to multiple time points, it can obtain array files corresponding to the multiple time points. For ease of understanding, the array files corresponding to the multiple time points can be represented in the form of Table 1. Table 1 only shows the data for time points 1 and 2; the data for other time points is similar. In Table 1, A to W represent different values.
[0126] In one 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 time moments according to the following method:
[0127] The server can sort multiple target meteorological variables and extract meteorological data corresponding to multiple moments in time from the latitude and longitude grid data corresponding to the multiple target meteorological variables, sequentially and at time intervals. Furthermore, the server can extract geographic data corresponding to multiple moments in time from the surface potential data and land and sea distribution data, respectively, at time intervals. Then, based on the meteorological data and geographic data corresponding to the multiple moments in time, array files corresponding to the multiple moments in time are determined.
[0128] Table 1
[0129]
[0130] In one possible implementation, since surface potential data and land-sea distribution data generally do not change with time, the server can use the surface potential data and land-sea distribution data as geographic data corresponding to multiple moments, that is, the surface potential data and land-sea distribution data corresponding to multiple moments 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 based on the array files corresponding to the multiple moments.
[0133] After the server obtains the array files corresponding to the multiple time points, it can generate a target file based on the array files corresponding to the multiple time points.
[0134] Exemplarily, the server may generate a target file based on array files corresponding to multiple time points by, for example, generating the target file based on a template file corresponding to the target file. The target file is in grib2 format. The template file is in grib2 format. Exemplarily, the template file may be generated based on a sample grib2-formatted forecast file. In this case, the target meteorological variables in the target file correspond one-to-one with the meteorological variables in the template file and the meteorological variables required for WRF to generate the background field. In other words, the order and number of the meteorological variables are consistent.
[0135] S207: Output the target file, which is used to generate the 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 land and sea distribution data, to obtain array files corresponding to multiple moments. Then, a target file is generated based on 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 the 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 the meteorological variables required 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. Compared with the target file provided by GFS, the data volume is smaller, which can improve the efficiency of the WRF pre-processing system in processing the target file.
[0138] Next, we will explain how to generate a target file based on array files corresponding to multiple moments.
[0139] Figure 3The flowchart of another method for generating a target file provided in an embodiment of the present application is as follows. The method can be executed by a target file generating device, which can be implemented by a computer program; it can also be implemented by a medium storing a relevant computer program, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with a relevant computer program, such as a chip or electronic device. The electronic device can be a server, a server cluster, a computer or other terminal device, etc. The following takes a server as an example, Figure 3 As shown, the method may include the following steps.
[0140] S301: Obtain a template file corresponding to a target file.
[0141] The server can obtain a template file corresponding to the target file. For example, the template file can be generated based on a forecast file sample in the grib2 format downloaded from GFS. The forecast file sample can include data corresponding to multiple meteorological variables at non-zero time points.
[0142] S302 , compressing array files corresponding to 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 a target file.
[0143] The server can compress the array files corresponding to multiple moments according to the encoding scheme corresponding to the template file to generate multiple compressed array files. For example, the encoding scheme may be grib2. After compressing the array files corresponding to the multiple moments, the compressed array files are written into the template file to generate the target file. This reduces the size of the target file and facilitates output to WRF in the required format.
[0144] In one possible implementation, the target meteorological variables in the template file are sorted in the order required by WRF to generate the background field. The target meteorological variables are sorted in the same order as the target meteorological variables in the template file. In other words, there is a one-to-one correspondence between the target meteorological variables in the template file and the meteorological variables required by WRF to generate the background field.
[0145] Based on the order of the target meteorological variables, the server can compress the target meteorological variables in the array file corresponding to each time point in accordance with the encoding method corresponding to the template file, thereby obtaining compressed array files corresponding to the multiple time points. The server then writes the target meteorological variables from the compressed array files corresponding to each time point into the template file in accordance with the order of the target meteorological variables to generate the target file. The server writes the variables in the order of 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 that is adapted to the background field generated by WRF.
[0147] Next, we will explain how to generate a template file for the target file.
[0148] Figure 4 The present invention provides a flowchart of another method for generating a target file, which can be executed by a target file generating device, which can be implemented by a computer program; it can also be implemented by a medium storing a relevant computer program, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with a relevant computer program, such as a chip or electronic device. The electronic device can be a server, a server cluster, a computer or other terminal device, 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] For example, the forecast file sample may include data corresponding to multiple meteorological variables at non-zero time points. For example, the forecast file sample downloaded based on the GFS may include data corresponding to more than 700 meteorological variables.
[0151] S402: Extracting the grid format and meteorological variables from the forecast file sample to obtain a first output file.
[0152] The server can extract the grid format and meteorological variables from the sample forecast file to obtain a first output file. Since GFS is a common data source for WRF-generated background fields, the format framework from the sample forecast file can be extracted so that a file with a format compatible with 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 number of grids and the starting values of 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 one possible implementation, the server may update the first output file in response to the user input of the target resolution, the starting values of the latitude and longitude of the target area, and the number of grids to obtain the second output file. The number of grids may be determined based on 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 sample forecast file based on the second output file. In other words, the server can extract multiple target meteorological variables from the sample forecast file based on the multiple target meteorological variables and generate a file corresponding to each target meteorological variable based on the second output file. In other words, the server generates each target meteorological variable.
[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 based on the forecast file sample of GFS to generate the target file required by WRF to generate background fields.
[0164] Next, S204 in the above embodiment will be described.
[0165] Figure 5The present invention provides a flowchart of another method for generating a target file, which can be executed by a target file generating device, which can be implemented by a computer program; it can also be implemented by a medium storing a relevant computer program, such as a USB flash drive and / or a CD, or it can also be implemented by a physical device integrated or installed with a relevant computer program, such as a chip or electronic device. The electronic device can be a server, a server cluster, a computer or other terminal device, 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 divided into 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 multiple 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 latitude and longitude 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 latitude and longitude grid points in the remapping file based on the original meteorological data, that is, calculate the value corresponding to each target meteorological variable for each latitude and longitude grid point.
[0171] Exemplarily, the server may calculate the data of multiple latitude and longitude 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 latitude and longitude 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 a variable correspondence table from the raw meteorological data, which contains multiple target meteorological variables arranged in sequence. This variable correspondence table is then soft-linked to the WRF pre-processing system to identify the multiple target meteorological variables in the target file and generate an intermediate format file. The target meteorological variables in the intermediate format file are then horizontally interpolated onto the simulation area grid in the pre-processing system, outputting the interpolated file. Vertical stratification remains unchanged. WRF then interpolates the interpolated file vertically to generate the background field.
[0175] WRF uses a 24-layer configuration parameter for vertical interpolation of the interpolated file, including 23 vertical pressure layers and one surface layer (including the ground layer and soil layer). WRF defaults to a top pressure of 100 Pa and a minimum pressure of 5000 Pa, excluding data from layers between 100 Pa and 5000 Pa, thus reducing invalid calculations for some data.
[0176] For details, please refer to the steps of generating the background field with 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 target file generation method 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: Obtain original meteorological data, where the original meteorological data includes data corresponding to multiple target meteorological variables in multiple regions. The multiple target meteorological variables are meteorological variables required by WRF to generate a background field.
[0179] S602: Obtain business requirements, which include target area, target resolution, and 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 latitude and longitude grid points from the original meteorological data, and obtain the latitude and longitude 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 moments 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 moments from the surface potential data and the land-sea distribution data according to time intervals.
[0185] S608: Determine array files corresponding to the multiple moments according to the meteorological data corresponding to the multiple moments and the geographical data corresponding to the multiple moments.
[0186] S609: Generate a target file according to the array files corresponding to the multiple moments.
[0187] S610: Output the target file.
[0188] S611. Generate a background field using WRF according to the target file.
[0189] It is understood that S601-S610 can be as follows Figure 1 The meteorological model 101 is shown as being generated, and S611 may be generated by the WRF 102. This embodiment is described by taking an example where the meteorological model 101 and the WRF 102 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 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 order of the multiple target meteorological variables is consistent with that 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 moment are compressed in sequence according to the encoding method to obtain compressed array files corresponding to multiple moments.
[0198] According to the order of the multiple 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 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 moments 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, 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, 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 the 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 latitude and longitude grid points are determined from the original meteorological data, and the latitude and longitude 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 effects 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 (RAM), and may also include a non-volatile memory (Non-volatile Memory), such as at least one disk memory.
[0216] The processor 801 is configured to execute computer-executable instructions stored in the memory 802 to implement the method described in the aforementioned method embodiment. The processor 801 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0217] Optionally, electronic device 80 may further include a communication interface 803. In a specific implementation, if communication interface 803, memory 802, and processor 801 are implemented independently, they may be interconnected via a bus to enable communication between them. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses, but this does not necessarily mean there is only one bus or only 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 complete communication 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 effects 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 this application is not limited by the order of the actions described, because according to this 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 this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0224] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed 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 performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed 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-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0226] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.
[0227] If an integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, 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, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0228] If the integrated unit / module is implemented as 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 this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of this application. The aforementioned memory includes various media that can store program code, such as USB flash drives, ROM, RAM, mobile hard drives, magnetic disks, or optical disks.
[0229] In the above embodiments, the description of each embodiment has its own focus. 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, not all possible combinations of the technical features in the above embodiments are 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. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as 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 exact structure 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: Acquiring raw meteorological data, the raw meteorological data including data corresponding to a plurality of target meteorological variables in a plurality of regions, the plurality of target meteorological variables being meteorological variables required for a Weather Research and Forecasting Model (WRF) to generate a background field; Obtaining 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; 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; Extracting data corresponding to a plurality of moments from the latitude and longitude grid data corresponding to the plurality of target meteorological variables, the surface potential data, and the land-sea distribution data according to the time intervals to obtain array files corresponding to the plurality of moments; Obtaining a sample forecast file of the Global Forecast System (GFS); extracting a grid format and meteorological variables from the sample forecast file to obtain a first output file; updating the 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 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; Merging the files corresponding to the multiple target meteorological variables to obtain a 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; 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 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.
3. The method according to claim 2, characterized in that 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 according to the time intervals 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.
4. The method according to any one of claims 1 to 3, characterized in that 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, including: 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, wherein the remapping file is used to represent a plurality of longitude and latitude grid points divided into the target area; According to the remapping file, 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.
5. A device for generating a target file, characterized in that: include: A first acquisition module is configured to acquire raw meteorological data, wherein the raw 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 obtain surface potential data and land and sea distribution data of the target area; A first processing module is 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 configured 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, to obtain array files corresponding to the multiple moments; A generation module is used to obtain a forecast file sample of the Global Forecast System (GFS); extract the grid format and meteorological variables extracted from the forecast file sample to obtain a first output file; updating the 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 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; Merging the files corresponding to the multiple target meteorological variables to obtain a 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; An output module is used to output the target file, and the target file is used to generate a background field in the WRF.
6. 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 4.
7. 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 4 when executed by a processor.
8. 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 4 when the computer program is executed by a processor.