Extreme weather prediction method and device based on large model, storage medium and equipment
By adopting a large-model-based method in extreme weather forecasting and using prompt pools and large-model optimization parameters, the problem of insufficient accuracy of extreme weather forecasts in the prior art is solved, and high-accuracy long-term prediction is achieved, reducing economic losses to the marine aquaculture industry.
Patent Information
- Application Number
- CN202411793314.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-05
AI Technical Summary
It is difficult for existing technology to accurately predict extreme weather events, causing economic losses to industries such as marine aquaculture.
Using the extreme weather prediction method based on the big model, we set up the prompt pool to automatically find the appropriate prompt words based on the input, construct the input vector and input it into the extreme weather prediction model, and optimize the model parameters to improve the prediction accuracy.
It significantly improves the accuracy of forecasting extreme weather, can achieve non-steady long-term predictions, predict future meteorological changes early, and reduces property losses to the marine aquaculture industry by extreme weather.
Smart Images

Figure CN119646447A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of extreme weather prediction, and in particular to a method and apparatus, storage medium, and computer equipment for extreme weather prediction based on a large model. Background Art
[0002] Extreme weather prediction is extremely important for many industries and people's daily lives. For example, in the marine aquaculture industry, extreme weather events (such as heavy rains, hurricanes, etc.) may cause huge losses to the marine aquaculture industry, including damage to fishing boats and facilities, stunted fish growth, and deterioration of water quality. Accurate prediction of extreme weather events can help farms take measures in advance to reduce potential economic losses. The marine aquaculture industry requires reasonable production plans, including planting, feeding and harvesting. The arrival of extreme weather may disrupt these plans. For example, strong winds may force fishing boats to temporarily stop working. Accurate prediction of extreme weather can help farms arrange production plans reasonably and improve efficiency and stability. Extreme weather may pose a threat to the survival and welfare of farmed animals. High temperatures, low temperatures, changes in pH, etc. may cause harm to fish or other marine life. Predicting extreme weather in advance can help farms take appropriate measures to protect the health and well-being of animals.
[0003] Extreme weather is a typical label shift problem. If the model is used directly to implement weather forecasting, the effect will be poor. Currently, there is no good solution for extreme weather forecasting. Summary of the invention
[0004] In view of this, the embodiments of the present application provide an extreme weather prediction method and device, storage medium, and computer equipment based on a large model. In order to predict the problem of extreme weather, a prompt pool is set up to automatically find suitable prompt words according to different inputs. Through this method, the prediction accuracy can be greatly improved, and non-steady-state long-term prediction can be achieved, and future meteorological changes can be predicted early, so that preparations can be made in advance to avoid extreme weather causing property losses to the marine aquaculture industry.
[0005] According to one aspect of the present application, a large model-based extreme weather prediction method is provided, the method comprising:
[0006] Acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at consecutive time nodes;
[0007] Segment each of the extreme weather sample data to obtain at least one set of sample data pairs, and use each set of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair includes a first weather data sample of a first preset time length and a second weather data sample of a second preset time length, and the second preset time length is a continuous period after the first preset time length;
[0008] Acquire a target prompt vector matching the first weather data sample in a prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector;
[0009] Input the input vector into the extreme weather prediction big model to obtain the predicted weather data of the second preset time period, perform loss calculation based on the second weather data sample and the preset weather data, and optimize the model parameters of the extreme weather prediction big model and the target prompt vector in the prompt pool according to the loss calculation result to obtain the trained extreme weather prediction big model and the prompt pool;
[0010] Extreme weather prediction is performed based on the trained extreme weather prediction large model and prompt pool.
[0011] In the embodiment of the present application, optionally, obtaining a target prompt vector matching the first weather data sample in a prompt pool includes:
[0012] Calculate the similarity between the first weather data sample and each weather data vector in the prompt pool, and determine the target weather data vector in each weather data vector based on the similarity, and determine the prompt vector corresponding to the target weather data vector as the target prompt vector matching the first weather data sample, wherein the prompt pool includes multiple weather data vectors and a prompt vector matching each weather data vector.
[0013] In the embodiment of the present application, optionally, determining a target weather data vector in each weather data vector based on the similarity includes:
[0014] The similarities are sorted from large to small, and the weather data vector corresponding to the similarity of the first preset ranking is taken as the target weather data vector;
[0015] The constructing an input vector based on the first weather data sample and the target prompt vector comprises:
[0016] The first weather data sample is vector encoded, and the target prompt vectors corresponding to the target weather data vectors are sorted according to the similarity corresponding to the target weather data vectors, and the encoded first weather data sample and the sorted target prompt vectors are concatenated to obtain the input vector.
[0017] In the embodiment of the present application, optionally, the segmentation according to each piece of the extreme weather sample data to obtain at least one set of sample data pairs includes:
[0018] For any extreme weather sample data, take any time node in the extreme weather sample data as the starting point, and take the time node with a preset time length away from the starting point as the end point, wherein the preset time length is the sum of the first preset time length and the second preset time length; take the starting point as the first segmentation starting point, determine the next segmentation starting point every preset time step, and take the time node of the preset segmentation time length after each segmentation starting point as the segmentation end point, and construct a segmentation sample segment based on each segmentation starting point and the corresponding segmentation end point, wherein the preset time step is less than the preset segmentation time length; take the segmentation sample segment corresponding to the first preset time length to construct the first weather data sample, and take the segmentation sample segment corresponding to the second preset time length to construct the second weather data sample.
[0019] In an embodiment of the present application, optionally, performing extreme weather forecasting based on the trained extreme weather forecasting large model and the prompt pool includes:
[0020] Receiving an extreme weather forecast signal, and based on a forecast time corresponding to the extreme weather forecast signal, acquiring weather data to be forecasted for a first preset time period before the forecast time;
[0021] Taking the start time of the weather data to be predicted as the target segmentation starting point, determining the next target segmentation starting point for each preset time step, taking the time node of the preset segmentation time after each target segmentation starting point as the target segmentation end point, forming a segmentation data segment based on each target segmentation starting point and the corresponding target segmentation end point, and forming each segmentation data segment into weather segmentation data;
[0022] Obtaining a prompt vector matching the weather segmentation data from the trained prompt pool as the prompt vector to be spliced, and splicing the weather segmentation data and the prompt vector to be spliced to obtain spliced weather segmentation data;
[0023] The spliced weather segmentation data is input into the trained extreme weather prediction large model to determine the extreme weather prediction data of the second preset time after the prediction moment.
[0024] In an embodiment of the present application, optionally, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the prompt pool includes a temperature prompt pool, a humidity prompt pool, a wind speed prompt pool, a wind direction prompt pool, and a precipitation prompt pool; the extreme weather prediction big model includes a temperature prediction big model, a humidity prediction big model, a wind speed prediction big model, a wind direction prediction big model, and a precipitation prediction big model.
[0025] In an embodiment of the present application, optionally, performing extreme weather forecasting based on the trained extreme weather forecasting large model and the prompt pool includes:
[0026] Acquire multiple types of to-be-forecasted weather data for the first preset time period before the forecast time;
[0027] Segment each type of weather data to be predicted respectively and form each type of weather segmentation data;
[0028] For each type of weather segmentation data, respectively, a prompt vector matching the weather segmentation data is obtained from a prompt pool of the corresponding type as a prompt vector to be spliced, the weather segmentation data and the prompt vector to be spliced are spliced to obtain spliced weather segmentation data, and the spliced weather segmentation data is input into a trained extreme weather prediction large model of the corresponding type to determine extreme weather prediction data for the second preset time after the prediction moment;
[0029] The extreme weather information of the second preset time period after the predicted moment is comprehensively determined based on various types of extreme weather forecast data.
[0030] According to another aspect of the present application, there is provided an extreme weather prediction device based on a large model, the device comprising:
[0031] A data acquisition module, used to acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at consecutive time nodes;
[0032] A sample construction module, used to segment each extreme weather sample data to obtain at least one set of sample data pairs, and use each set of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair includes a first weather data sample of a first preset time length and a second weather data sample of a second preset time length, and the second preset time length is a continuous period after the first preset time length;
[0033] a prompt enhancement module, configured to obtain a target prompt vector matching the first weather data sample from a prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector;
[0034] A model training module, used for inputting the input vector into the extreme weather prediction large model, obtaining the predicted weather data of the second preset time period, performing loss calculation based on the second weather data sample and the preset weather data, and optimizing the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool according to the loss calculation result, so as to obtain the trained extreme weather prediction large model and the prompt pool;
[0035] The weather prediction module is used to predict extreme weather based on the trained extreme weather prediction model and prompt pool.
[0036] In the embodiment of the present application, optionally, the prompt enhancement module is further used to:
[0037] Calculate the similarity between the first weather data sample and each weather data vector in the prompt pool, and determine the target weather data vector in each weather data vector based on the similarity, and determine the prompt vector corresponding to the target weather data vector as the target prompt vector matching the first weather data sample, wherein the prompt pool includes multiple weather data vectors and a prompt vector matching each weather data vector.
[0038] In the embodiment of the present application, optionally, the prompt enhancement module is further used to:
[0039] The similarities are sorted from large to small, and the weather data vector corresponding to the similarity of the first preset ranking is taken as the target weather data vector;
[0040] The constructing an input vector based on the first weather data sample and the target prompt vector comprises:
[0041] The first weather data sample is vector encoded, and the target prompt vectors corresponding to the target weather data vectors are sorted according to the similarity corresponding to the target weather data vectors, and the encoded first weather data sample and the sorted target prompt vectors are concatenated to obtain the input vector.
[0042] In the embodiment of the present application, optionally, the sample construction module is further used to:
[0043] For any extreme weather sample data, take any time node in the extreme weather sample data as the starting point, and take the time node with a preset time length away from the starting point as the end point, wherein the preset time length is the sum of the first preset time length and the second preset time length; take the starting point as the first segmentation starting point, determine the next segmentation starting point every preset time step, and take the time node of the preset segmentation time length after each segmentation starting point as the segmentation end point, and construct a segmentation sample segment based on each segmentation starting point and the corresponding segmentation end point, wherein the preset time step is less than the preset segmentation time length; take the segmentation sample segment corresponding to the first preset time length to construct the first weather data sample, and take the segmentation sample segment corresponding to the second preset time length to construct the second weather data sample.
[0044] In the embodiment of the present application, optionally, the preset time step is half of the preset segmentation duration, and the first preset duration is greater than the second preset duration.
[0045] In the embodiment of the present application, optionally, the weather forecast module is further used to:
[0046] Receiving an extreme weather forecast signal, and based on a forecast time corresponding to the extreme weather forecast signal, acquiring weather data to be forecasted for a first preset time period before the forecast time;
[0047] Taking the start time of the weather data to be predicted as the target segmentation starting point, determining the next target segmentation starting point for each preset time step, taking the time node of the preset segmentation time after each target segmentation starting point as the target segmentation end point, forming a segmentation data segment based on each target segmentation starting point and the corresponding target segmentation end point, and forming each segmentation data segment into weather segmentation data;
[0048] Obtaining a prompt vector matching the weather segmentation data from the trained prompt pool as the prompt vector to be spliced, and splicing the weather segmentation data and the prompt vector to be spliced to obtain spliced weather segmentation data;
[0049] The spliced weather segmentation data is input into the trained extreme weather prediction large model to determine the extreme weather prediction data of the second preset time after the prediction moment.
[0050] In an embodiment of the present application, optionally, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the prompt pool includes a temperature prompt pool, a humidity prompt pool, a wind speed prompt pool, a wind direction prompt pool, and a precipitation prompt pool; the extreme weather prediction big model includes a temperature prediction big model, a humidity prediction big model, a wind speed prediction big model, a wind direction prediction big model, and a precipitation prediction big model.
[0051] In the embodiment of the present application, optionally, the weather forecast module is further used to:
[0052] Acquire multiple types of to-be-forecasted weather data for the first preset time period before the forecast time;
[0053] Segment each type of weather data to be predicted respectively and form each type of weather segmentation data;
[0054] For each type of weather segmentation data, respectively, a prompt vector matching the weather segmentation data is obtained from a prompt pool of the corresponding type as a prompt vector to be spliced, the weather segmentation data and the prompt vector to be spliced are spliced to obtain spliced weather segmentation data, and the spliced weather segmentation data is input into a trained extreme weather prediction large model of the corresponding type to determine extreme weather prediction data for the second preset time after the prediction moment;
[0055] The extreme weather information of the second preset time period after the predicted moment is comprehensively determined based on various types of extreme weather forecast data.
[0056] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned extreme weather prediction method based on a large model is implemented.
[0057] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned large model-based extreme weather prediction method when executing the program.
[0058] By means of the above technical scheme, an extreme weather prediction method and device based on a large model, a storage medium, and a computer device provided in an embodiment of the present application construct a training sample set by collecting extreme weather samples containing weather data of continuous time nodes. Each data pair in the training sample set consists of a first weather data sample of a first preset time length and a second weather data sample of a second preset time length. Then, a target prompt vector matching the first weather data sample is selected from the prompt pool, and an input vector is constructed in combination with the first weather data sample. The input vector is input into the extreme weather prediction large model to obtain the predicted weather data, and the loss is calculated with the actual weather data. Based on the loss calculation result, the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool are optimized. Finally, the trained model and the prompt pool are used to predict extreme weather. By introducing the prompt vector and constructing the large model, the embodiment of the present application can more accurately capture the spatiotemporal characteristics and nonlinear relationships of the weather data, thereby improving the prediction accuracy of extreme weather, and the use of the prompt vector enables the model to better adapt to the extreme weather characteristics of different regions and seasons, thereby enhancing the generalization performance of the model. In summary, this scheme significantly improves the prediction accuracy and model generalization ability of extreme weather by introducing prompt vectors and optimizing large models, providing strong technical support for addressing extreme weather challenges.
[0059] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] 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:
[0061] Figure 1 A schematic diagram of a process of an extreme weather prediction method based on a large model provided in an embodiment of the present application is shown;
[0062] Figure 2 A schematic diagram of a process flow of another extreme weather prediction method based on a large model provided in an embodiment of the present application is shown;
[0063] Figure 3 A schematic structural diagram of an extreme weather prediction device based on a large model provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0064] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0065] In this embodiment, a method for extreme weather prediction based on a large model is provided. Figure 1 As shown, the method includes:
[0066] Step 101: Acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at consecutive time nodes.
[0067] In the embodiment of the present application, firstly, extreme weather samples containing weather data of continuous time nodes are obtained. These sample data are usually derived from meteorological observation stations, satellite data, radar images, etc., covering detailed weather information of extreme weather events (such as typhoons, heavy rains, blizzards, droughts, etc.) that have occurred in history. These data may include information of multiple dimensions such as temperature, humidity, air pressure, wind speed, wind direction, precipitation, etc., and are recorded continuously in chronological order. In addition, in addition to the weather data of extreme weather, the extreme weather sample data also includes weather data of normal weather.
[0068] Step 102: Segment the extreme weather sample data to obtain at least one group of sample data pairs, and use each group of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair includes a first weather data sample of a first preset time length and a second weather data sample of a second preset time length, and the second preset time length is a continuous period after the first preset time length.
[0069] In an embodiment of the present application, each extreme weather sample data is segmented in chronological order, and each extreme weather sample forms at least one group of sample data pairs. Each group of sample data pairs consists of two parts: a first weather data sample of a first preset duration and a second weather data sample of a second preset duration. The first preset duration and the second preset duration are artificially set according to the prediction requirements. For example, if the goal is to predict the extreme weather in the next week, the first preset duration may be set to 3 days, and the second preset duration is set to the next 7 days. If the goal is to predict the extreme weather in the next 12 hours, the first preset duration can be set to 48 hours, and the second preset duration is set to the next 12 hours. In order to use the weather data of the past period of time to predict the weather conditions in the future period of time, those skilled in the art can set it according to actual usage requirements.
[0070] Step 103: Obtain a target prompt vector matching the first weather data sample from a prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector.
[0071] In the embodiment of the present application, extreme weather is a typical label shift problem. For the "label shift" problem, if a large model is used directly to realize weather forecasting, the effect will be relatively poor. A simple idea is to input prompt words to learn the characteristics of this extreme weather. However, for this non-steady-state problem, static prompt words will also have a poor effect. Therefore, the embodiment of the present application adopts automatic finding of suitable prompt words according to different inputs. Through this method, the prediction accuracy can be greatly improved, and non-steady-state long-term prediction can be achieved, and future meteorological changes can be predicted as early as possible. In order to improve the performance of the prediction model, the concept of prompt vector is introduced. Prompt vector is a special vector used to guide the model to better understand the input data and generate more accurate predictions. In the prompt pool, according to the characteristics of the first weather data sample, a target prompt vector matching it is selected. Then, the first weather data sample and the target prompt vector are combined to construct an input vector. This input vector will be used as the input of the extreme weather prediction large model.
[0072] Step 104: input the input vector into the extreme weather prediction large model to obtain the predicted weather data for the second preset time period, perform loss calculation based on the second weather data sample and the preset weather data, and optimize the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool according to the loss calculation result to obtain the trained extreme weather prediction large model and prompt pool.
[0073] In an embodiment of the present application, the constructed input vector is input into the extreme weather prediction large model, and the model generates predicted weather data of a second preset duration based on the input vector. Then, the predicted weather data is compared with the actual second weather data sample, and the loss value is calculated. The loss value reflects the degree of difference between the predicted result and the actual result. Based on the loss value, the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool are optimized to reduce the prediction error and improve the prediction accuracy. This process is iterated multiple times until the predetermined training stop condition is reached (such as the loss value no longer decreases significantly).
[0074] Step 105: Perform extreme weather forecasting based on the trained extreme weather forecasting large model and the prompt pool.
[0075] In the embodiment of the present application, after the model training is completed, the trained extreme weather prediction large model and prompt pool can be used to perform actual extreme weather prediction. New weather data (including weather data of the first preset duration) is input into the model, and the model will output the predicted weather conditions for a period of time in the future (the second preset duration). These prediction results can provide important references for fields such as weather forecasting, disaster warning, agricultural production, and urban planning.
[0076] Optionally, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the prompt pool includes a temperature prompt pool, a humidity prompt pool, a wind speed prompt pool, a wind direction prompt pool, and a precipitation prompt pool; the extreme weather prediction big model includes a temperature prediction big model, a humidity prediction big model, a wind speed prediction big model, a wind direction prediction big model, and a precipitation prediction big model.
[0077] Among them, the embodiment of the present application can adopt a single-dimensional extreme weather prediction method, and use the weather data of the first preset time length to predict the weather data of the next second preset time length. For example, the temperature data of the past 48 hours is used to predict the temperature data of the next 12 hours. In order to improve the accuracy of weather forecasts, a specific prompt pool and a large prediction model are designed for each type of weather data. For different types of weather sample data, the corresponding prompt pool is used to obtain prompt vectors, and the corresponding prompt pool and the corresponding prediction large model are trained based on the weather sample data. After completing the training of the prompt pool and the large model, different types of historical weather data can be used to predict different types of future weather data respectively. Further, the future weather can be comprehensively predicted based on different types of future weather data prediction information. For example, if the precipitation and wind speed have reached the corresponding extreme weather thresholds, it can be judged that typhoon rain may occur in the future.
[0078] By applying the technical solution of this embodiment, a training sample set is constructed by collecting extreme weather samples containing weather data of continuous time nodes. Each data pair in the training sample set consists of a first weather data sample of a first preset time length and a second weather data sample of a second preset time length. Then, a target prompt vector matching the first weather data sample is selected from the prompt pool, and an input vector is constructed in combination with the first weather data sample. The input vector is input into the extreme weather prediction large model to obtain the predicted weather data, and the loss is calculated with the actual weather data. Based on the loss calculation result, the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool are optimized. Finally, the trained model and the prompt pool are used to predict extreme weather. By introducing prompt vectors and constructing a large model, the embodiment of the present application can more accurately capture the spatiotemporal characteristics and nonlinear relationships of weather data, thereby improving the prediction accuracy of extreme weather, and the use of prompt vectors enables the model to better adapt to the extreme weather characteristics of different regions and seasons, and enhances the generalization performance of the model. In summary, this solution significantly improves the prediction accuracy and model generalization ability of extreme weather by introducing prompt vectors and optimizing large models, providing strong technical support for coping with extreme weather challenges.
[0079] In an embodiment of the present application, optionally, the step 103 of obtaining a target prompt vector matching the first weather data sample in the prompt pool includes: calculating the similarity between the first weather data sample and each weather data vector in the prompt pool, and determining the target weather data vector in each weather data vector based on the similarity, and determining the prompt vector corresponding to the target weather data vector as the target prompt vector matching the first weather data sample, wherein the prompt pool includes multiple weather data vectors and a prompt vector matching each weather data vector.
[0080] In this embodiment, first, the similarity between the first weather data sample and each weather data vector in the prompt pool is calculated, which can be implemented by various similarity calculation methods, such as cosine similarity, Euclidean distance, Manhattan distance, etc. The specific selection depends on the characteristics of the weather data vector and the requirements of the prediction task. Then, based on the calculated similarity, a weather data vector with a higher similarity to the first weather data sample is selected from the prompt pool as the target weather data vector. Finally, the prompt vector corresponding to the target weather data vector is determined as the target prompt vector that matches the first weather data sample. The prompt vectors are associated with the weather data vectors, and they may contain additional information or context about the characteristics of the weather data vectors, which helps the extreme weather prediction large model to understand the input data more accurately. By introducing the prompt vector and the mechanism based on similarity matching, the characteristics of the weather data can be captured more accurately, thereby improving the prediction accuracy of extreme weather.
[0081] In an embodiment of the present application, optionally, determining a target weather data vector in each weather data vector based on the similarity includes: sorting the similarities from large to small, and taking the weather data vector corresponding to the similarity with a preset position as the target weather data vector; constructing an input vector based on the first weather data sample and the target prompt vector in step 103 includes: vector encoding the first weather data sample, sorting according to the similarity corresponding to the target weather data vector, sorting the target prompt vectors corresponding to the target weather data vector, and splicing the encoded first weather data sample and the sorted target prompt vectors to obtain the input vector.
[0082] In this embodiment, after calculating the similarity between the first weather data sample and each weather data vector in the prompt pool, these similarities are sorted from large to small. The weather data vector corresponding to the similarity of the previous preset position is taken as the target weather data vector. This preset position can be adjusted according to actual needs to balance the prediction accuracy and calculation cost. After determining the target weather data vector, an input vector is constructed based on the first weather data sample and the target prompt vector. Specifically: Vector encoding: First, the first weather data sample is vector encoded and converted into a format suitable for input into the extreme weather prediction model. Then, according to the similarity ranking corresponding to the target weather data vector, the target prompt vector is sorted. The purpose of this is to retain the order information of the prompt vector that is most similar to the target weather data vector, which helps the model better understand the contextual relationship of the input data. Finally, the encoded first weather data sample and the sorted target prompt vectors are spliced to obtain the final input vector. This input vector will be used as the input of the extreme weather prediction model to generate predicted weather data. The embodiments of the present application can more accurately capture the characteristics and time series relationships of weather data by introducing similarity sorting and prompt vectors, thereby improving the prediction accuracy of extreme weather. The sorted prompt vectors provide additional contextual information, which helps the model better adapt to different weather conditions and regional characteristics, thereby enhancing the generalization performance of the model.
[0083] In the embodiment of the present application, optionally, the step 102 of segmenting according to each of the extreme weather sample data to obtain at least one set of sample data pairs includes: for any extreme weather sample data, taking any time node in the extreme weather sample data as the starting point, and taking the time node with a preset time distance from the starting point as the end point, wherein the preset time distance is the sum of the first preset time distance and the second preset time distance; taking the starting point as the first segmentation starting point, determining the next segmentation starting point every preset time step, taking the time node with a preset segmentation time distance after each segmentation starting point as the segmentation end point, and forming a segmentation sample segment based on each segmentation starting point and the corresponding segmentation end point, wherein the preset time step is less than the preset segmentation time distance; taking the segmentation sample segment corresponding to the first preset time distance to construct the first weather data sample, and taking the segmentation sample segment corresponding to the second preset time distance to construct the second weather data sample. Wherein, the preset time step is one-half of the preset segmentation time distance, and the first preset time distance is greater than the second preset time distance.
[0084] In this embodiment, for any extreme weather sample data, firstly, any time node is selected as the starting point, and then, the time node with a preset time length (the preset time length is the sum of the first preset time length and the second preset time length) from the starting point is determined as the end point. Next, the starting point is taken as the first segmentation starting point, and the next segmentation starting point is determined every preset time step (the preset time step length is less than the preset segmentation time length). For each segmentation starting point, the time node of the preset segmentation time length behind it is taken as the segmentation end point. Based on each segmentation starting point and the corresponding segmentation end point, a segmentation sample segment is formed, and these segmentation sample segments are continuous in time, but overlap with each other (because the preset time step length is less than the preset segmentation time length). From each segmentation sample segment, the part corresponding to the first preset time length is taken as the first weather data sample. At the same time, the part corresponding to the second preset time length (immediately after the first weather data sample) is taken as the second weather data sample. Each first weather data sample is paired with its corresponding second weather data sample to form a sample data pair. In this way, multiple sample data pairs can be segmented from an extreme weather sample data, thereby constructing a rich training sample set. The embodiment of the present application can extract more training sample pairs from limited extreme weather sample data through a flexible segmentation method, thereby improving data utilization. Since the segmented sample pairs are continuous and overlapping in time, this helps the model learn the time series characteristics and change laws of weather data, thereby enhancing the generalization ability of the model.
[0085] In the embodiment of the present application, optionally, the step 105 of performing extreme weather forecasting based on the trained extreme weather forecasting large model and the prompt pool includes:
[0086] Receiving an extreme weather forecast signal, and based on a forecast time corresponding to the extreme weather forecast signal, acquiring weather data to be forecasted for a first preset time period before the forecast time;
[0087] Taking the start time of the weather data to be predicted as the target segmentation starting point, determining the next target segmentation starting point for each preset time step, taking the time node of the preset segmentation time after each target segmentation starting point as the target segmentation end point, forming a segmentation data segment based on each target segmentation starting point and the corresponding target segmentation end point, and forming each segmentation data segment into weather segmentation data;
[0088] Obtaining a prompt vector matching the weather segmentation data from the trained prompt pool as the prompt vector to be spliced, and splicing the weather segmentation data and the prompt vector to be spliced to obtain spliced weather segmentation data;
[0089] The spliced weather segmentation data is input into the trained extreme weather prediction large model to determine the extreme weather prediction data of the second preset time after the prediction moment.
[0090] In the above embodiment, an extreme weather forecast signal is received, which may come from a user request, an automatic monitoring system or other triggering mechanism, indicating that the system needs to predict future extreme weather conditions. Then, according to the prediction time specified in the prediction signal, a time period of a first preset time length is traced back to obtain the weather data to be predicted within this time period. This first preset time length is set according to the training data and prediction requirements of the model to ensure that there is enough data to support the prediction. Then, these weather data to be predicted will be segmented. Specifically, the start time of the data is used as the first target segmentation starting point, and then the subsequent target segmentation starting points are determined according to the preset time step. For each target segmentation starting point, the time node of the next preset segmentation time length is taken as the target segmentation end point. In this way, each target segmentation starting point and the corresponding target segmentation end point constitute a segmented data segment. In this way, the system can segment the original weather data to be predicted into multiple smaller and easier to process data segments, namely weather segmentation data. Next, the prompt vectors that match these weather segmentation data are found in the trained prompt pool (specifically, the similarity between the weather segmentation data and each weather data vector in the prompt pool can be calculated, and the prompt vectors corresponding to the weather data vectors with the preset ranking at the top can be taken after the similarity is sorted from large to small). These prompt vectors are learned during the model training process, and they can capture certain key features or patterns of weather data. The found prompt vectors will be used as the prompt vectors to be spliced and spliced with the weather segmentation data to enrich the feature representation of the input data. The spliced weather segmentation data is input into the trained extreme weather prediction model. This model has been trained with a large amount of historical weather data and extreme weather events, and can learn the laws and patterns of extreme weather occurrence. Based on the input data, the model will predict the extreme weather conditions for the second preset period of time after the prediction moment, and output the corresponding extreme weather forecast data.
[0091] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another extreme weather prediction method based on a large model is provided, such as Figure 2 As shown, the method includes:
[0092] Step 201: Receive an extreme weather forecast signal, and based on the forecast time corresponding to the extreme weather forecast signal, obtain multiple types of to-be-forecasted weather data for the first preset time period before the forecast time.
[0093] Step 202: for each type of weather data to be predicted, the starting time of the weather data to be predicted is used as the target segmentation starting point, each preset time step determines the next target segmentation starting point, and the time node of the preset segmentation time after each target segmentation starting point is taken as the target segmentation end point, and a segmentation data segment is formed based on each target segmentation starting point and the corresponding target segmentation end point, and each segmentation data segment is combined into weather segmentation data.
[0094] Step 203: for each type of weather segmentation data, obtain a prompt vector matching the weather segmentation data from the prompt pool of the corresponding type as the prompt vector to be spliced, splice the weather segmentation data and the prompt vector to be spliced to obtain the spliced weather segmentation data, input the spliced weather segmentation data into the trained extreme weather prediction large model of the corresponding type, and determine the extreme weather prediction data of the second preset time after the prediction moment.
[0095] Step 204: Comprehensively determine the extreme weather information for the second preset time period after the predicted time based on various types of extreme weather forecast data.
[0096] In the above embodiment, an extreme weather forecast signal is received, which includes a specific time of the forecast. Based on the forecast time, multiple types of weather data to be forecasted within the first preset time before the time are traced back and obtained. These data types may include temperature, humidity, air pressure, wind speed, wind direction, precipitation, etc. For each type of weather data to be forecasted, the system takes its starting time as the target segmentation starting point, and according to the preset time step, the system determines the subsequent target segmentation starting points in sequence. For each target segmentation starting point, the system takes the time node of the preset segmentation time thereafter as the target segmentation end point. Each target segmentation starting point and the corresponding target segmentation end point constitute a segmentation data segment, thereby generating weather segmentation data. For each type of weather segmentation data, a matching prompt vector is found in the prompt pool of the corresponding type. Specifically, the similarity between the weather segmentation data and each weather data vector in the prompt pool can be calculated, and the prompt vector corresponding to the weather data vector with the preset position in the top ranking is taken after the similarity is sorted from large to small. The found prompt vector is spliced with the weather segmentation data to obtain the spliced weather segmentation data, and the spliced data is input into the corresponding type of trained extreme weather prediction large model, and the model predicts the extreme weather conditions of the second preset time after the prediction moment based on the input data. Comprehensive analysis and processing are performed based on various types of extreme weather prediction data. By combining multiple types of prediction data, more accurate and comprehensive extreme weather information can be determined. The embodiment of the present application takes into account various types of weather data, which helps to more fully understand the complexity of the weather system.
[0097] By applying the technical solution of this embodiment, a prompt pool is set up to predict extreme weather, and suitable prompt words are automatically found according to different inputs. This method can greatly improve the prediction accuracy, and can achieve non-steady-state long-term prediction, predict future meteorological changes early, so that preparations can be made in advance to avoid extreme weather causing property losses to the marine aquaculture industry.
[0098] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides an extreme weather prediction device based on a large model, such as Figure 3 As shown, the device comprises:
[0099] A data acquisition module, used to acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at consecutive time nodes;
[0100] A sample construction module, used to segment each extreme weather sample data to obtain at least one set of sample data pairs, and use each set of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair includes a first weather data sample of a first preset time length and a second weather data sample of a second preset time length, and the second preset time length is a continuous period after the first preset time length;
[0101] a prompt enhancement module, configured to obtain a target prompt vector matching the first weather data sample from a prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector;
[0102] A model training module, used for inputting the input vector into the extreme weather prediction large model, obtaining the predicted weather data of the second preset time period, performing loss calculation based on the second weather data sample and the preset weather data, and optimizing the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool according to the loss calculation result, so as to obtain the trained extreme weather prediction large model and the prompt pool;
[0103] The weather prediction module is used to predict extreme weather based on the trained extreme weather prediction model and prompt pool.
[0104] In the embodiment of the present application, optionally, the prompt enhancement module is further used to:
[0105] Calculate the similarity between the first weather data sample and each weather data vector in the prompt pool, and determine the target weather data vector in each weather data vector based on the similarity, and determine the prompt vector corresponding to the target weather data vector as the target prompt vector matching the first weather data sample, wherein the prompt pool includes multiple weather data vectors and a prompt vector matching each weather data vector.
[0106] In the embodiment of the present application, optionally, the prompt enhancement module is further used to:
[0107] The similarities are sorted from large to small, and the weather data vector corresponding to the similarity of the first preset ranking is taken as the target weather data vector;
[0108] The constructing an input vector based on the first weather data sample and the target prompt vector comprises:
[0109] The first weather data sample is vector encoded, and the target prompt vectors corresponding to the target weather data vectors are sorted according to the similarity corresponding to the target weather data vectors, and the encoded first weather data sample and the sorted target prompt vectors are concatenated to obtain the input vector.
[0110] In the embodiment of the present application, optionally, the sample construction module is further used to:
[0111] For any extreme weather sample data, take any time node in the extreme weather sample data as the starting point, and take the time node with a preset time length away from the starting point as the end point, wherein the preset time length is the sum of the first preset time length and the second preset time length; take the starting point as the first segmentation starting point, determine the next segmentation starting point every preset time step, and take the time node of the preset segmentation time length after each segmentation starting point as the segmentation end point, and construct a segmentation sample segment based on each segmentation starting point and the corresponding segmentation end point, wherein the preset time step is less than the preset segmentation time length; take the segmentation sample segment corresponding to the first preset time length to construct the first weather data sample, and take the segmentation sample segment corresponding to the second preset time length to construct the second weather data sample.
[0112] In the embodiment of the present application, optionally, the preset time step is half of the preset segmentation duration, and the first preset duration is greater than the second preset duration.
[0113] In the embodiment of the present application, optionally, the weather forecast module is further used to:
[0114] Receiving an extreme weather forecast signal, and based on a forecast time corresponding to the extreme weather forecast signal, acquiring weather data to be forecasted for a first preset time period before the forecast time;
[0115] Taking the start time of the weather data to be predicted as the target segmentation starting point, determining the next target segmentation starting point for each preset time step, taking the time node of the preset segmentation time after each target segmentation starting point as the target segmentation end point, forming a segmentation data segment based on each target segmentation starting point and the corresponding target segmentation end point, and forming each segmentation data segment into weather segmentation data;
[0116] Obtaining a prompt vector matching the weather segmentation data from the trained prompt pool as the prompt vector to be spliced, and splicing the weather segmentation data and the prompt vector to be spliced to obtain spliced weather segmentation data;
[0117] The spliced weather segmentation data is input into the trained extreme weather prediction large model to determine the extreme weather prediction data of the second preset time after the prediction moment.
[0118] In an embodiment of the present application, optionally, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the prompt pool includes a temperature prompt pool, a humidity prompt pool, a wind speed prompt pool, a wind direction prompt pool, and a precipitation prompt pool; the extreme weather prediction big model includes a temperature prediction big model, a humidity prediction big model, a wind speed prediction big model, a wind direction prediction big model, and a precipitation prediction big model.
[0119] In the embodiment of the present application, optionally, the weather forecast module is further used to:
[0120] Acquire multiple types of to-be-forecasted weather data for the first preset time period before the forecast time;
[0121] Segment each type of weather data to be predicted respectively and form each type of weather segmentation data;
[0122] For each type of weather segmentation data, respectively, a prompt vector matching the weather segmentation data is obtained from a prompt pool of the corresponding type as a prompt vector to be spliced, the weather segmentation data and the prompt vector to be spliced are spliced to obtain spliced weather segmentation data, and the spliced weather segmentation data is input into a trained extreme weather prediction large model of the corresponding type to determine extreme weather prediction data for the second preset time after the prediction moment;
[0123] The extreme weather information of the second preset time period after the predicted moment is comprehensively determined based on various types of extreme weather forecast data.
[0124] It should be noted that for other corresponding descriptions of the functional units involved in the extreme weather prediction device based on a large model provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.
[0125] The embodiment of the present application also provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a bus, a processor, a memory and a communication interface, and can also include an input and output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0126] Those skilled in the art will appreciate that the structure of the above-mentioned computer device is only a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0128] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0129] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0130] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for extreme weather prediction based on a large model, characterized in that: The method comprises: Acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at consecutive time nodes; Segment each of the extreme weather sample data to obtain at least one set of sample data pairs, and use each set of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair includes a first weather data sample of a first preset time length and a second weather data sample of a second preset time length, and the second preset time length is a continuous period after the first preset time length; Acquire a target prompt vector matching the first weather data sample in a prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector; Input the input vector into the extreme weather prediction big model to obtain the predicted weather data of the second preset time period, perform loss calculation based on the second weather data sample and the preset weather data, and optimize the model parameters of the extreme weather prediction big model and the target prompt vector in the prompt pool according to the loss calculation result to obtain the trained extreme weather prediction big model and the prompt pool; Extreme weather prediction is performed based on the trained extreme weather prediction large model and prompt pool.
2. The method according to claim 1, characterized in that The step of acquiring a target prompt vector matching the first weather data sample in a prompt pool includes: Calculate the similarity between the first weather data sample and each weather data vector in the prompt pool, and determine the target weather data vector in each weather data vector based on the similarity, and determine the prompt vector corresponding to the target weather data vector as the target prompt vector matching the first weather data sample, wherein the prompt pool includes multiple weather data vectors and a prompt vector matching each weather data vector.
3. The method according to claim 2, characterized in that The determining of a target weather data vector among the weather data vectors based on the similarity comprises: The similarities are sorted from large to small, and the weather data vector corresponding to the similarity of the first preset ranking is taken as the target weather data vector; The constructing an input vector based on the first weather data sample and the target prompt vector comprises: The first weather data sample is vector encoded, and the target prompt vectors corresponding to the target weather data vectors are sorted according to the similarity corresponding to the target weather data vectors, and the encoded first weather data sample and the sorted target prompt vectors are concatenated to obtain the input vector.
4. The method according to claim 1, characterized in that: The step of segmenting the extreme weather sample data according to each of the pieces to obtain at least one set of sample data pairs includes: For any extreme weather sample data, take any time node in the extreme weather sample data as the starting point, and take the time node with a preset time length away from the starting point as the end point, wherein the preset time length is the sum of the first preset time length and the second preset time length; take the starting point as the first segmentation starting point, determine the next segmentation starting point every preset time step, and take the time node of the preset segmentation time length after each segmentation starting point as the segmentation end point, and construct a segmentation sample segment based on each segmentation starting point and the corresponding segmentation end point, wherein the preset time step is less than the preset segmentation time length; take the segmentation sample segment corresponding to the first preset time length to construct the first weather data sample, and take the segmentation sample segment corresponding to the second preset time length to construct the second weather data sample.
5. The method according to claim 1, characterized in that The extreme weather prediction based on the trained extreme weather prediction large model and the prompt pool includes: Receiving an extreme weather forecast signal, and based on a forecast time corresponding to the extreme weather forecast signal, acquiring weather data to be forecasted for a first preset time period before the forecast time; Taking the start time of the weather data to be predicted as the target segmentation starting point, determining the next target segmentation starting point for each preset time step, taking the time node of the preset segmentation time after each target segmentation starting point as the target segmentation end point, forming a segmentation data segment based on each target segmentation starting point and the corresponding target segmentation end point, and forming each segmentation data segment into weather segmentation data; Obtaining a prompt vector matching the weather segmentation data from the trained prompt pool as the prompt vector to be spliced, and splicing the weather segmentation data and the prompt vector to be spliced to obtain spliced weather segmentation data; The spliced weather segmentation data is input into the trained extreme weather prediction large model to determine the extreme weather prediction data of the second preset time after the prediction moment.
6. The method according to any one of claims 1 to 5, characterized in that The types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the prompt pool includes a temperature prompt pool, a humidity prompt pool, a wind speed prompt pool, a wind direction prompt pool, and a precipitation prompt pool; the extreme weather prediction big model includes a temperature prediction big model, a humidity prediction big model, a wind speed prediction big model, a wind direction prediction big model, and a precipitation prediction big model.
7. The method according to claim 6, characterized in that The extreme weather prediction based on the trained extreme weather prediction large model and the prompt pool includes: Acquire multiple types of to-be-forecasted weather data for the first preset time period before the forecast time; Segment each type of weather data to be predicted respectively and form each type of weather segmentation data; For each type of weather segmentation data, respectively, a prompt vector matching the weather segmentation data is obtained from a prompt pool of the corresponding type as a prompt vector to be spliced, the weather segmentation data and the prompt vector to be spliced are spliced to obtain spliced weather segmentation data, and the spliced weather segmentation data is input into a trained extreme weather prediction large model of the corresponding type to determine extreme weather prediction data for the second preset time after the prediction moment; The extreme weather information of the second preset time period after the predicted moment is comprehensively determined based on various types of extreme weather forecast data.
8. An extreme weather prediction device based on a large model, characterized in that: The device comprises: A data acquisition module, used to acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at consecutive time nodes; A sample construction module, used to segment each extreme weather sample data to obtain at least one set of sample data pairs, and use each set of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair includes a first weather data sample of a first preset time length and a second weather data sample of a second preset time length, and the second preset time length is a continuous period after the first preset time length; a prompt enhancement module, configured to obtain a target prompt vector matching the first weather data sample from a prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector; A model training module, used for inputting the input vector into the extreme weather prediction large model, obtaining the predicted weather data of the second preset time period, performing loss calculation based on the second weather data sample and the preset weather data, and optimizing the model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool according to the loss calculation result, so as to obtain the trained extreme weather prediction large model and the prompt pool; The weather prediction module is used to predict extreme weather based on the trained extreme weather prediction model and prompt pool.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Weather prediction model generation method and device and weather prediction method and device
CN112363251A
Fault diagnosis method and device for hydroelectric generating set and electronic equipment
CN114528874A
Text processing method, man-machine interaction method, equipment and storage medium
CN116450792A
Intelligent power grid load prediction method based on federated learning
CN116706888A
Sustainable learning image classification model training method and image classification method
CN117788945A
Cited By
Weather description information generation method and device, medium and equipment
CN121413788A