Meteorological characterization method and device of meteorological data, storage medium and electronic device
Through the characterization learning of meteorological data, samples are constructed using temporal and spatial nearest neighbor strategies and meteorological models are trained, the problem of insufficient meteorological prediction accuracy is solved, and more efficient meteorological data characterization and prediction are achieved.
Patent Information
- Application Number
- CN202411327603.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-14
AI Technical Summary
In the field of meteorological prediction, insufficient characterization learning of meteorological data leads to insufficient meteorological prediction accuracy, and no effective solution has been obtained.
By splicing the height layers of meteorological elements to generate meteorological vectors, and using temporal and near-neighbor strategies to construct positive and negative samples, the target meteorological model is trained according to the target loss function, and the positive sample similarity is maximized and negative sample similarity is minimized. for meteorological characterization.
The accuracy of meteorological prediction is improved, and the meteorological data is effectively characterized through the trained target meteorological model, which improves the accuracy of prediction.
Smart Images

Figure CN119312271A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and more specifically, to a meteorological characterization method and device, a storage medium, and an electronic device for meteorological data. Background Art
[0002] Guided by the national strategic goals of carbon peak and carbon neutrality, and against the backdrop of the revolutionary development of a new generation of information technology represented by big data, cloud computing, and artificial intelligence, my country's energy industry is undergoing a broad and in-depth systematic revolution. Meteorological science and technology are playing an increasingly important role in the global energy transformation and my country's dual carbon realization process. Meteorological data has also become a core production factor required for the high-quality development of the new energy industry and the promotion of the digital transformation of power companies.
[0003] In recent years, with the rapid popularization of high-performance computing power and the continuous improvement of the availability of massive data, artificial intelligence technology has developed rapidly, providing new methods and tools for improving the level of weather forecasting and prediction. Artificial intelligence has been applied to short-term forecasting, El Niño prediction, numerical forecast model interpretation, disaster weather identification and prediction, etc. In particular, the global weather forecast model based on deep learning has received great attention and development at home and abroad recently, and has become a strong competitor to the traditional numerical forecast model.
[0004] However, although artificial intelligence has been widely used and paid attention to in the field of meteorology, the focus on the representation learning of meteorological data is still relatively weak. Learning better representation of meteorological data can help neural networks better learn the characteristics of meteorological data and complete a wide range of downstream tasks.
[0005] There is no effective solution to the problem of insufficient meteorological forecasting accuracy caused by insufficient representation learning of meteorological data. Summary of the invention
[0006] The embodiments of the present application relate to a meteorological characterization method and device, a storage medium and an electronic device for meteorological data. Through the embodiments of the present application, the problem of insufficient meteorological forecasting accuracy caused by insufficient characterization learning of meteorological data can be solved.
[0007] According to an embodiment of the embodiments of the present application, a meteorological characterization method for meteorological data is provided, including: splicing first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector; determining the meteorological vector as a first original sample, and constructing a first positive sample and a first negative sample corresponding to the first original sample through a time neighbor strategy and a space neighbor strategy; maximizing the similarity between the first original sample and the first positive sample according to a target loss function to obtain a first training result, and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result; training a target meteorological model according to the first training result and the second training result, so that the trained target meteorological model performs meteorological characterization on the target meteorological data.
[0008] In an exemplary embodiment, a first positive sample and a first negative sample corresponding to the first original sample are constructed by a temporal neighbor strategy and a spatial neighbor strategy, including: constructing a second positive sample and a second negative sample corresponding to the first original sample according to the temporal neighbor strategy; and constructing a third positive sample and a third negative sample corresponding to the first original sample according to the spatial neighbor strategy; determining the second positive sample and the third positive sample as the first positive sample, and determining the second negative sample and the third negative sample as the first negative sample.
[0009] In an exemplary embodiment, a second positive sample and a second negative sample corresponding to the first original sample are constructed according to the time neighbor strategy, including: determining a target moment corresponding to the first original sample, and determining a neighboring time period corresponding to the target moment, wherein the starting moment of the neighboring time period is a moment corresponding to the difference between the target moment and the target time period, and the ending moment of the neighboring time period is a moment corresponding to the sum of the target moment and the target time period; determining the second positive sample according to second meteorological data corresponding to the meteorological element in the neighboring time period; determining the second negative sample according to third meteorological data corresponding to the meteorological element in other time periods, wherein the other time periods are time periods other than the neighboring time periods.
[0010] In an exemplary embodiment, a third positive sample and a third negative sample corresponding to the first original sample are constructed according to the spatial neighbor strategy, including: determining the target longitude and target latitude corresponding to the first original sample, and determining the neighbor spatial range corresponding to the first original sample according to the target longitude and the target latitude, wherein the maximum longitude of the neighbor spatial range is the sum of the target longitude and a first value, the minimum longitude of the neighbor spatial range is the difference between the target longitude and the first value, the maximum latitude of the neighbor spatial range is the sum of the target latitude and a second value, and the minimum latitude of the neighbor spatial range is the difference between the target latitude and the second value; determining the third positive sample according to fourth meteorological data corresponding to the meteorological element within the neighbor spatial range; determining the third negative sample according to fifth meteorological data corresponding to the meteorological element within other spatial ranges, wherein the other spatial ranges are spatial ranges other than the neighbor spatial range.
[0011] In an exemplary embodiment, the third positive sample is determined based on the fourth meteorological data corresponding to the meteorological element within the neighboring spatial range, including: determining the third positive sample based on the fourth meteorological data corresponding to the meteorological element within the neighboring spatial range; determining the target area corresponding to the first original sample; moving the first original sample in sequence by unit longitude or unit latitude within the neighboring spatial range; obtaining the target position of missing data within the target area after each movement of the first original sample; supplementing the missing data of the target position based on the fourth meteorological data; and determining the third positive sample based on the meteorological data within the target area after supplementing the missing data.
[0012] In an exemplary embodiment, the similarity between the first original sample and the first positive sample is maximized according to a target loss function to obtain a first training result, and the similarity between the first original sample and the first negative sample is minimized to obtain a second training result, including: inputting the first original sample, the first positive sample, and the first negative sample into the target meteorological model respectively, so that the target meteorological model outputs a first meteorological characterization result corresponding to the first original sample, a second meteorological characterization result corresponding to the first positive sample, and a third meteorological characterization result corresponding to the first negative sample respectively; inputting the first meteorological characterization result, the second meteorological characterization result, and the third meteorological characterization result into a multilayer perceptron in the target meteorological model respectively, so that the multilayer perceptron performs dimensionality reduction processing on the first meteorological characterization result, the second meteorological characterization result, and the third meteorological characterization result respectively, to obtain a second original sample corresponding to the first original sample, a fourth positive sample corresponding to the first positive sample, and a fourth negative sample corresponding to the first negative sample; training the second original sample, the fourth positive sample, and the fourth negative sample according to the target loss function to maximize the similarity between the second original sample and the fourth positive sample to obtain a first training result, and minimize the similarity between the second original sample and the fourth negative sample to obtain a second training result.
[0013] In an exemplary embodiment, the target meteorological model is trained according to the first training result and the second training result, including: determining the weight corresponding to each training parameter in the target meteorological model according to the first training result and the second training result, and adjusting each training parameter according to the weight; deleting the multilayer perceptron in the target meteorological model to update the target meteorological model; and training the updated target meteorological model according to the adjusted training parameters to obtain the trained target meteorological model.
[0014] According to another embodiment of the embodiment of the present application, a meteorological characterization device for meteorological data is also provided, including: splicing first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector; determining the meteorological vector as a first original sample, and constructing a first positive sample and a first negative sample corresponding to the first original sample through a time neighbor strategy and a space neighbor strategy; maximizing the similarity between the first original sample and the first positive sample according to a target loss function to obtain a first training result, and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result; training a target meteorological model according to the first training result and the second training result, so that the trained target meteorological model performs meteorological characterization on the target meteorological data.
[0015] According to another aspect of the embodiments 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 above method when running.
[0016] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method through the computer program.
[0017] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to perform the method.
[0018] In an embodiment of the present application, the first meteorological data corresponding to the meteorological element is spliced according to the altitude layer of the meteorological element to generate a meteorological vector; the meteorological vector is determined as the first original sample, and the first positive sample and the first negative sample corresponding to the first original sample are constructed by the time neighbor strategy and the space neighbor strategy; the similarity between the first original sample and the first positive sample is maximized according to the target loss function to obtain the first training result, and the similarity between the first original sample and the first negative sample is minimized to obtain the second training result; the target meteorological model is trained according to the first training result and the second training result, so that the trained target meteorological model performs meteorological characterization on the target meteorological data. That is, the present application uses the time neighbor strategy and the space neighbor strategy to construct the first positive sample and the first negative sample corresponding to the first original sample, and maximizes the similarity between the first original sample and the first positive sample according to the target loss function, and minimizes the similarity between the first original sample and the first negative sample to train the target meteorological model, so that the trained target meteorological model can characterize the meteorological data. Through the embodiment of the present application, the problem of insufficient meteorological prediction accuracy caused by insufficient characterization learning of meteorological data in meteorological prediction in the related technology can be solved. Then, the meteorological data is characterized by the trained target meteorological model to improve the accuracy of meteorological forecasts. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 It is a hardware structure block diagram of a computer terminal of a meteorological characterization method of meteorological data in an embodiment of the present application;
[0021] Figure 2is a flow chart of a meteorological characterization method for meteorological data according to an embodiment of the present application;
[0022] Figure 3 is a model architecture diagram of a meteorological element representation model according to an optional embodiment of the present application;
[0023] Figure 4 is a schematic diagram of constructing positive and negative samples through time neighbors according to an optional embodiment of the present application;
[0024] Figure 5 is a schematic diagram (I) of constructing positive and negative samples by spatial nearest neighbors according to an optional embodiment of the present application;
[0025] Figure 6 is a schematic diagram (II) of constructing positive and negative samples by spatial neighbors according to an optional embodiment of the present application;
[0026] Figure 7 It is a structural block diagram of a meteorological characterization device for meteorological data according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices; "plurality" means two or more.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or similar computing device or cloud platform or independent physical server or software platform, wherein the above software platform is run through one or more servers. Taking running on a computer terminal as an example, Figure 11 is a hardware structure block diagram of a computer terminal for a meteorological characterization method of meteorological data in an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. A person skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the methods in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above-mentioned methods are implemented. 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 computer terminal 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.
[0031] 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 a computer terminal. 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.
[0032] In this embodiment, a meteorological characterization method for meteorological data is provided, which is applied to the above-mentioned computer terminal. Figure 2 : is a flow chart of a meteorological characterization method for meteorological data according to an embodiment of the present application, the process includes the following steps:
[0033] Step S202, splicing the first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector;
[0034] Among them, the above-mentioned meteorological elements may include: air pressure, temperature, U wind, V wind, humidity, sea level pressure, etc.
[0035] The above-mentioned altitude layers include: multiple altitude layers and single altitude layers near the surface.
[0036] Step S204, determining the meteorological vector as a first original sample, and constructing a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy;
[0037] Step S206, maximizing the similarity between the first original sample and the first positive sample according to the target loss function to obtain a first training result, and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result;
[0038] Among them, the above-mentioned target loss function can be: information-to-noise ratio contrast loss function (InfoNCE contrastive loss function, referred to as infoNCE loss function for short).
[0039] Step S208: training the target meteorological model according to the first training result and the second training result, so that the trained target meteorological model can perform meteorological representation on the target meteorological data.
[0040] In an embodiment of the present application, the first meteorological data corresponding to the meteorological element is spliced according to the altitude layer of the meteorological element to generate a meteorological vector; the meteorological vector is determined as the first original sample, and the first positive sample and the first negative sample corresponding to the first original sample are constructed by the time neighbor strategy and the space neighbor strategy; the similarity between the first original sample and the first positive sample is maximized according to the target loss function to obtain the first training result, and the similarity between the first original sample and the first negative sample is minimized to obtain the second training result; the target meteorological model is trained according to the first training result and the second training result, so that the trained target meteorological model performs meteorological characterization on the target meteorological data. That is, the present application uses the time neighbor strategy and the space neighbor strategy to construct the first positive sample and the first negative sample corresponding to the first original sample, and maximizes the similarity between the first original sample and the first positive sample according to the target loss function, and minimizes the similarity between the first original sample and the first negative sample to train the target meteorological model, so that the trained target meteorological model can characterize the meteorological data. Through the embodiment of the present application, the problem of insufficient meteorological prediction accuracy caused by insufficient characterization learning of meteorological data in meteorological prediction in the related technology can be solved. Then, the meteorological data is characterized by the trained target meteorological model to improve the accuracy of meteorological forecasts.
[0041] Optionally, the above-mentioned step S204 of constructing a first positive sample and a first negative sample corresponding to the first original sample through a time neighbor strategy and a space neighbor strategy includes: constructing a second positive sample and a second negative sample corresponding to the first original sample according to the time neighbor strategy; and constructing a third positive sample and a third negative sample corresponding to the first original sample according to the space neighbor strategy; determining the second positive sample and the third positive sample as the first positive sample, and determining the second negative sample and the third negative sample as the first negative sample.
[0042] It can be understood that the embodiment of the present application determines the positive sample and the negative sample corresponding to the first original sample by two methods, namely, the second positive sample and the second negative sample corresponding to the first original sample are determined by the time neighbor strategy, and the third positive sample and the third negative sample corresponding to the first original sample are determined by the space neighbor strategy. Among them, the time neighbor strategy and the space neighbor strategy specifically include:
[0043] (1) Constructing a second positive sample and a second negative sample corresponding to the first original sample according to the time neighbor strategy, including: determining a target moment corresponding to the first original sample, and determining a neighboring time period corresponding to the target moment, wherein the starting moment of the neighboring time period is the moment corresponding to the difference between the target moment and the target time period, and the ending moment of the neighboring time period is the moment corresponding to the sum of the target moment and the target time period; determining the second positive sample according to second meteorological data corresponding to the meteorological element in the neighboring time period; determining the second negative sample according to third meteorological data corresponding to the meteorological element in other time periods, wherein the other time periods are time periods other than the neighboring time periods.
[0044] It can be understood that the time neighbor strategy is a strategy for constructing samples based on the temporal continuity of meteorological data. In the field of meteorology, data points that are close in time often have similar meteorological characteristics, such as temperature change trends, wind speed, and humidity during the day. Therefore, for the meteorological data at a specific moment (for example, moment T0) (i.e., the first original sample), the nearest neighbor of the meteorological data on the time axis (for example, the meteorological data a few hours before or after T0) can be used as a positive sample (i.e., the second positive sample), and the samples with a farther time distance can be used as negative samples (i.e., the second negative sample).
[0045] Specific:
[0046] 1) Determine the target time and adjacent time periods:
[0047] First, select a specific moment (i.e., target moment). The specific moment can be any time point used to characterize learning. Second, define a target time period. The target time period can be pre-set, such as a few hours, a few days, etc. The target time period is used to define which data points are neighbors in time, so that the meteorological data in the neighboring time period can be used as positive samples.
[0048] The start time of the adjacent time period is the target time minus the target time period, and the end time is the target time plus the target time period. For example, if the target time is 12:00 and the target time period is 1 hour, then the adjacent time period is from 11:00 to 13:00.
[0049] 2) Construct the second positive sample:
[0050] After determining the adjacent time period, the data with similar meteorological elements to the target time are selected from the meteorological data in the adjacent time period as the second positive samples. These data are adjacent to the target time in time, so they are more likely to be similar in meteorological characteristics.
[0051] The selection of the second positive samples is based on the meteorological elements at the target time, such as air pressure, temperature, wind speed, etc., to ensure that the selected samples are adjacent in time and similar in meteorological characteristics.
[0052] 3) Construct the second negative sample:
[0053] Except for the adjacent time periods, the meteorological data of all other time periods are regarded as “other time periods”. From the meteorological data in other time periods, the data with large differences in meteorological elements from the target time are selected as the second negative samples.
[0054] The selection of the second negative samples is based on the difference with the meteorological data of other time periods, which are farther away from the target moment in time and are therefore more likely to be different in meteorological characteristics.
[0055] The temporal neighbor strategy effectively constructs positive and negative sample pairs, where the positive samples are close to the target moment in time, while the negative samples are far away from the target moment in time. This helps the model learn the similarities and differences of meteorological features in temporal continuity, thereby optimizing the representation learning of meteorological elements.
[0056] (2) constructing a third positive sample and a third negative sample corresponding to the first original sample according to the spatial neighbor strategy, including: determining the target longitude and target latitude corresponding to the first original sample, and determining the neighbor spatial range corresponding to the first original sample according to the target longitude and target latitude, wherein the maximum longitude of the neighbor spatial range is the sum of the target longitude and the first value, the minimum longitude of the neighbor spatial range is the difference between the target longitude and the first value, the maximum latitude of the neighbor spatial range is the sum of the target latitude and the second value, and the minimum latitude of the neighbor spatial range is the difference between the target latitude and the second value; determining the third positive sample according to the fourth meteorological data corresponding to the meteorological element within the neighbor spatial range; determining the third negative sample according to the fifth meteorological data corresponding to the meteorological element within other spatial ranges, wherein the other spatial ranges are spatial ranges other than the neighbor spatial range.
[0057] It can be understood that the spatial neighbor strategy constructs samples based on the spatial continuity of meteorological data. Meteorological data usually has a certain degree of continuity in space, that is, meteorological elements (such as temperature, wind speed, etc.) in geographically adjacent areas often have similar changing trends. Therefore, for the meteorological data (i.e., the first original sample) of a specific area (for example: R0), its spatially adjacent areas (for example, meteorological data of several grid points around R0) can be used as positive samples (recorded as the third positive sample), and the meteorological data of areas farther away from R0 can be used as negative samples (recorded as the third negative sample). Among them, the unit distance between grid points can be unit longitude and / or unit latitude.
[0058] Specific:
[0059] 1) Determine the neighboring space range:
[0060] First, for the first original sample, determine the position of the first original sample in the geographic space, that is, the target longitude and target latitude. Secondly, define a neighboring spatial range based on the target longitude and target latitude. The maximum longitude and minimum longitude of the neighboring spatial range are determined by adding and subtracting a first value (for example, a certain multiple of the grid width) from the target longitude; similarly, the maximum latitude and minimum latitude are determined by adding and subtracting a second value (this value may be the same as the first value, or may be different, depending on the application scenario and data characteristics) from the target latitude.
[0061] 2) Construct the third positive sample:
[0062] Once the neighboring spatial range is determined, data is selected from the fourth meteorological data corresponding to all meteorological elements within the neighboring spatial range as positive samples. These positive sample data usually have similar meteorological characteristics due to their proximity in geographical space.
[0063] For example, if the first original sample is weather data of a specific geographic location, then its positive sample will be other weather data near the geographic location (defined by the first value and the second value).
[0064] 3) Construct the third negative sample:
[0065] Negative samples are selected from the fifth meteorological data corresponding to meteorological elements in other spatial ranges, wherein the other spatial ranges may be all spatial ranges except the neighboring spatial ranges, or may be spatial ranges within a certain spatial range outside the neighboring spatial ranges.
[0066] Negative samples will be meteorological data extracted from geographically distant areas, which have meteorological characteristics that differ greatly from the first original sample due to the spatial distance.
[0067] Wherein, determining the third positive sample according to the fourth meteorological data corresponding to the meteorological element within the neighboring spatial range includes: determining the third positive sample according to the fourth meteorological data corresponding to the meteorological element within the neighboring spatial range; determining the target area corresponding to the first original sample; moving the first original sample in sequence by unit longitude or unit latitude within the neighboring spatial range; obtaining the target position of the missing data within the target area after each movement of the first original sample; supplementing the missing data of the target position according to the fourth meteorological data; and determining the third positive sample according to the meteorological data within the target area after supplementing the missing data.
[0068] It can be understood that the specific method of obtaining the third positive sample through the spatial nearest neighbor strategy includes:
[0069] 1) Determine the fourth meteorological data and the third positive sample: Determine the third positive sample based on the fourth meteorological data corresponding to the meteorological elements (e.g., temperature, humidity, wind speed, etc.) within the neighboring spatial range. The fourth meteorological data refers to a collection of other meteorological data points that are geographically close to the original sample (i.e., the first original sample) within the selected spatial neighboring range.
[0070] 2) Determine the target area: The target area refers to the geographical area covered by the first original sample. When constructing positive samples, the target area defines the spatial relationship between data points.
[0071] The target area may be divided into a grid format, that is, the target area may be divided into areas in a grid format by unit longitude and unit latitude.
[0072] 3) Move the first original sample: within the neighboring spatial range, move the first original sample on the grid, each time by unit longitude or unit latitude. That is, translate the original sample in the geographic space to find the neighboring samples in space.
[0073] 4) Obtaining missing data at the target position: During the moving process, if some data points of the first original sample move out of the original target area, there are blank positions in the target area. These blank positions are the target positions, and the data to be supplemented corresponding to the blank positions are the missing data.
[0074] 5) Supplement missing data: Based on the fourth meteorological data (i.e., meteorological data within the neighboring spatial range), the missing data of the target position in the target area after each movement is supplemented. That is, when some data points are missing after the original sample is translated, the data of the neighboring target position in the first original sample is used to fill these gaps, ensuring that the sample data obtained after each step of movement is still complete.
[0075] 6) Determine the third positive sample: The meteorological data in the target area after supplementing the missing data is used as the third positive sample.
[0076] The steps of constructing the third negative sample are the same as the steps of constructing the third positive sample, and are not described in detail here.
[0077] Optionally, the above step S206 maximizes the similarity between the first original sample and the first positive sample according to the target loss function to obtain a first training result, and minimizes the similarity between the first original sample and the first negative sample to obtain a second training result, including: inputting the first original sample, the first positive sample and the first negative sample into the target meteorological model respectively, so that the target meteorological model outputs a first meteorological characterization result corresponding to the first original sample, a second meteorological characterization result corresponding to the first positive sample and a third meteorological characterization result corresponding to the first negative sample respectively; inputting the first meteorological characterization result, the second meteorological characterization result and the third meteorological characterization result into the target meteorological model; The characterization results are respectively input into the multilayer perceptron in the target meteorological model, so that the multilayer perceptron performs dimensionality reduction processing on the first meteorological characterization result, the second meteorological characterization result and the third meteorological characterization result respectively, to obtain the second original sample corresponding to the first original sample, the fourth positive sample corresponding to the first positive sample and the fourth negative sample corresponding to the first negative sample; the second original sample, the fourth positive sample and the fourth negative sample are trained according to the target loss function to maximize the similarity between the second original sample and the fourth positive sample to obtain the first training result, and minimize the similarity between the second original sample and the fourth negative sample to obtain the second training result.
[0078] It can be understood that the learning process of optimizing the model's representation of meteorological data through the target loss function includes:
[0079] 1) Input the original samples and positive and negative samples to the target meteorological model:
[0080] The high-resolution meteorological data (i.e., the first original sample) at the selected time point is input into the target meteorological model, wherein the target meteorological model may be a model with Swin Transformer (a deep learning model) as the core architecture. At the same time, the positive sample (the first positive sample) and the negative sample (the first negative sample) constructed according to the time neighbor and space neighbor principles are also input into the target meteorological model.
[0081] The model outputs meteorological characterization results for these inputs (i.e., the first meteorological characterization result, the second meteorological characterization result, and the third meteorological characterization result), which contain deep feature representations of the meteorological data.
[0082] 2) Dimensionality reduction through multi-layer perceptron (MLP):
[0083] The meteorological characterization results output by the model are further input into the MLP layer of the model. The function of the MLP layer is to perform feature dimensionality reduction, reduce the dimension of the data, while maintaining or enhancing the distinguishing ability of the features.
[0084] After the dimensionality reduction process of the MLP layer, the obtained feature representations are the second original sample, the fourth positive sample, and the fourth negative sample. These meteorological representations are more compact and convenient for subsequent processing.
[0085] 3) Use the target loss function for training:
[0086] The target loss function may be an info NCE loss function, a contrastive learning loss function, which is used to optimize the similarity between feature representations output by a quantified model.
[0087] 4) Optimization objectives:
[0088] By adjusting the model parameters, the similarity between the second original sample (the feature representation of the first original sample after dimensionality reduction) and the fourth positive sample (the feature representation of the first positive sample after dimensionality reduction) is maximized; at the same time, the similarity between the second original sample and the fourth negative sample (the feature representation of the first negative sample after dimensionality reduction) is minimized.
[0089] 5) Training results: The optimization results obtained through the above process are called the first training results and the second training results, which correspond to the optimization effects of positive samples and negative samples respectively.
[0090] Through the above steps, the target meteorological model learns to distinguish between positive samples and negative samples during training, that is, under similar meteorological conditions (positive samples), the output feature representation of the model should be very close; under dissimilar meteorological conditions (negative samples), the output feature representation of the model should be significantly different. In this way, the model can learn the deep feature representation of high-resolution meteorological data under unsupervised conditions, providing higher quality feature representation for subsequent downstream tasks such as meteorological forecasting.
[0091] Optionally, the above step S208 trains the target meteorological model according to the first training result and the second training result, including: determining the weight corresponding to each training parameter in the target meteorological model according to the first training result and the second training result, and adjusting each training parameter according to the weight; deleting the multilayer perceptron in the target meteorological model to update the target meteorological model; and training the updated target meteorological model according to the adjusted training parameters to obtain the trained target meteorological model.
[0092] It can be understood that the steps of training the target meteorological model include:
[0093] 1) Determine the training parameter weights:
[0094] In the training process of contrastive learning, the first training result and the second training result can be used to determine which parameters are more critical to the model learning the representation of temporal or spatial similarity, and then assign higher weights to these parameters. The determination of weights can be based on a variety of strategies, such as the importance of parameters, or the evaluation of the contribution of each to the loss function in the two tasks.
[0095] 2) Adjust training parameters:
[0096] By allocating weights, the training parameters in the target meteorological model are adjusted so that the model can pay more attention to the parameters that contribute more to representation learning in subsequent learning.
[0097] The purpose of adjusting the parameters is to optimize the performance of the model under the contrastive learning framework, so that it can more effectively learn useful representations from unsupervised data.
[0098] 3) Remove the Multilayer Perceptron (MLP):
[0099] After completing the pre-training phase of contrastive learning, the goal is to extract the representation capabilities learned by the model without necessarily requiring the model to perform specific forecasting tasks. Therefore, the multi-layer perceptron (MLP) part of the target meteorological model is deleted, because the MLP layer is usually the output layer for classification or regression tasks, and this part can be considered additional and unnecessary for representation learning.
[0100] After removing the MLP layer, the remaining model architecture (i.e., Swin Transformer) can be viewed as a feature extractor that has learned how to represent meteorological data from the temporal and spatial nearest neighbor tasks.
[0101] 4) Update and train the target meteorological model:
[0102] After removing the MLP layer and adjusting the training parameters, the target meteorological model is updated. The model is now more focused on learning and characterizing the intrinsic characteristics of meteorological data rather than making final predictions. The updated target meteorological model is trained using the adjusted training parameters. This training process can be fine-tuning for specific downstream tasks (e.g., weather forecasting) or further unsupervised pre-training to further optimize the model's representation capabilities.
[0103] In order to better understand the process of the meteorological characterization method of the above-mentioned meteorological data, the meteorological characterization method of the above-mentioned meteorological data is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0104] An optional embodiment of the present application proposes a high-resolution meteorological element characterization method based on contrastive learning, uses Swin Transformer as the model architecture, implements characterization learning based on contrastive learning, and learns the characterization space of regional high-resolution meteorology by constructing proxy tasks and loss functions, laying a good foundation for the application of regional high-resolution meteorology in downstream tasks. Among them, contrastive learning is an unsupervised artificial intelligence technology used to learn the general characteristics of unlabeled data sets by instructing the model which data points are similar or dissimilar. The key to contrastive learning is to construct proxy tasks. The proxy tasks need to construct reasonable positive and negative sample pairs for the characterization network, and narrow the gap between positive samples and samples and expand the gap between negative samples and samples by designing loss functions to learn a good characterization space. According to the characteristics of regional high-resolution meteorological data, an optional embodiment of the present application constructs positive and negative samples through temporal neighbor and spatial neighbor proxy tasks, and uses infoNCE as the loss function. Specifically:
[0105] 1. Model architecture:
[0106] Figure 3 is a model architecture diagram of a meteorological element representation model according to an optional embodiment of the present application, such as Figure 3 As shown:
[0107] The optional embodiment of the present application uses meteorological elements at a certain moment as input, and the meteorological elements include air pressure, temperature, U wind, V wind, humidity, sea level pressure, etc. For meteorological element variables with multiple altitude layers and meteorological element variables with a single altitude layer near the surface, they are spliced in the altitude layer dimension to obtain a vector (i.e., meteorological vector) represented by M, M∈R layers×lat×lon , where lat and lon represent the latitude and longitude ranges respectively, and layers represents the total number of layers after splicing.
[0108] Swin Transformer is used as the backbone network of the meteorological element representation model (i.e., the target meteorological model). Swin Transformer is a general visual attention architecture with a hierarchical design that includes a sliding window operation. Since the form of the meteorological element splicing vector M is very similar to an image, it can be understood as a picture with layers channels and a size of lat×lon. Therefore, the present invention uses Swin Transformer as the model backbone network. An MLP network layer is added after Swin Transformer to obtain the output calculation loss.
[0109] 2. Contrastive learning:
[0110] like Figure 3As shown in the figure, positive and negative samples are constructed through proxy tasks (i.e., temporal nearest neighbor strategy and spatial nearest neighbor strategy), and the info NCE loss function is used to narrow the gap between the positive sample (i.e., the first positive sample) and the sample (i.e., the first original sample), and to widen the gap between the negative sample (i.e., the first negative sample) and the sample. Specifically:
[0111] (1) Temporal Neighbors: Figure 4 is a schematic diagram of constructing positive and negative samples by time neighbors according to an optional embodiment of the present application, such as Figure 4 As shown in the figure, since high-resolution meteorological data has temporal continuity, the closer the time range, the more similar the meteorological characteristics such as wind, temperature, humidity and pressure. Therefore, for the original samples of regional high-resolution meteorological data at time T0 (i.e., target time), the regional high-resolution meteorological data samples within the range of T0±(Δt×10) are all used as positive samples (connected to the second positive samples), and the regional high-resolution meteorological data samples outside the range of T0±(Δt×10) are all used as negative samples (i.e., the second negative samples).
[0112] (2) Spatial Neighbors: Figure 5 is a schematic diagram (I) of constructing positive and negative samples by spatial neighbors according to an optional embodiment of the present application, such as Figure 5 As shown,
[0113] Since high-resolution meteorological data has regional continuity, the meteorological characteristics of the nearest neighboring regions are more similar. Therefore, the regional high-resolution original meteorological data is translated up / down / left / right by no more than Δx grids as positive samples; the data translated by Δy grids or more (Δy>Δx) but not exceeding the threshold λ is used as negative samples (grid: for M∈R layers ×lat×lon , which can be understood as a vector m∈R on each grid of lat×lon layers Represents the meteorological elements of the grid point. The gridding diagram is as follows Figure 5 shown). Figure 5 It uses a layer of grid to illustrate the way of constructing positive and negative samples by translating the grid, where the missing parts after translation are copied and filled by the adjacent edge data. Figure 6 is a schematic diagram (II) of constructing positive and negative samples by spatial neighbors according to an optional embodiment of the present application, such as Figure 6 As shown, the vector m at each grid point is represented by numbers 1, 2, ..., and a translation of 1 grid is taken as an example, and positive and negative samples (ie, the third positive sample and the third negative sample) are determined by copying and filling.
[0114] The original sample is represented by M, and the positive sample constructed with M as the original sample is represented by M + The negative sample constructed with M as the original sample is represented by M-, and the info NCE loss function is used for training: in, represents positive samples and negative samples; i and k represent the total number of positive samples and negative samples respectively, and T is the temperature parameter, which is used to adjust the degree of attention to difficult samples. That is, the smaller the temperature parameter, the more attention is paid to separating the corresponding original samples, positive samples, and negative samples from the most similar difficult samples, thereby obtaining a more uniform representation.
[0115] (3) After training and fitting, the training parameters of the model architecture are retained, and after removing the MLP layer, a meteorological element representation model of regional high-resolution meteorological data is obtained. The meteorological representation obtained based on the meteorological element representation model can be used in forecasting tasks or can be fine-tuned.
[0116] An optional embodiment of the present application proposes a high-resolution meteorological element characterization method based on contrastive learning, uses Swin Transformer as the model architecture, implements characterization learning based on contrastive learning, proposes a method for constructing positive and negative samples of temporal neighbors and spatial neighbors, and uses the info NCE loss function to learn the representation space of regional high-resolution meteorology.
[0117] 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 such an 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 of each embodiment of the present application.
[0118] The present application also provides a structural block diagram of a meteorological characterization device for meteorological data. Figure 7 is a structural block diagram of a meteorological characterization device for meteorological data according to an embodiment of the present application; Figure 7 As shown, including:
[0119] A splicing module 72, configured to splice the first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector;
[0120] A determination module 74, configured to determine the meteorological vector as a first original sample, and construct a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy;
[0121] A first training module 76, configured to maximize the similarity between the first original sample and the first positive sample according to a target loss function to obtain a first training result, and minimize the similarity between the first original sample and the first negative sample to obtain a second training result;
[0122] The second training module 78 is used to train the target meteorological model according to the first training result and the second training result, so that the trained target meteorological model can perform meteorological representation on the target meteorological data.
[0123] Through the above-mentioned device, the first meteorological data corresponding to the meteorological element is spliced according to the altitude layer of the meteorological element to generate a meteorological vector; the meteorological vector is determined as the first original sample, and the first positive sample and the first negative sample corresponding to the first original sample are constructed by the time neighbor strategy and the space neighbor strategy; the similarity between the first original sample and the first positive sample is maximized according to the target loss function to obtain the first training result, and the similarity between the first original sample and the first negative sample is minimized to obtain the second training result; the target meteorological model is trained according to the first training result and the second training result, so that the trained target meteorological model performs meteorological characterization on the target meteorological data. That is to say, the present application uses the time neighbor strategy and the space neighbor strategy to construct the first positive sample and the first negative sample corresponding to the first original sample, and maximizes the similarity between the first original sample and the first positive sample according to the target loss function, and minimizes the similarity between the first original sample and the first negative sample to train the target meteorological model, so that the trained target meteorological model can characterize the meteorological data. Through the embodiments of the present application, the problem of insufficient meteorological prediction accuracy caused by insufficient characterization learning of meteorological data in meteorological prediction in the related technology can be solved. Then, the meteorological data is characterized by the trained target meteorological model to improve the accuracy of meteorological forecasts.
[0124] In an exemplary embodiment, the determination module 74 is also used to construct a second positive sample and a second negative sample corresponding to the first original sample according to the temporal neighbor strategy; and to construct a third positive sample and a third negative sample corresponding to the first original sample according to the spatial neighbor strategy; determine the second positive sample and the third positive sample as the first positive sample, and determine the second negative sample and the third negative sample as the first negative sample.
[0125] In an exemplary embodiment, the determination module 74 is also used to determine the target moment corresponding to the first original sample, and determine the adjacent time period corresponding to the target moment, wherein the starting moment of the adjacent time period is the moment corresponding to the difference between the target moment and the target time period, and the ending moment of the adjacent time period is the moment corresponding to the sum of the target moment and the target time period; determine the second positive sample according to the second meteorological data corresponding to the meteorological element in the adjacent time period; determine the second negative sample according to the third meteorological data corresponding to the meteorological element in other time periods, wherein the other time periods are time periods other than the adjacent time periods.
[0126] In an exemplary embodiment, the determination module 74 is also used to determine the target longitude and target latitude corresponding to the first original sample, and determine the neighboring spatial range corresponding to the first original sample based on the target longitude and the target latitude, wherein the maximum longitude of the neighboring spatial range is the sum of the target longitude and the first numerical value, the minimum longitude of the neighboring spatial range is the difference between the target longitude and the first numerical value, the maximum latitude of the neighboring spatial range is the sum of the target latitude and the second numerical value, and the minimum latitude of the neighboring spatial range is the difference between the target latitude and the second numerical value; the third positive sample is determined based on the fourth meteorological data corresponding to the meteorological element within the neighboring spatial range; the third negative sample is determined based on the fifth meteorological data corresponding to the meteorological element within other spatial ranges, wherein the other spatial ranges are spatial ranges other than the neighboring spatial range.
[0127] In an exemplary embodiment, the determination module 74 is also used to determine the third positive sample based on the fourth meteorological data corresponding to the meteorological element within the neighboring spatial range; determine the target area corresponding to the first original sample; move the first original sample in sequence by unit longitude or unit latitude within the neighboring spatial range; obtain the target position of the missing data within the target area after each movement of the first original sample; supplement the missing data of the target position according to the fourth meteorological data; and determine the third positive sample based on the meteorological data within the target area after supplementing the missing data.
[0128] In an exemplary embodiment, the first training module 76 is also used to input the first original sample, the first positive sample and the first negative sample into the target meteorological model, so that the target meteorological model outputs a first meteorological characterization result corresponding to the first original sample, a second meteorological characterization result corresponding to the first positive sample and a third meteorological characterization result corresponding to the first negative sample, respectively; input the first meteorological characterization result, the second meteorological characterization result and the third meteorological characterization result into the multilayer perceptron in the target meteorological model, so that the multilayer perceptron performs dimensionality reduction processing on the first meteorological characterization result, the second meteorological characterization result and the third meteorological characterization result, respectively, to obtain a second original sample corresponding to the first original sample, a fourth positive sample corresponding to the first positive sample and a fourth negative sample corresponding to the first negative sample; train the second original sample, the fourth positive sample and the fourth negative sample according to the target loss function to maximize the similarity between the second original sample and the fourth positive sample to obtain a first training result, and minimize the similarity between the second original sample and the fourth negative sample to obtain a second training result.
[0129] In an exemplary embodiment, the second training module 78 is also used to determine the weight corresponding to each training parameter in the target meteorological model based on the first training result and the second training result, and adjust each training parameter according to the weight; delete the multilayer perceptron in the target meteorological model to update the target meteorological model; train the updated target meteorological model according to the adjusted training parameters to obtain the trained target meteorological model.
[0130] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0131] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0132] S1, splicing first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector;
[0133] S2, determining the meteorological vector as a first original sample, and constructing a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy;
[0134] S3, maximizing the similarity between the first original sample and the first positive sample according to the target loss function to obtain a first training result, and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result;
[0135] S4: training a target meteorological model according to the first training result and the second training result, so that the trained target meteorological model performs meteorological representation on target meteorological data.
[0136] 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.
[0137] Optionally, 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.
[0138] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0139] S1, splicing first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector;
[0140] S2, determining the meteorological vector as a first original sample, and constructing a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy;
[0141] S3, maximizing the similarity between the first original sample and the first positive sample according to the target loss function to obtain a first training result, and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result;
[0142] S4: training a target meteorological model according to the first training result and the second training result, so that the trained target meteorological model performs meteorological representation on target meteorological data.
[0143] An embodiment of the present application further provides a computer program product, including a computer program, which is used by a processor to execute the steps in any of the above method embodiments.
[0144] Optionally, in this embodiment, the computer program product may be executed by a processor to perform the following steps:
[0145] S1, splicing first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector;
[0146] S2, determining the meteorological vector as a first original sample, and constructing a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy;
[0147] S3, maximizing the similarity between the first original sample and the first positive sample according to the target loss function to obtain a first training result, and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result;
[0148] S4: training a target meteorological model according to the first training result and the second training result, so that the trained target meteorological model performs meteorological representation on target meteorological data.
[0149] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: 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, and other media that can store program codes.
[0150] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0151] 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, and optionally, 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.
[0152] 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 meteorological characterization method for meteorological data, characterized in that: include: splicing the first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector; Determine the meteorological vector as a first original sample, and construct a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy; According to the target loss function, the similarity between the first original sample and the first positive sample is maximized to obtain a first training result, and the similarity between the first original sample and the first negative sample is minimized to obtain a second training result; The target meteorological model is trained according to the first training result and the second training result, so that the trained target meteorological model performs meteorological representation on the target meteorological data.
2. The meteorological characterization method of meteorological data according to claim 1, characterized in that: Constructing a first positive sample and a first negative sample corresponding to the first original sample by using a temporal neighbor strategy and a spatial neighbor strategy, including: Constructing a second positive sample and a second negative sample corresponding to the first original sample according to the time nearest neighbor strategy; and Constructing a third positive sample and a third negative sample corresponding to the first original sample according to the spatial nearest neighbor strategy; The second positive sample and the third positive sample are determined as the first positive sample, and the second negative sample and the third negative sample are determined as the first negative sample.
3. The meteorological characterization method of meteorological data according to claim 2, characterized in that: Constructing a second positive sample and a second negative sample corresponding to the first original sample according to the time nearest neighbor strategy includes: Determine a target time corresponding to the first original sample, and determine a neighboring time period corresponding to the target time period, wherein the start time of the neighboring time period is the time corresponding to the difference between the target time period and the target time period, and the end time of the neighboring time period is the time corresponding to the sum of the target time period and the target time period; Determine the second positive sample according to the second meteorological data corresponding to the meteorological element in the adjacent time period; The second negative sample is determined according to the third meteorological data corresponding to the meteorological element in other time periods, wherein the other time periods are time periods other than the adjacent time periods.
4. The meteorological characterization method of meteorological data according to claim 2, characterized in that: Constructing a third positive sample and a third negative sample corresponding to the first original sample according to the spatial neighbor strategy, including: Determine the target longitude and target latitude corresponding to the first original sample, and determine the neighboring spatial range corresponding to the first original sample according to the target longitude and the target latitude, wherein the maximum longitude of the neighboring spatial range is the sum of the target longitude and the first value, the minimum longitude of the neighboring spatial range is the difference between the target longitude and the first value, the maximum latitude of the neighboring spatial range is the sum of the target latitude and the second value, and the minimum latitude of the neighboring spatial range is the difference between the target latitude and the second value; Determine the third positive sample according to fourth meteorological data corresponding to the meteorological element within the neighboring spatial range; The third negative sample is determined according to the fifth meteorological data corresponding to the meteorological element in other spatial ranges, wherein the other spatial ranges are spatial ranges excluding the neighboring spatial ranges.
5. The meteorological characterization method of meteorological data according to claim 4, characterized in that: Determining the third positive sample according to fourth meteorological data corresponding to the meteorological element within the neighboring spatial range includes: Determine the third positive sample according to fourth meteorological data corresponding to the meteorological element within the neighboring spatial range; Determining a target area corresponding to the first original sample; Moving the first original sample sequentially by unit longitude or unit latitude within the neighboring spatial range; Obtaining a target position of missing data in a target area after each movement of the first original sample; Supplementing missing data of the target location according to the fourth meteorological data; The third positive sample is determined according to the meteorological data in the target area after the missing data is supplemented.
6. The meteorological characterization method of meteorological data according to claim 1, characterized in that: The method of maximizing the similarity between the first original sample and the first positive sample according to the target loss function to obtain a first training result and minimizing the similarity between the first original sample and the first negative sample to obtain a second training result includes: Inputting the first original sample, the first positive sample, and the first negative sample into the target meteorological model respectively, so that the target meteorological model outputs a first meteorological characterization result corresponding to the first original sample, a second meteorological characterization result corresponding to the first positive sample, and a third meteorological characterization result corresponding to the first negative sample respectively; Inputting the first meteorological characterization result, the second meteorological characterization result, and the third meteorological characterization result into the multilayer perceptron in the target meteorological model respectively, so that the multilayer perceptron performs dimensionality reduction processing on the first meteorological characterization result, the second meteorological characterization result, and the third meteorological characterization result respectively, to obtain a second original sample corresponding to the first original sample, a fourth positive sample corresponding to the first positive sample, and a fourth negative sample corresponding to the first negative sample; The second original sample, the fourth positive sample and the fourth negative sample are trained according to the target loss function to maximize the similarity between the second original sample and the fourth positive sample to obtain a first training result, and minimize the similarity between the second original sample and the fourth negative sample to obtain a second training result.
7. The meteorological characterization method of meteorological data according to claim 1, characterized in that: Training a target meteorological model according to the first training result and the second training result includes: Determine a weight corresponding to each training parameter in the target meteorological model according to the first training result and the second training result, and adjust each training parameter according to the weight; The multilayer perceptron in the target meteorological model is deleted to update the target meteorological model; and the updated target meteorological model is trained according to the adjusted training parameters to obtain the trained target meteorological model.
8. A meteorological characterization device for meteorological data, characterized in that: include: A splicing module, used for splicing the first meteorological data corresponding to the meteorological elements according to the altitude layers of the meteorological elements to generate a meteorological vector; A determination module, configured to determine the meteorological vector as a first original sample, and construct a first positive sample and a first negative sample corresponding to the first original sample by using a time nearest neighbor strategy and a space nearest neighbor strategy; A first training module is configured to maximize the similarity between the first original sample and the first positive sample according to a target loss function to obtain a first training result, and minimize the similarity between the first original sample and the first negative sample to obtain a second training result; The second training module is used to train the target meteorological model according to the first training result and the second training result, so that the trained target meteorological model can perform meteorological representation on the target meteorological data.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
Citation Information
Cited By
Forecasting model training method and device, storage medium and electronic equipment
CN120873602A