Meteorological information prediction method and device, storage medium and electronic device
By using multiple graphics processors to process split sub-images in parallel in the weather prediction system, the problem of low meteorological information prediction efficiency is solved and the effect of improving the efficiency of meteorological information prediction is achieved.
Patent Information
- Application Number
- CN202410850079.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-27
AI Technical Summary
The prediction efficiency of meteorological information is low, mainly due to the large memory usage of meteorological images collected by satellites, which leads to high memory size requirements of the graphics card, and the graphics card is less efficient when running the AI weather forecast model.
By using multiple graphics processors in the weather forecasting system, a weather forecast model is deployed on each graphics processor, weather forecast information is generated based on the memory usage of the initial weather image and the memory capacity of the graphics processor, and the initial weather image is split into Multiple sub-images and assign them to different graphics processors for processing, thereby reducing memory footprint and speeding up predictions.
It improves the prediction efficiency of meteorological information, significantly reduces the memory usage of the graphics processor by meteorological images through parallel processing of sub-images, and speeds up the prediction speed of meteorological images by the meteorological prediction model.
Smart Images

Figure CN118396833B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and specifically, to a method and device for predicting meteorological information, a storage medium, and an electronic device. Background Art
[0002] With the development of satellite remote sensing technology, meteorological satellites have become an important means of conducting meteorological and oceanographic observations, especially geostationary orbit satellites, whose near real-time, high temporal resolution and high spatial resolution observations provide important data support for improving weather forecasting capabilities.
[0003] Meteorological satellite data has a large spatial coverage, high resolution, and near real-time acquisition characteristics, which provides a lot of space for the application of AI weather forecast models. Therefore, by deploying AI weather forecast models on graphics cards, meteorological images are predicted to obtain future weather information. Considering the characteristics of weather forecasting, data from multiple moments in the past are generally used to predict meteorological images at multiple moments in the future. In addition, since the memory usage of meteorological images collected by satellites is large, this places high requirements on the graphics card's video memory size. In addition, when the graphics card runs the AI weather forecast model, the image memory usage is large, so the efficiency of weather forecasting is low. Summary of the invention
[0004] The embodiments of the present application provide a method and device for predicting meteorological information, a storage medium, and an electronic device to at least solve the problem of low efficiency in predicting meteorological information in the related art.
[0005] According to an embodiment of the present application, a method for predicting meteorological information is provided. The meteorological prediction system includes a processor and multiple graphics processors. The processor is connected to each of the graphics processors respectively. A meteorological prediction model is deployed on each of the graphics processors. The meteorological prediction model is used to predict the meteorological information that will appear in the input area based on the meteorological information that has appeared in the input area. The method is applied to the processor and includes:
[0006] Generate image positioning information of multiple sub-regions of the target area according to the meteorological forecast information of the meteorological forecast model, wherein the meteorological forecast information is generated according to the memory usage of the initial meteorological image and the memory capacity of the graphics processor, the meteorological forecast information is used to indicate the size of the sub-region that the meteorological forecast model allows to predict meteorological information at a single time, the initial meteorological image records the meteorological information that has appeared in the target area, and the image positioning information is used to indicate the position of the meteorological information of the sub-region in the initial meteorological image;
[0007] Extracting a plurality of first sub-images from the initial meteorological image according to the image positioning information, wherein each of the first sub-images records the meteorological information of the sub-region and the surrounding area of the sub-region in the target area;
[0008] Sending the first sub-image to the corresponding graphics processor to obtain a second sub-image output by the weather forecast model, wherein the second sub-image records the weather information that will occur in the corresponding sub-area;
[0009] A plurality of the second sub-images are used to convert a target meteorological image for the target area, wherein the target meteorological image is used to indicate the meteorological information that will occur in the target area.
[0010] Optionally, extracting a plurality of first sub-images from the initial meteorological image according to the image positioning information includes:
[0011] Identifying a third sub-image indicated by the image positioning information on the initial meteorological image, wherein the third sub-image records the meteorological information of the corresponding sub-area;
[0012] Expanding the third sub-image in the initial meteorological image according to the regional parameters of the meteorological forecast model to obtain the image position of the first sub-image in the initial meteorological image, wherein the regional parameters are used to indicate the size relationship between the sub-region and the surrounding region;
[0013] The first sub-image is extracted from the initial meteorological image according to the image position.
[0014] Optionally, expanding the third sub-image in the initial meteorological image according to the regional parameters of the meteorological forecast model to obtain the image position of the first sub-image in the initial meteorological image includes:
[0015] Calculating a second size of an image recording the surrounding area according to a first size of a sub-image recording meteorological information of the sub-area and an area ratio, wherein the area ratio is used to indicate a proportional relationship between areas of the sub-area and the surrounding area, and the area parameter includes the area ratio;
[0016] Determine an outward expansion size of the third sub-image according to the first size and the second size;
[0017] The third sub-image is expanded according to the expanded size to obtain the first sub-image.
[0018] Optionally, determining the outer expansion size of the third sub-image according to the first size and the second size includes:
[0019] Calculating a first difference between a second length and a first length, wherein the first size includes the first length and the second size includes the second length; determining half of the first difference as an outward expansion length of the third sub-image, wherein the outward expansion size includes the outward expansion length;
[0020] A second difference between the second width and the first width is calculated, wherein the first size includes the first width and the second size includes the second width; and half of the second difference is determined as an expansion width of the third sub-image, wherein the expansion size includes the expansion width.
[0021] Optionally, generating the image positioning information of the plurality of sub-areas of the target area according to the meteorological forecast information of the meteorological forecast model includes:
[0022] Acquire the initial meteorological image of the target area before the current moment, wherein the initial meteorological image records the meteorological information of the target area;
[0023] Generating the weather forecast information of the weather forecast model according to the memory usage of the initial weather image and the memory capacity of each of the graphics processors;
[0024] The image positioning information of the plurality of sub-areas is generated according to the weather forecast information.
[0025] Optionally, generating the image positioning information of the plurality of sub-areas according to the meteorological forecast information includes:
[0026] generating a target size of an image area of the meteorological information to be predicted in the initial meteorological image according to a first size of a sub-image recording the meteorological information of the sub-area and an image size of the initial meteorological image, wherein the meteorological forecast information includes the first size;
[0027] Dividing a target image area satisfying the target size in the initial meteorological image;
[0028] Sequentially dividing the target image area into third sub-images corresponding to each of the sub-areas according to the first size, wherein the third sub-images record the meteorological information of the corresponding sub-areas;
[0029] The position information of the third sub-image in the initial meteorological image is determined as the image positioning information.
[0030] Optionally, generating a target size of an image area of the meteorological information to be predicted in the initial meteorological image according to a first size of the sub-image recording the meteorological information of the sub-area and an image size of the initial meteorological image includes:
[0031] Obtaining a first quotient obtained by dividing an initial length of the initial meteorological image by a first length, wherein the image size includes the initial length and the first size includes the first length; determining a product value of the first quotient and the first length as a reference length of an image region of the meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference length;
[0032] Obtain a second quotient obtained by dividing an initial width of the initial meteorological image by a first width, wherein the image size includes the initial width and the first size includes the first width; determine a product value of the second quotient and the first width as a reference width of an image area of meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference width.
[0033] Optionally, dividing the target image area satisfying the target size in the initial meteorological image includes one of the following:
[0034] In a case where the image size of the initial meteorological image is larger than the target size, intercepting an image area of the target size at the center of the initial meteorological image as the target image area;
[0035] When the image size of the initial meteorological image is equal to the target size, the entire image area of the initial meteorological image is used as the target image area.
[0036] Optionally, generating the meteorological forecast information of the meteorological forecast model according to the memory usage of the initial meteorological image and the memory capacity of each of the graphics processors includes:
[0037] Acquiring a regional parameter of the meteorological forecast model, wherein the regional parameter is used to indicate a size relationship between the sub-region and the surrounding region;
[0038] The first size of the sub-image that records the meteorological information of the sub-region in the initial meteorological image corresponding to the memory occupancy of the initial meteorological image, the current memory capacity of the graphics processor and the current regional parameters is determined from the corresponding meteorological image memory occupancy, the memory capacity of the graphics processor, the regional parameters and the sub-image size, wherein the meteorological forecast information includes the first size.
[0039] Optionally, before acquiring the initial meteorological image of the target area before the current moment, the method further includes:
[0040] Obtain satellite images collected by the satellite device in the reference time period before the current time;
[0041] Performing projection conversion on the satellite image to obtain longitude and latitude projection;
[0042] Obtaining the coordinate position of the target area;
[0043] Extracting a candidate meteorological image of the target area at the latitude and longitude projection of each of the reference moments in the reference time period according to the coordinate position;
[0044] The candidate meteorological image is converted into the initial meteorological image.
[0045] Optionally, converting the candidate meteorological image into the initial meteorological image includes:
[0046] Sorting the plurality of candidate meteorological images according to the order of the plurality of reference moments to obtain a candidate image sequence;
[0047] When it is determined that the candidate image sequence lacks a plurality of meteorological images at the target moment in the reference moments, obtaining reference meteorological images at adjacent moments before and after the target moment in the candidate image sequence;
[0048] generating a meteorological image at the target time according to the reference meteorological image;
[0049] Adding the generated meteorological image at the target time to a position corresponding to the target time in the candidate image sequence to obtain a target image sequence;
[0050] The resolution of each meteorological image in the target image sequence is adjusted in chronological order to obtain the initial meteorological image.
[0051] Optionally, the using the plurality of the second sub-images to convert a target meteorological image for the target area includes:
[0052] Acquire position index information of the second sub-image, wherein the position index information is used to indicate the position of the sub-region corresponding to the second sub-image in the target area;
[0053] The second sub-images are spliced according to the position index information to obtain the target meteorological image.
[0054] Optionally, the using the plurality of the second sub-images to convert a target meteorological image for the target area includes:
[0055] Determining a reference image region corresponding to each of the meteorological prediction models in the initial meteorological image, wherein the meteorological prediction model is used to predict meteorological information for the input first sub-image belonging to the reference image region;
[0056] The second sub-images are arranged according to the image extraction information of the reference image area, and the arranged second sub-images are spliced to obtain the target meteorological image, wherein the image extraction information is used to indicate the extraction order of extracting the first sub-images from the initial meteorological image.
[0057] According to another embodiment of the present application, a weather information prediction device is provided. The weather prediction system includes a processor and a plurality of graphics processors. The processor is connected to each of the graphics processors respectively. A weather prediction model is deployed on each of the graphics processors. The weather prediction model is used to predict the weather information that will appear in the input area based on the weather information that has appeared in the input area. The device is applied to the processor and includes:
[0058] a generating module, configured to generate image positioning information of a plurality of sub-regions of the target region according to the meteorological forecast information of the meteorological forecast model, wherein the meteorological forecast information is generated according to the memory usage of the initial meteorological image and the memory capacity of the graphics processor, the meteorological forecast information is used to indicate the size of the sub-regions that the meteorological forecast model allows to predict meteorological information at a single time, the initial meteorological image records the meteorological information that has appeared in the target region, and the image positioning information is used to indicate the position of the meteorological information of the sub-region in the initial meteorological image;
[0059] A first extraction module, configured to extract a plurality of first sub-images from the initial meteorological image according to the image positioning information, wherein each of the first sub-images records the meteorological information of the sub-region and the surrounding area of the sub-region in the target area;
[0060] A sending module, used for sending the first sub-image to the corresponding graphics processor to obtain a second sub-image output by the weather forecast model, wherein the second sub-image records the weather information that will appear in the corresponding sub-area;
[0061] The first conversion module is used to convert a target meteorological image for the target area using a plurality of the second sub-images, wherein the target meteorological image is used to indicate the meteorological information that will appear in the target area.
[0062] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0063] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0064] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0065] Through the present application, a weather forecast system includes multiple graphics processors, each of which is deployed with a weather forecast model, and then when predicting the weather image of the target area after the current moment, the weather forecast information is generated according to the memory usage of the initial weather image of the target area and the memory capacity of the graphics processor, so as to obtain the size of the sub-region of the weather information predicted by the weather forecast model in a single cloud image, and then the image positioning information of the sub-region is generated according to the weather information, and the first sub-image recording the weather information of the sub-region and the surrounding area in the initial weather image is extracted according to the image positioning information and sent to the corresponding graphics processor for processing, and the second sub-image output by the weather forecast model on the graphics processor is converted into the target weather image of the target area, so as to realize the initial weather image is split into multiple first sub-images according to the memory usage of the initial weather image and the memory capacity of the graphics processor, and the multiple first sub-images are distributed to the weather forecast models on different graphics processors for processing, thereby reducing the memory usage of the weather image on the graphics processor and accelerating the prediction speed of the weather forecast model on the weather image. Therefore, the problem of low prediction efficiency of weather information in the related art can be solved, and the effect of improving the prediction efficiency of weather information can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is a hardware structure block diagram of a server device of a method for predicting meteorological information in an embodiment of the present application;
[0067] Figure 2 is a flow chart of a method for predicting meteorological information according to an embodiment of the present application;
[0068] Figure 3 is an optional meteorological image prediction schematic diagram according to an embodiment of the present application;
[0069] Figure 4 is an optional image processing flow chart according to an embodiment of the present application;
[0070] Figure 5 is an optional image division schematic diagram according to an embodiment of the present application;
[0071] Figure 6This is an optional image division diagram according to an embodiment of the present application. Figure 1 ;
[0072] Figure 7 This is an optional image division diagram according to an embodiment of the present application. Figure 2 ;
[0073] Figure 8 A structural block diagram of a device for predicting meteorological information according to an embodiment of the present application. DETAILED DESCRIPTION
[0074] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0076] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a method for predicting meteorological information in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0077] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the prediction method of meteorological information in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0078] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0079] In this embodiment, a method for predicting meteorological information is provided. Figure 2 1 is a flowchart of a method for predicting meteorological information according to an embodiment of the present application. The meteorological prediction system includes a processor and multiple graphics processors. The processor is connected to each of the graphics processors respectively. A meteorological prediction model is deployed on each of the graphics processors. The meteorological prediction model is used to predict the meteorological information that will appear in the input area based on the meteorological information that has appeared in the input area. The method is applied to the processor, such as Figure 2 As shown, the process includes the following steps:
[0080] Step S202, generating image positioning information of multiple sub-areas of the target area according to the meteorological forecast information of the meteorological forecast model, wherein the meteorological forecast information is generated according to the memory usage of the initial meteorological image and the memory capacity of the graphics processor, the meteorological forecast information is used to indicate the size of the sub-area that the meteorological forecast model allows to predict meteorological information at a single time, the initial meteorological image records the meteorological information that has appeared in the target area, and the image positioning information is used to indicate the position of the meteorological information of the sub-area in the initial meteorological image;
[0081] Step S204, extracting a plurality of first sub-images from the initial meteorological image according to the image positioning information, wherein each of the first sub-images records the meteorological information of the sub-region and the surrounding area of the sub-region in the target area;
[0082] Step S206, sending the first sub-image to the corresponding graphics processor to obtain a second sub-image output by the weather forecast model, wherein the second sub-image records the weather information that will occur in the corresponding sub-area;
[0083] Step S208: using the plurality of the second sub-images to convert a target meteorological image for the target area, wherein the target meteorological image is used to indicate the meteorological information that will occur in the target area.
[0084] Through the above steps, the weather forecast system includes multiple graphics processors, each of which is deployed with a weather forecast model, and then when predicting the weather image of the target area after the current moment, the weather forecast information is generated according to the memory usage of the initial weather image of the target area and the memory capacity of the graphics processor, so as to obtain the size of the sub-area of the single cloud image forecast weather information of the weather forecast model, and then the image positioning information of the sub-area is generated according to the weather information, and the first sub-image recording the weather information of the sub-area and the surrounding area in the initial weather image is extracted according to the image positioning information and sent to the corresponding graphics processor for processing, and the second sub-image output by the weather forecast model on the graphics processor is converted into the target weather image of the target area, so as to realize the initial weather image is split into multiple first sub-images according to the memory usage of the initial weather image and the memory capacity of the graphics processor, and the multiple first sub-images are distributed to the weather forecast models on different graphics processors for processing, thereby reducing the memory usage of the weather image on the graphics processor and accelerating the prediction speed of the weather forecast model on the weather image. Therefore, the problem of low prediction efficiency of weather information in the related art can be solved, and the effect of improving the prediction efficiency of weather information can be achieved.
[0085] In the embodiment provided in the above step S202, the multiple graphics processors may be graphics processors with the same memory capacity or graphics processors with different memory capacities, and this solution does not limit this.
[0086] Optionally, in an embodiment of the present application, the graphics processor is used to identify an input meteorological image that records meteorological information of a target area, and output a meteorological image that records meteorological information of the area at a future time.
[0087] Optionally, in an embodiment of the present application, the weather forecast information may include, but is not limited to, the size of the sub-area included in the target area that the weather forecast model allows for a single prediction, the size of the image in the initial weather image used to record the weather information of the sub-area, and the input image and output image size of the weather forecast model. This solution does not impose any limitations on this.
[0088] Optionally, in an embodiment of the present application, the image positioning information is used to indicate the image position of the sub-image corresponding to the sub-region recorded in the initial meteorological image. The method for generating the image positioning information may be to determine the image size of the sub-image that records the meteorological information of the sub-region based on the meteorological forecast information, and then determine the division method of the initial meteorological image based on the image size, wherein the division method is used to divide the initial meteorological image into the maximum number of sub-images supported by the initial meteorological image, and then divide the sub-image corresponding to each sub-region on the initial image according to the division method, and determine the position of the sub-image in the initial meteorological image as the image positioning information. This scheme does not limit this.
[0089] In the embodiment provided in the above step S204, in order to ensure the accuracy of the prediction results of the meteorological prediction model for the phenomenon information of the sub-region, the sub-image input to the meteorological prediction model needs to include the meteorological information of the surrounding area in addition to recording the meteorological information of the current sub-region. Therefore, in the embodiment of the present application, the method of extracting the first sub-image from the initial meteorological image can be to locate the position of the initial sub-image that records the meteorological information of the sub-region in the initial meteorological image according to the image positioning information, and then expand the boundary of the initial sub-image according to the area ratio of the model to the sub-region and the surrounding area of the sub-region, so as to obtain the position information of each first sub-image in the initial meteorological image, and then extract multiple first sub-images from the initial meteorological image according to the position information.
[0090] Optionally, in an embodiment of the present application, multiple image processors may process multiple first sub-images in parallel, that is, multiple graphics processors run the meteorological prediction model in parallel to predict the received first sub-images, thereby outputting the second sub-images corresponding to the first sub-images.
[0091] In the embodiment provided in the above step S206, the initial meteorological image can be divided into multiple first image areas according to the target number of image processors deployed in the meteorological forecast system for predicting the initial meteorological image, each first image area corresponds to a graphics processor, and when performing image prediction, the first sub-image included in the current first image area can be sent to the corresponding image processor, so that the graphics processor calls the deployed meteorological forecast model to predict the first sub-image to obtain the corresponding second sub-image. Furthermore, when performing the first image area division, the initial image can be divided into the target number of first image areas, or the first image area can be divided according to the memory capacity of each graphics processor, and this is not limited in the present solution.
[0092] In the embodiment provided in the above step S208, the method of using multiple second sub-images to convert the target meteorological image into a target meteorological image can be to sort the multiple second sub-images according to the positional relationship of the sub-areas corresponding to the second sub-images in the target area and splice the sorted second sub-images to obtain the target meteorological image, and this scheme does not limit this.
[0093] Optionally, in an embodiment of the present application, the number of frames of the initial meteorological image may be one frame or multiple frames. Furthermore, when the initial meteorological image is multiple frames, when extracting the first sub-image from the initial meteorological image, it is necessary to extract the first sub-image from the same image position in the initial meteorological images of different frames, thereby inputting the first sub-images extracted from the multiple frames into the same graphics processor for prediction, wherein the multiple first sub-images extracted from the multiple frames of initial meteorological images record the meteorological information of the same sub-area in different frames.
[0094] Figure 3 is an optional meteorological image prediction schematic diagram according to an embodiment of the present application, such as Figure 3 As shown, N graphics processors are deployed in the weather forecast system, and a weather forecast model is deployed on each graphics processor, so as to divide the initial weather image into N sub-images. The weather forecast model on each graphics processor is used to predict the weather information in the corresponding sub-image and output the corresponding sub-image after prediction, and then the sub-images output by the graphics processor are merged to obtain the target weather image. In this way, on the one hand, the memory usage requirement of the image processor for weather information prediction is reduced, and on the other hand, the operation of multiple graphics processors is parallel, thereby compressing the time for predicting the target weather image and improving the prediction efficiency of the weather image. This scheme does not limit this.
[0095] As an optional embodiment, extracting a plurality of first sub-images from the initial meteorological image according to the image positioning information includes:
[0096] Identifying a third sub-image indicated by the image positioning information on the initial meteorological image, wherein the third sub-image records the meteorological information of the corresponding sub-area;
[0097] Expanding the third sub-image in the initial meteorological image according to the regional parameters of the meteorological forecast model to obtain the image position of the first sub-image in the initial meteorological image, wherein the regional parameters are used to indicate the size relationship between the sub-region and the surrounding region;
[0098] The first sub-image is extracted from the initial meteorological image according to the image position.
[0099] Optionally, in an embodiment of the present application, the regional parameters may be fixed parameters pre-set according to the model requirements of the meteorological forecast model, or may be generated based on the memory usage of the initial meteorological image and the memory capacity of the graphics processor, which is not limited in this sub-scheme.
[0100] Optionally, in an embodiment of the present application, when the third sub-image is expanded according to the regional parameters, there may be a situation where there is no meteorological image in the expanded area because the third sub-image is located at the boundary position of the initial meteorological image. In this case, the boundary position of the expanded image with no meteorological image can be directly set to a missing value and a blank image can be added, or a boundary area image can be generated according to the image memory of the third sub-image, and the generated boundary area image can be used to fill the expanded no meteorological image score area. This solution does not limit this.
[0101] Through the above content, by expanding the third sub-image, the first sub-image output to the meteorological prediction model not only records the meteorological information of the sub-area of the current meteorological information to be predicted, but also records the meteorological information of the surrounding areas of the sub-area, thereby ensuring the prediction result of the meteorological information of the sub-area.
[0102] As an optional embodiment, the step of expanding the third sub-image in the initial meteorological image according to the regional parameters of the meteorological forecast model to obtain the image position of the first sub-image in the initial meteorological image includes:
[0103] Calculating a second size of an image recording the surrounding area according to a first size of a sub-image recording meteorological information of the sub-area and an area ratio, wherein the area ratio is used to indicate a proportional relationship between areas of the sub-area and the surrounding area, and the area parameter includes the area ratio;
[0104] Determine an outward expansion size of the third sub-image according to the first size and the second size;
[0105] The third sub-image is expanded according to the expanded size to obtain the first sub-image.
[0106] Optionally, in the embodiment of the present application, the second size may be obtained by scaling the first size according to the area ratio, that is, the ratio of the first size to the second size is equal to the area ratio.
[0107] Optionally, in an embodiment of the present application, the third sub-image is located at the center of the expanded first sub-image, that is, when expanding, the expanded sizes on the four sides of the third sub-image are the same, and this solution does not limit this.
[0108] Through the above content, by calculating the second size of the area around the sub-area according to the area ratio and the first size, and then calculating the expansion size of the third sub-image according to the second size and the first size, and then expanding the third sub-image according to the expansion size, the accuracy of the size of the first sub-image input to the graphics processor is guaranteed, avoiding the impact of the size on the graphics processor running the meteorological forecast model.
[0109] As an optional embodiment, determining the outer expansion size of the third sub-image according to the first size and the second size includes:
[0110] Calculating a first difference between a second length and a first length, wherein the first size includes the first length and the second size includes the second length; determining half of the first difference as an outward expansion length of the third sub-image, wherein the outward expansion size includes the outward expansion length;
[0111] A second difference between the second width and the first width is calculated, wherein the first size includes the first width and the second size includes the second width; and half of the second difference is determined as an expansion width of the third sub-image, wherein the expansion size includes the expansion width.
[0112] Through the above steps, the average of the difference between the first size and the second size is used as the basis for the expansion size, thereby ensuring that the third sub-image is located at the center of the expanded first sub-image, thereby avoiding the impact of uneven area of the surrounding area on the meteorological information forecast in the sub-area.
[0113] As an optional embodiment, the generating of the image positioning information of the plurality of sub-areas of the target area according to the weather forecast information of the weather forecast model includes:
[0114] Acquire the initial meteorological image of the target area before the current moment, wherein the initial meteorological image records the meteorological information of the target area;
[0115] Generating the weather forecast information of the weather forecast model according to the memory usage of the initial weather image and the memory capacity of each of the graphics processors;
[0116] The image positioning information of the plurality of sub-areas is generated according to the weather forecast information.
[0117] Optionally, in an embodiment of the present application, weather forecast information can be generated by a pre-trained target prediction model based on the memory usage of the initial weather image and the memory capacity of the graphics processor, wherein the target prediction model records the correlation between the memory usage of the weather image and the memory capacity of the graphics processor.
[0118] Optionally, in an embodiment of the present application, the method for generating image positioning information may be to determine the image size of a sub-image that records the meteorological information of a sub-region based on meteorological forecast information, and then determine a method for dividing the initial meteorological image based on the image size, wherein the division method is used to divide the initial meteorological image into the maximum number of sub-images supported by the initial meteorological image, and then divide the sub-image corresponding to each sub-region on the initial image according to the division method, and determine the position of the sub-image in the initial meteorological image as the image positioning information, which is not limited in this scheme.
[0119] Through the above content, by generating weather forecast information based on the memory usage of the initial weather information and the memory capacity of each graphics processor, and then based on the image positioning information of multiple sub-regions generated by the weather information, the divided sub-regions can not only cover the entire area orientation of the target area, but also ensure that the weather forecast model on the image processor can effectively identify and predict the weather image of the sub-region, thereby improving the forecast efficiency of the weather forecast model running by the graphics processor for the weather information of the sub-region.
[0120] As an optional embodiment, generating the image positioning information of the plurality of sub-areas according to the meteorological forecast information includes:
[0121] generating a target size of an image area of the meteorological information to be predicted in the initial meteorological image according to a first size of a sub-image recording the meteorological information of the sub-area and an image size of the initial meteorological image, wherein the meteorological forecast information includes the first size;
[0122] Dividing a target image area satisfying the target size in the initial meteorological image;
[0123] Sequentially dividing the target image area into third sub-images corresponding to each of the sub-areas according to the first size, wherein the third sub-images record the meteorological information of the corresponding sub-areas;
[0124] The position information of the third sub-image in the initial meteorological image is determined as the image positioning information.
[0125] Optionally, in an embodiment of the present application, in an initial meteorological image and when planning a target image area that meets a target size, the target image area is located at the center of the initial meteorological image.
[0126] As an optional embodiment, generating a target size of an image area of the meteorological information to be predicted in the initial meteorological image according to a first size of the sub-image recording the meteorological information of the sub-area and an image size of the initial meteorological image includes:
[0127] Obtaining a first quotient obtained by dividing an initial length of the initial meteorological image by a first length, wherein the image size includes the initial length and the first size includes the first length; determining a product value of the first quotient and the first length as a reference length of an image region of the meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference length;
[0128] Obtain a second quotient obtained by dividing an initial width of the initial meteorological image by a first width, wherein the image size includes the initial width and the second area size includes the first width; determine the product of the second quotient and the first width as a reference width of an area of the first meteorological image for meteorological information to be predicted, wherein the target area size includes the reference width.
[0129] Obtain a second quotient obtained by dividing an initial width of the initial meteorological image by a first width, wherein the image size includes the initial width and the first size includes the first width; determine a product value of the second quotient and the first width as a reference width of an image area of meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference width.
[0130] Through the above method, the first quotient obtained by dividing the first length by the initial length of the initial image is used as the maximum number of third sub-images allowed to be divided in the length direction. Similarly, this method is used to calculate the maximum number of third sub-images allowed to be divided in the width direction, thereby achieving the target image area being divided on the initial meteorological image according to the principle of the largest number of planned third sub-images, thereby maximizing the area of the predicted meteorological information in the target area.
[0131] As an optional embodiment, dividing the target image area satisfying the target size in the initial meteorological image includes one of the following:
[0132] In a case where the image size of the initial meteorological image is larger than the target size, intercepting an image area of the target size at the center of the initial meteorological image as the target image area;
[0133] When the image size of the initial meteorological image is equal to the target size, the entire image area of the initial meteorological image is used as the target image area.
[0134] As an optional embodiment, generating the meteorological forecast information of the meteorological forecast model according to the memory usage of the initial meteorological image and the memory capacity of each of the graphics processors includes:
[0135] Acquiring a regional parameter of the meteorological forecast model, wherein the regional parameter is used to indicate a size relationship between the sub-region and the surrounding region;
[0136] The first size of the sub-image that records the meteorological information of the sub-region in the initial meteorological image corresponding to the memory occupancy of the initial meteorological image, the current memory capacity of the graphics processor and the current regional parameters is determined from the corresponding meteorological image memory occupancy, the memory capacity of the graphics processor, the regional parameters and the sub-image size, wherein the meteorological forecast information includes the first size.
[0137] Optionally, in an embodiment of the present application, the regional parameter may be set according to the model prediction accuracy of the meteorological prediction model, or may be a fixed value set based on experience, which is not limited in this solution.
[0138] As an optional embodiment, before acquiring the initial meteorological image of the target area before the current moment, the method further includes:
[0139] Obtain satellite images collected by the satellite device in the reference time period before the current time;
[0140] Performing projection conversion on the satellite image to obtain longitude and latitude projection;
[0141] Obtaining the coordinate position of the target area;
[0142] Extracting a candidate meteorological image of the target area at the latitude and longitude projection of each of the reference moments in the reference time period according to the coordinate position;
[0143] The candidate meteorological image is converted into the initial meteorological image.
[0144] Optionally, in an embodiment of the present application, satellite images may be collected from multiple dimensions, such as satellite images including 16 spectral bands (2 visible light, 4 near infrared and 10 infrared channels) to image the earth's weather, ocean and environment, and can provide high-definition images with a resolution of 0.5-2 km and various meteorological parameters such as cloud cover, cloud height, cloud type, temperature, humidity, wind speed and precipitation.
[0145] As an optional embodiment, converting the candidate meteorological image into the initial meteorological image includes:
[0146] Sorting the plurality of candidate meteorological images according to the order of the plurality of reference moments to obtain a candidate image sequence;
[0147] When it is determined that the candidate image sequence lacks a plurality of meteorological images at the target moment in the reference moments, obtaining reference meteorological images at adjacent moments before and after the target moment in the candidate image sequence;
[0148] generating a meteorological image at the target time according to the reference meteorological image;
[0149] Adding the generated meteorological image at the target time to a position corresponding to the target time in the candidate image sequence to obtain a target image sequence;
[0150] The resolution of each meteorological image in the target image sequence is adjusted in chronological order to obtain the initial meteorological image.
[0151] Optionally, in an embodiment of the present application, the resolution adjustment may be to adjust each image in the target image sequence according to a fixed resolution adjustment parameter, or it may be to determine a resolution adjustment parameter corresponding to the proportional relationship between the size of the target area and the image size in the target image sequence, and then adjust each image in the target image sequence according to the resolution adjustment parameter.
[0152] Optionally, in an embodiment of the present application, the meteorological image can be obtained by identifying a reference meteorological image using a meteorological image prediction model, wherein the meteorological image prediction model is used to predict the target meteorological characteristics at the target moment based on the meteorological characteristics in two successive frames of reference meteorological images and the time relationship, thereby outputting a meteorological image with the target meteorological characteristics. This scheme does not limit this.
[0153] Through the above content, when the meteorological image at the target time is missing in the candidate image sequence composed of multiple meteorological images, the meteorological image at the target time is predicted by using the reference meteorological images before and after the target time, thereby avoiding the impact of the missing meteorological image on the accuracy of the predicted meteorological information, and then by adjusting the resolution of the meteorological image, the accuracy of the meteorological prediction model in identifying the meteorological features in the meteorological image is guaranteed, thereby ensuring the accuracy of the output result.
[0154] As an optional embodiment, the using the plurality of the second sub-images to convert a target meteorological image for the target area includes:
[0155] Acquire position index information of the second sub-image, wherein the position index information is used to indicate the position of the sub-region corresponding to the second sub-image in the target area;
[0156] The second sub-images are spliced according to the position index information to obtain the target meteorological image.
[0157] Optionally, in an embodiment of the present application, the location index information may include but is not limited to the coordinate position of the image boundary of the second sub-image in the initial meteorological image, or may also be the coordinate position of the boundary of the sub-area corresponding to the second sub-image in the target area, which is not limited in this solution.
[0158] As an optional embodiment, the using the plurality of the second sub-images to convert a target meteorological image for the target area includes:
[0159] Determining a reference image region corresponding to each of the meteorological prediction models in the initial meteorological image, wherein the meteorological prediction model is used to predict meteorological information for the input first sub-image belonging to the reference image region;
[0160] The second sub-images are arranged according to the image extraction information of the reference image area, and the arranged second sub-images are spliced to obtain the target meteorological image, wherein the image extraction information is used to indicate the extraction order of extracting the first sub-images from the initial meteorological image.
[0161] Optionally, in an embodiment of the present application, a plurality of reference image regions are divided in the initial meteorological image according to the number of image processors, and each meteorological prediction model is used to predict meteorological information for the first sub-image in the corresponding reference image region.
[0162] Optionally, in an embodiment of the present application, the method of dividing the reference image area may include but is not limited to dividing the initial meteorological image into multiple rows according to the number of image processors, each row being a reference image area, or dividing the initial meteorological image into multiple columns according to the number of image processors, each column being a reference image area, and this scheme does not impose any limitation on this.
[0163] The embodiment of the present application provides a method for processing multi-channel data of meteorological satellites for AI weather forecasting, which includes four parts. The first part is to obtain intermediate data from satellite products; the second part is to process intermediate data. This part proposes a highly flexible cropping strategy that takes into account the characteristics of meteorological forecasting. If the satellite data processed by this method only uses data from a single moment as input data for a deep learning model, it is in the shape of image data (batch_size, channel, height, width); if data from multiple moments are used as input data for a deep learning model, it is in the shape of video data (batch_size, channel, depth, height, width). Therefore, both meteorological and non-meteorological professionals can process data based on this method very conveniently and friendly or apply the processed data to a deep learning model. The third part combines hardware and cropping strategies to explain the parallel strategy of cropped data during multi-card training. The fourth part explains how the model trained based on cropped data can output image stitching after inference to obtain the forecast result for the entire area.
[0164] Since meteorological satellite data is widely used, the meteorological satellite multi-channel data processing method for AI weather forecasting disclosed in the embodiment of the present application is mainly divided into two parts. The first part is the processing of satellite products, which mainly includes projection conversion, area extraction, time alignment, missing measurement processing and file merging to obtain intermediate data, and provides a complete process and method; the second part is the processing of intermediate data. We propose a flexible cropping strategy that is targeted at the data characteristics in the meteorological field and takes into account the limitations of memory capacity and video memory capacity. It mainly includes flexible specification of the size of the output image and the input image and the number of input and output moments, and then calculates the virtual boundary and virtual input area according to the output image size. Finally, the input image centered on the output image is cropped according to the size of different output images and the size of the boundary around the output image, thereby obtaining input data and output data that can be directly applied to the deep learning model.
[0165] Figure 4 is an optional image processing flow chart according to an embodiment of the present application, such as Figure 4 As shown, at least the following steps are included:
[0166] Step 1: Prepare satellite data products. Let’s take satellite data products as an example.
[0167] Step 2: Create a directory structure: There are two directories, data and data_process, under the satellite data directory. Taking 20203 as an example, there is a 202003 directory under data and data_process respectively. data / 202003 stores the downloaded raw data, and data_process / 202003 stores the data processing code. There is a data directory under data_process / 202003. In this directory, 061 ... 091 (61 to 91 are the natural days of March in 2020, i.e. Day of Year) directories are generated. These directories are used to store the processed result data;
[0168] Step 3: Data processing: This includes (1) projection conversion, converting the nominal projection to a latitude and longitude projection, then (2) specifying the latitude and longitude boundaries to extract the area to be forecasted, and finally (3) interpolating the data of all channels of the satellite data to the same resolution. Specifically, the python library glob is used to list the original data list (1 file for 1 moment, 1 file every 10 minutes, 144 files per day, and 4464 files in March 2020), and then the scene in the python library satpy is used to load the data of each of the 16 channels in each file, and then the projection after conversion is specified as the latitude and longitude projection and the longitude and latitude of the central area, and the projection conversion is performed using create_area_def in the python library pyresample and Scene in satpy. Then, according to the forecast area, the longitude and latitude of the four vertices of the rectangular area to be extracted and the resolution after interpolation are specified for regional extraction and resolution unification. Finally, the processed data is saved as a png image for each channel at each moment, and the image is named after the date (year, month, day, hour, and minute) of the corresponding moment.
[0169] Step 4: Generate intermediate data (initial meteorological image): including (1) looping to read png data of all channels every 10 minutes every day within one month; then perform (2) file missing and value missing processing, that is, first generate a date sequence with an interval of, for example, 10 minutes, and then determine the date of the file (year, month, day, hour and minute) according to the file name, so as to assign values to the array of the time when the two are consistent. If the file of a certain time is missing, the value of this time is the default value, and the missing values of all channels are unified as a default value; then (3) save the processed values in the netcdf file, and finally (4) merge the files, that is, merge one netcdf file at one time into one netcdf file containing all the time in one month. This part can be completed based on the existing tool NCO. Taking March 2020 as an example, 4464 netcdf files are merged into one netcdf file containing data of 4464 time points.
[0170] The purpose of the above steps is to generate intermediate data for use in the second part of the method. The so-called intermediate data is a netcdf file for one month, named after the year and month. The data is a latitude and longitude projection, i.e. grid data, containing four one-dimensional variables: time, channel, latitude (altitude), longitude (width) and one four-dimensional variable (time, channel, latitude / altitude, longitude / width), which stores satellite observation data.
[0171] Figure 5 is an optional image division schematic diagram according to an embodiment of the present application, such as Figure 5 As shown, for the actual shape of the intermediate data image (initial meteorological image) of a channel at a fixed time, that is, the shape of the intermediate data (width is w, height is h) and the size of the cropped AI weather forecast model output image (i.e., the second sub-image) (shaded square, width and height are both output_size (target output size)) and the input image (i.e., the first sub-image) when the width and height input_size (input size) are set to 2 times the output_size (the size indicated in the figure is the solid box of the target input size). The rectangle formed by the overlapping input images corresponding to all output images is a virtual shape (the dotted rectangle in the figure, width is w', height is h'), and the data of the part that does not overlap the virtual shape and the actual shape defaults to the default value. The weather forecast area is the area composed of all squares with output_size as the side length in the rectangle indicated by the initial meteorological image in the figure.
[0172] In the second part of a method for processing multi-channel data of meteorological satellites for AI weather forecasting, we proposed a cropping strategy targeting the characteristics of meteorological data. For the weather forecast of a certain area, in addition to using the meteorological information of the area, the meteorological information of the surrounding areas is also needed. Therefore, when performing AI weather forecasting, the size of the input image can be an integer multiple of the output image, such as 1 times or 8 times, etc., depending on the forecast duration. Generally, the longer the forecast duration, the larger the surrounding area. In addition, future weather changes are related to the weather at the current moment and the past moments. Therefore, when predicting the weather image at a future moment, the weather image at the current moment and the weather images at certain moments in the past are required. In summary, the cropping strategies targeting the characteristics of meteorological data are as follows:
[0173] (1) First, specify num_input_frames to indicate how many images of the current and past moments need to be input; num_output_frames to indicate how many images of the past moments need to be predicted; num_sum_frames to indicate the sum of num_input_frames and num_output_frames; w and h are the width and height of the intermediate data image, respectively; output_size is the size of the output image; input_size is the size of the input image, which is an integer multiple of output_size; data is the satellite data, i.e. the intermediate data obtained in the first part; data' is the virtual shape array of the intermediate data, input is the cropped input image; output is the cropped output image. The number of images num_input_frames to input, the number of images num_output_frames to output, the size of the output image output_size, and the number of times the input image size is the output image size can all be flexibly specified in the above variables, but the size limit of the video memory needs to be taken into consideration. Figure 5 The actual shape of the intermediate data image of a channel at a fixed time, the output image, and the input image when input_size is set to twice the output_size are shown. The rectangle formed by the overlapping input images corresponding to all output images is a virtual shape (the dotted rectangle in the figure has a width of w' and a height of h'). The data of the part that does not overlap the virtual shape and the actual shape is defaulted by the default value. The weather forecast area is the area composed of all squares with a side length of output_size within the actual shape.
[0174] (2) The calculation formulas for the virtual shape width w' and height h' of the intermediate data are as follows:
[0175]
[0176] / / indicates integer division, and * indicates multiplication. h / / output_size indicates the number of output images that can be cropped in the height direction, and w / / output_size indicates the number of output images that can be cropped in the width direction.
[0177] h'=h+ h_increase*2;
[0178] w'=w+w_increase*2.
[0179] (3) Assign values to the virtual shapes of the intermediate data, i.e., the values of the dotted rectangle and the rectangle of the initial meteorological image, and assign default values to the rest.
[0180] h_start_index = h_increase;
[0181] h_end_index = h_increase + h;
[0182] w_start_index = w_increase;
[0183] w_end_index = w_increase + w;
[0184] data'[h_start_index:h_end_index,w_start_index:w_end_index] = data.
[0185] (4) Considering the limitation of memory capacity, only the data of num_sum_frames time moments data'_slice is read from data' each time, and then data'_slice is cropped in a way that the output images do not overlap. At each moment, each channel is cropped out each time.
[0186] k = ( h / / output_size)*( w / / output_size);
[0187] Where num_target_h= h / / output_size, num_target_w= w / / output_size.
[0188] (5) Then calculate the index of each input image and output image after cropping, and assign values to input and output. The code is as follows:
[0189]
[0190] Considering the column priority or row priority of different implementations, the inner and outer layers of the above loops can be interchanged, that is, corresponding to the column priority cropping strategy and the row priority cropping strategy to improve performance. After the above steps, the intermediate data is cropped in the specified way, and the input and output for the deep learning model are obtained. When the input image and output image are specified to contain data at only one moment, it is the shape of the image data. When the input image or output image contains data at multiple moments, it is the shape of the video data. Then, the deep learning model in the field of image processing or computer vision can be used for training and reasoning of meteorological data.
[0191] The third part of the embodiment of the present application is to reasonably specify the parallel strategy during training and reasoning for the size of the input image and the output image, as well as the number of images at the input moment and the number of images at the output moment, so as to make full use of the GPU's video memory. For the parallel strategy during training, in addition to using data parallelism, if you want to forecast the weather at multiple moments at the same time, you can also parallelize in the forecast time dimension. Then, by checking the video memory size used when setting different batch sizes for training, you can appropriately increase or decrease the batch size or the number of input and output image moments to confirm the maximum batch size and the number of input and output image moments that can be supported under the current video memory size limit and when the input and output image size is determined, or adjust the size of the cropped input and output images. The order of the cropped input and output images can be disrupted during training, but the cropped images need to be read in sequence during reasoning. For the case of using only one card, you only need to read the input images in sequence for reasoning. In order to improve the reasoning speed, multi-card parallelism can also be used during reasoning. At this time, the parallel strategy is related to the above cropping strategy. When the column-first method is used for data cropping, when multi-card inference is used, one column of data uses one or more GPU cards, and then the input image is read from left to right for inference; when the row-first method is used for data cropping, when multi-card inference is used, one row of data uses one or more GPU cards, and then the input image is read from top to bottom for inference.
[0192] Figure 6 This is an optional image division diagram according to an embodiment of the present application. Figure 1 ,like Figure 6 As shown in the figure, when using the column-first method for data cropping, multi-card inference is used. One column of data uses one or more GPU cards, and then the input images are read from left to right for inference.
[0193] Figure 7 This is an optional image division diagram according to an embodiment of the present application. Figure 2 ,like Figure 7As shown in the figure, when using the row-first method for data cropping, multi-card inference is used. One row of data uses one or more GPU cards, and then the input image is read from top to bottom for inference.
[0194] The fourth part of the embodiment of the present application is about the stitching and merging of the output images after reasoning and the verification of stitching accuracy. For images that are cropped using a single card reasoning and a column-first strategy, it is only necessary to splice the output image along the column direction by h / / output_size, and then splice w / / output_size columns along the row direction, and finally obtain an image of the entire forecast area; for images that are cropped using a single card reasoning and a row-first strategy, it is only necessary to splice the output image along the row direction by w / / output_size, and then splice h / / output_size rows along the column direction, and finally obtain an image of the entire forecast area. For images that use multi-card inference and are cropped using the column-first strategy, according to the specified GPU order, all the output images after each GPU inference are spliced together along the column direction, and then each column of h / / output_size images is cropped into w / / output_size columns, and finally spliced from left to right to obtain the image of the entire forecast area; for images that use multi-card inference and are cropped using the row-first strategy, according to the specified GPU order, all the output images after each GPU inference are spliced together along the row direction, and then each row of w / / output_size images is cropped into h / / output_size rows, and finally spliced from top to bottom to obtain the image of the entire forecast area. At the same time, the longitude and latitude corresponding to the output image area in the input image are spliced together according to the above method, and finally the longitude and latitude images are output to confirm whether the longitude increases monotonically from left to right and whether the latitude decreases monotonically from top to bottom. If so, there is no problem with the spliced forecast area image.
[0195] The embodiment of the present application provides a method for processing multi-channel data of meteorological satellites for AI weather forecasting. The reason for proposing this method is that with the development of AI weather forecasting, the satellite data processing process used by it faces great professionalism and complexity, which brings great challenges to its wide application. The method disclosed in the present invention not only provides a complete process for satellite data processing, but also provides a detailed processing method. In addition, a flexible clipping strategy is proposed for the characteristics of data in the meteorological field and taking into account the limitations of memory capacity and video memory capacity. By adopting this strategy, input data and output data that can be directly used for deep learning models can be obtained. If the satellite data processed by this method only uses data at a single moment as input data for the deep learning model, it is in the shape of image data (batch_size, channel, height, width); if data at multiple moments are used as input data for the deep learning model, it is in the shape of video data (batch_size, channel, depth, height, width). In addition, the cropped image memory and video memory are smaller, so that excellent AI models in fields such as image processing and computer vision can be smoothly applied to the meteorological field for training or fine-tuning of AI weather forecast models. This invention greatly reduces the threshold for applying AI to the meteorological field. Based on the processed data, people in the meteorological field or other professions can use deep learning models in the field of image processing or computer vision to train and reason about meteorological data, thereby rapidly advancing the development of AI weather forecasting. Then, the parallel strategy for multi-card training of cropped data was explained in combination with the cropping strategy and hardware. Finally, it was shown how the model trained based on the cropped data can perform image stitching after reasoning to obtain the forecast results for the entire area.
[0196] The above embodiment not only solves the problem of the complete process and method of satellite data processing, but also proposes a flexible cropping strategy that targets the data characteristics in the meteorological field and takes into account the limitations of memory capacity and video memory capacity, thereby obtaining input data and output data in the shape of images or videos that can be directly input into the deep learning model.
[0197] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0198] In this embodiment, a forecasting device for meteorological information is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0199] Figure 8 According to the structural block diagram of the meteorological information prediction device of the embodiment of the present application, the meteorological prediction system includes a processor and multiple graphics processors, the processor is connected to each of the graphics processors respectively, and a meteorological prediction model is deployed on each of the graphics processors. The meteorological prediction model is used to predict the meteorological information that will appear in the input area based on the meteorological information that has appeared in the input area. The device is applied to the processor, such as Figure 8The device comprises: a generating module, which is used to generate image positioning information of multiple sub-regions of the target area according to the meteorological forecast information of the meteorological forecast model, wherein the meteorological forecast information is generated according to the memory occupation of the initial meteorological image and the memory capacity of the graphics processor, and the meteorological forecast information is used to indicate the size of the sub-region that the meteorological forecast model allows to predict meteorological information at a time, the initial meteorological image records the meteorological information that has appeared in the target area, and the image positioning information is used to indicate the position of the meteorological information of the sub-region in the initial meteorological image; a first extracting module, which is used to extract multiple first sub-images from the initial meteorological image according to the image positioning information, wherein each of the first sub-images records the meteorological information of the sub-region and the surrounding area of the sub-region in the target area; a sending module, which is used to send the first sub-image to the corresponding graphics processor to obtain a second sub-image output by the meteorological forecast model, wherein the second sub-image records the meteorological information that will appear in the corresponding sub-region; a first converting module, which is used to convert a target meteorological image for the target area using multiple second sub-images, wherein the target meteorological image is used to indicate the meteorological information that will appear in the target area.
[0200] Through the above content, the weather forecast system includes multiple graphics processors, each of which is deployed with a weather forecast model, and then when predicting the weather image of the target area after the current moment, the weather forecast information is generated according to the memory usage of the initial weather image of the target area and the memory capacity of the graphics processor, so as to obtain the size of the sub-area of the single cloud image forecast of the weather information of the weather forecast model, and then the image positioning information of the sub-area is generated according to the weather information, and the first sub-image recording the weather information of the sub-area and the surrounding area in the initial weather image is extracted according to the image positioning information and sent to the corresponding graphics processor for processing, and the second sub-image output by the weather forecast model on the graphics processor is converted into the target weather image of the target area, so as to realize the initial weather image is split into multiple first sub-images according to the memory usage of the initial weather image and the memory capacity of the graphics processor, and the multiple first sub-images are distributed to the weather forecast models on different graphics processors for processing, thereby reducing the memory usage of the weather image on the graphics processor and accelerating the prediction speed of the weather forecast model on the weather image. Therefore, the problem of low prediction efficiency of weather information in the related technology can be solved, and the effect of improving the prediction efficiency of weather information can be achieved.
[0201] Optionally, the first extraction module includes:
[0202] an identification unit, configured to identify, on the initial meteorological image, a third sub-image indicated by the image positioning information, wherein the meteorological information of the corresponding sub-area is recorded in the third sub-image;
[0203] A first processing unit is configured to expand the third sub-image in the initial meteorological image according to a regional parameter of the meteorological forecast model to obtain an image position of the first sub-image in the initial meteorological image, wherein the regional parameter is used to indicate a size relationship between the sub-region and the surrounding region;
[0204] An extraction unit is used to extract the first sub-image from the initial meteorological image according to the image position.
[0205] Optionally, the first processing unit is configured to:
[0206] Calculating a second size of an image recording the surrounding area according to a first size of a sub-image recording meteorological information of the sub-area and an area ratio, wherein the area ratio is used to indicate a proportional relationship between areas of the sub-area and the surrounding area, and the area parameter includes the area ratio;
[0207] Determine an outward expansion size of the third sub-image according to the first size and the second size;
[0208] The third sub-image is expanded according to the expanded size to obtain the first sub-image.
[0209] Optionally, the first processing unit is configured to:
[0210] Calculating a first difference between a second length and a first length, wherein the first size includes the first length and the second size includes the second length; determining half of the first difference as an outward expansion length of the third sub-image, wherein the outward expansion size includes the outward expansion length;
[0211] A second difference between the second width and the first width is calculated, wherein the first size includes the first width and the second size includes the second width; and half of the second difference is determined as an expansion width of the third sub-image, wherein the expansion size includes the expansion width.
[0212] Optionally, the generating module includes:
[0213] An acquisition unit, configured to acquire the initial meteorological image of the target area before the current moment, wherein the initial meteorological image records the meteorological information of the target area;
[0214] A first generating unit, configured to generate the meteorological forecast information of the meteorological forecast model according to the memory usage of the initial meteorological image and the memory capacity of each of the graphics processors;
[0215] The second generating unit is configured to generate the image positioning information of the plurality of sub-areas according to the weather forecast information.
[0216] Optionally, the second generating unit is used to:
[0217] generating a target size of an image area of the meteorological information to be predicted in the initial meteorological image according to a first size of a sub-image recording the meteorological information of the sub-area and an image size of the initial meteorological image, wherein the meteorological forecast information includes the first size;
[0218] Dividing a target image area satisfying the target size in the initial meteorological image;
[0219] Sequentially dividing the target image area into third sub-images corresponding to each of the sub-areas according to the first size, wherein the third sub-images record the meteorological information of the corresponding sub-areas;
[0220] The position information of the third sub-image in the initial meteorological image is determined as the image positioning information.
[0221] Optionally, the second generating unit is used to:
[0222] Obtaining a first quotient obtained by dividing an initial length of the initial meteorological image by a first length, wherein the image size includes the initial length and the first size includes the first length; determining a product value of the first quotient and the first length as a reference length of an image region of the meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference length;
[0223] Obtain a second quotient obtained by dividing an initial width of the initial meteorological image by a first width, wherein the image size includes the initial width and the first size includes the first width; determine a product value of the second quotient and the first width as a reference width of an image area of meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference width.
[0224] Optionally, the second generating unit is configured to perform one of the following operations:
[0225] In a case where the image size of the initial meteorological image is larger than the target size, intercepting an image area of the target size at the center of the initial meteorological image as the target image area;
[0226] When the image size of the initial meteorological image is equal to the target size, the entire image area of the initial meteorological image is used as the target image area.
[0227] Optionally, the first generating unit is used to:
[0228] Acquiring a regional parameter of the meteorological forecast model, wherein the regional parameter is used to indicate a size relationship between the sub-region and the surrounding region;
[0229] The first size of the sub-image that records the meteorological information of the sub-region in the initial meteorological image corresponding to the memory occupancy of the initial meteorological image, the current memory capacity of the graphics processor and the current regional parameters is determined from the corresponding meteorological image memory occupancy, the memory capacity of the graphics processor, the regional parameters and the sub-image size, wherein the meteorological forecast information includes the first size.
[0230] Optionally, the device further comprises:
[0231] A first acquisition module is used to acquire satellite images collected by the satellite device in a reference time period before the current moment before acquiring the initial meteorological image of the target area before the current moment;
[0232] A second conversion module is used to perform projection conversion on the satellite image to obtain a latitude and longitude projection;
[0233] A second acquisition module is used to acquire the coordinate position of the target area;
[0234] A second extraction module is used to extract the candidate meteorological image of the target area at the latitude and longitude projection of each of the reference moments in the reference time period according to the coordinate position;
[0235] The third conversion module is used to convert the candidate meteorological image into the initial meteorological image.
[0236] Optionally, the third conversion module includes:
[0237] A sorting unit, used for sorting the plurality of candidate meteorological images according to the order of the plurality of reference moments to obtain a candidate image sequence;
[0238] A first acquisition unit is used to acquire reference meteorological images of adjacent moments before and after the target moment in the candidate image sequence when it is determined that the candidate image sequence lacks multiple meteorological images of the target moment in the reference moment;
[0239] A third generating unit, configured to generate the meteorological image at the target moment according to the reference meteorological image;
[0240] A second processing unit, configured to add the generated meteorological image at the target moment to a position corresponding to the target moment in the candidate image sequence to obtain a target image sequence;
[0241] The adjustment unit is used to adjust the resolution of each meteorological image in the target image sequence in chronological order to obtain the initial meteorological image.
[0242] Optionally, the first conversion module includes:
[0243] A second acquisition unit, configured to acquire position index information of the second sub-image, wherein the position index information is used to indicate a position of a sub-region corresponding to the second sub-image in the target area;
[0244] The first splicing unit is used to splice the second sub-images according to the position index information to obtain the target meteorological image.
[0245] Optionally, the first conversion module includes:
[0246] a determination unit, configured to determine a reference image region corresponding to each of the meteorological prediction models in the initial meteorological image, wherein the meteorological prediction model is used to perform meteorological information prediction on the input first sub-image belonging to the reference image region;
[0247] A second stitching unit is used to arrange the second sub-images according to the image extraction information of the reference image area, and stitch the arranged second sub-images to obtain the target meteorological image, wherein the image extraction information is used to indicate the extraction order of extracting the first sub-images from the initial meteorological image.
[0248] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0249] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0250] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0251] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0252] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0253] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0254] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0255] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0256] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0257] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0258] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for predicting meteorological information, characterized in that: The weather forecasting system includes a processor and a plurality of graphics processors, wherein the processor is connected to each of the graphics processors respectively, and a weather forecasting model is deployed on each of the graphics processors, wherein the weather forecasting model is used to forecast the weather information that will appear in the input area according to the weather information that has appeared in the input area, and the method is applied to the processor, and includes: Generate image positioning information of multiple sub-regions of a target area according to the meteorological forecast information of the meteorological forecast model, wherein the multiple sub-regions cover the entire area of the target area, the meteorological forecast information is generated according to the memory usage of the initial meteorological image and the memory capacity of the graphics processor, the meteorological forecast information is used to indicate the size of the sub-region that the meteorological forecast model allows to predict meteorological information at a single time, the initial meteorological image records the meteorological information that has appeared in the target area, and the image positioning information is used to indicate the position of the meteorological information of the sub-region in the initial meteorological image; Extracting a plurality of first sub-images from the initial meteorological image according to the image positioning information, wherein each of the first sub-images records the meteorological information of the sub-region and the surrounding area of the sub-region in the target area; Sending the first sub-image to the corresponding graphics processor to obtain a second sub-image output by the weather forecast model, wherein the second sub-image records the weather information that will occur in the corresponding sub-area; A plurality of the second sub-images are used to convert a target meteorological image for the target area, wherein the target meteorological image is used to indicate the meteorological information that will occur in the target area.
2. The method according to claim 1, characterized in that The step of extracting a plurality of first sub-images from the initial meteorological image according to the image positioning information comprises: Identifying a third sub-image indicated by the image positioning information on the initial meteorological image, wherein the third sub-image records the meteorological information of the corresponding sub-area; Expanding the third sub-image in the initial meteorological image according to the regional parameters of the meteorological forecast model to obtain the image position of the first sub-image in the initial meteorological image, wherein the regional parameters are used to indicate the size relationship between the sub-region and the surrounding region; The first sub-image is extracted from the initial meteorological image according to the image position.
3. The method according to claim 2, characterized in that The step of expanding the third sub-image according to the regional parameters of the meteorological forecast model in the initial meteorological image to obtain the image position of the first sub-image in the initial meteorological image comprises: Calculating a second size of an image recording the surrounding area according to a first size of a sub-image recording meteorological information of the sub-area and an area ratio, wherein the area ratio is used to indicate a proportional relationship between areas of the sub-area and the surrounding area, and the area parameter includes the area ratio; Determine an outward expansion size of the third sub-image according to the first size and the second size; The third sub-image is expanded according to the expanded size to obtain the first sub-image.
4. The method according to claim 3, characterized in that The step of determining the outer expansion size of the third sub-image according to the first size and the second size includes: Calculating a first difference between a second length and a first length, wherein the first size includes the first length and the second size includes the second length; determining half of the first difference as an outward expansion length of the third sub-image, wherein the outward expansion size includes the outward expansion length; A second difference between the second width and the first width is calculated, wherein the first size includes the first width and the second size includes the second width; and half of the second difference is determined as an expansion width of the third sub-image, wherein the expansion size includes the expansion width.
5. The method according to claim 1, characterized in that The step of generating image positioning information of a plurality of sub-areas of the target area according to the meteorological forecast information of the meteorological forecast model comprises: Acquire the initial meteorological image of the target area before the current moment, wherein the initial meteorological image records the meteorological information of the target area; Generating the weather forecast information of the weather forecast model according to the memory usage of the initial weather image and the memory capacity of each of the graphics processors; The image positioning information of the plurality of sub-areas is generated according to the weather forecast information.
6. The method according to claim 5, characterized in that The step of generating the image positioning information of the plurality of sub-areas according to the weather forecast information comprises: generating a target size of an image area of the meteorological information to be predicted in the initial meteorological image according to a first size of a sub-image recording the meteorological information of the sub-area and an image size of the initial meteorological image, wherein the meteorological forecast information includes the first size; Dividing a target image area satisfying the target size in the initial meteorological image; Sequentially dividing the target image area into third sub-images corresponding to each of the sub-areas according to the first size, wherein the third sub-images record the meteorological information of the corresponding sub-areas; Determining position information of the third sub-image in the initial meteorological image as the image positioning information; The method of generating a target size of an image area of meteorological information to be predicted in the initial meteorological image based on a first size of a sub-image recording meteorological information of the sub-area and an image size of the initial meteorological image includes: obtaining a first quotient obtained by dividing an initial length of the initial meteorological image by a first length, wherein the image size includes the initial length and the first size includes the first length; determining a product value of the first quotient and the first length as a reference length of the image area of meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference length; obtaining a second quotient obtained by dividing an initial width of the initial meteorological image by a first width, wherein the image size includes the initial width and the first size includes the first width; determining a product value of the second quotient and the first width as a reference width of the image area of meteorological information to be predicted in the initial meteorological image, wherein the target size includes the reference width.
7. The method according to claim 6, characterized in that The step of dividing the target image area satisfying the target size in the initial meteorological image comprises one of the following: In a case where the image size of the initial meteorological image is larger than the target size, intercepting an image area of the target size at the center of the initial meteorological image as the target image area; When the image size of the initial meteorological image is equal to the target size, the entire image area of the initial meteorological image is used as the target image area.
8. The method according to claim 5, characterized in that The step of generating the meteorological forecast information of the meteorological forecast model according to the memory occupation amount of the initial meteorological image and the memory capacity of each of the graphics processors includes: Acquiring a regional parameter of the meteorological forecast model, wherein the regional parameter is used to indicate a size relationship between the sub-region and the surrounding region; The first size of the sub-image that records the meteorological information of the sub-region in the initial meteorological image corresponding to the memory occupancy of the initial meteorological image, the current memory capacity of the graphics processor and the current regional parameters is determined from the corresponding meteorological image memory occupancy, the memory capacity of the graphics processor, the regional parameters and the sub-image size, wherein the meteorological forecast information includes the first size.
9. The method according to claim 5, characterized in that Before acquiring the initial meteorological image of the target area before the current moment, the method further includes: Obtain satellite images collected by the satellite device in the reference time period before the current time; Performing projection conversion on the satellite image to obtain longitude and latitude projection; Obtaining the coordinate position of the target area; Extracting a candidate meteorological image of the target area at the latitude and longitude projection of each of the reference moments in the reference time period according to the coordinate position; The candidate meteorological image is converted into the initial meteorological image.
10. The method according to claim 9, characterized in that The converting the candidate meteorological image into the initial meteorological image comprises: Sorting the plurality of candidate meteorological images according to the order of the plurality of reference moments to obtain a candidate image sequence; When it is determined that the candidate image sequence lacks a plurality of meteorological images at the target moment in the reference moments, obtaining reference meteorological images at adjacent moments before and after the target moment in the candidate image sequence; generating a meteorological image at the target time according to the reference meteorological image; Adding the generated meteorological image at the target time to a position corresponding to the target time in the candidate image sequence to obtain a target image sequence; The resolution of each meteorological image in the target image sequence is adjusted in chronological order to obtain the initial meteorological image.
11. The method according to claim 1, characterized in that: The step of converting a target meteorological image for the target area using the plurality of the second sub-images comprises: Acquire position index information of the second sub-image, wherein the position index information is used to indicate the position of the sub-region corresponding to the second sub-image in the target area; The second sub-images are spliced according to the position index information to obtain the target meteorological image.
12. The method according to claim 1, characterized in that The step of converting a target meteorological image for the target area using the plurality of the second sub-images comprises: Determining a reference image region corresponding to each of the meteorological prediction models in the initial meteorological image, wherein the meteorological prediction model is used to predict meteorological information for the input first sub-image belonging to the reference image region; The second sub-images are arranged according to the image extraction information of the reference image area, and the arranged second sub-images are spliced to obtain the target meteorological image, wherein the image extraction information is used to indicate the extraction order of extracting the first sub-images from the initial meteorological image.
13. A weather information prediction device, characterized in that: The weather forecast system includes a processor and a plurality of graphics processors, wherein the processor is connected to each of the graphics processors respectively, and a weather forecast model is deployed on each of the graphics processors, wherein the weather forecast model is used to forecast the weather information that will appear in the input area according to the weather information that has appeared in the input area, and the device is applied to the processor, and includes: A generating module, configured to generate image positioning information of a plurality of sub-regions of a target region according to the meteorological forecast information of the meteorological forecast model, wherein the plurality of sub-regions cover the entire region of the target region, the meteorological forecast information is generated according to the memory usage of the initial meteorological image and the memory capacity of the graphics processor, the meteorological forecast information is used to indicate the size of the sub-regions that the meteorological forecast model allows to predict meteorological information at a single time, the initial meteorological image records the meteorological information that has appeared in the target region, and the image positioning information is used to indicate the position of the meteorological information of the sub-region in the initial meteorological image; A first extraction module, configured to extract a plurality of first sub-images from the initial meteorological image according to the image positioning information, wherein each of the first sub-images records the meteorological information of the sub-region and the surrounding area of the sub-region in the target area; A sending module, used for sending the first sub-image to the corresponding graphics processor to obtain a second sub-image output by the weather forecast model, wherein the second sub-image records the weather information that will appear in the corresponding sub-area; The first conversion module is used to convert a target meteorological image for the target area using a plurality of the second sub-images, wherein the target meteorological image is used to indicate the meteorological information that will appear in the target area.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 12 when executed by a processor.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 12 are implemented.
