Extreme weather prediction method and device based on large model, storage medium and equipment
By constructing a training sample set and a cue pool, the target cue vector is obtained, and the large-scale extreme weather prediction model is optimized. This solves the label offset problem in extreme weather prediction, improves prediction accuracy and model adaptability, and is applicable to accurate prediction in fields such as marine aquaculture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies suffer from label offset issues in extreme weather forecasting, resulting in poor forecast accuracy, and there is a lack of effective solutions.
An extreme weather prediction method based on a large model is adopted. By constructing a training sample set and a cue pool, target cue vectors matching weather data samples are obtained, input vectors are constructed, and the model parameters and cue pool of the extreme weather prediction large model are optimized to achieve non-steady-state long-term prediction.
It significantly improves the accuracy of extreme weather forecasts and the generalization performance of models, enabling early prediction of future weather changes and helping industries such as aquaculture to take measures in advance to reduce losses.
Smart Images

Figure CN119646447B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of extreme weather prediction technology, and in particular to an extreme weather prediction method and apparatus, storage medium, and computer equipment based on a large model. Background Technology
[0002] Extreme weather forecasting is crucial for many industries and people's daily lives. For example, in marine aquaculture, extreme weather events (such as torrential rains and hurricanes) can cause significant losses, including damage to fishing vessels and facilities, hindered fish growth, and deterioration of water quality. Accurate forecasting of extreme weather events can help aquaculture farms take preventative measures to reduce potential economic losses. Marine aquaculture requires well-planned production processes, including planting, feeding, and harvesting. Extreme weather can disrupt these plans; for example, strong winds may force fishing vessels to temporarily cease operations. Accurate forecasting of extreme weather can help aquaculture farms optimize their production schedules, improving efficiency and stability. Extreme weather can also threaten the survival and welfare of farmed animals. High temperatures, low temperatures, and changes in pH levels can all harm fish and other marine life. Advance forecasting of extreme weather can help aquaculture farms take appropriate measures to protect the health and well-being of their animals.
[0003] Extreme weather is a typical example of the label shift problem. Directly using models to predict weather patterns will yield poor results. Currently, there is no good solution for extreme weather forecasting. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method and apparatus, storage medium, and computer equipment for extreme weather prediction based on a large model. To address the problem of predicting extreme weather, a prompt pool is set up to automatically find appropriate prompt words based on different inputs. This method can significantly improve prediction accuracy and achieve long-term, non-steady-state predictions, allowing for early prediction of future weather changes. This enables advance preparation and avoids property losses to the marine aquaculture industry caused by extreme weather.
[0005] According to one aspect of this application, a method for predicting extreme weather based on a large model is provided, the method comprising:
[0006] Acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at continuous time points;
[0007] The extreme weather sample data is segmented according to each of the above to obtain at least one set of sample data pairs, and each set of sample data pairs is used as a training sample to construct a training sample set. The sample data pairs include a first weather data sample of a first preset duration and a second weather data sample of a second preset duration, wherein the second preset duration is a continuous period after the first preset duration.
[0008] Obtain a target prompt vector that matches the first weather data sample from the prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector;
[0009] The input vector is input into the extreme weather prediction model to obtain the predicted weather data for the second preset duration. Loss is calculated based on the second weather data sample and the preset weather data. The model parameters of the extreme weather prediction model and the target prompt vector in the prompt pool are optimized according to the loss calculation results to obtain the trained extreme weather prediction model and prompt pool.
[0010] Extreme weather prediction is based on a trained large-scale extreme weather prediction model and a cue pool.
[0011] Optionally, in this embodiment of the application, obtaining the target prompt vector matching the first weather data sample from the prompt pool includes:
[0012] The similarity between the first weather data sample and each weather data vector in the prompt pool is calculated, and the target weather data vector in each weather data vector is determined based on the similarity. 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 pool includes multiple weather data vectors and a prompt vector that matches each weather data vector.
[0013] Optionally, in this embodiment of the application, determining the target weather data vector among the weather data vectors based on the similarity includes:
[0014] The similarity scores are sorted from largest to smallest, and the weather data vectors corresponding to the top preset similarity scores are taken as the target weather data vectors.
[0015] The step of constructing the input vector based on the first weather data sample and the target cue vector includes:
[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 their similarity. The encoded first weather data sample and the sorted target prompt vectors are then concatenated to obtain the input vector.
[0017] Optionally, in this embodiment of the application, the step of segmenting 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 a time node that is a preset time interval away from the starting point as the ending point, where the preset time interval is the sum of the first preset time interval and the second preset time interval; take the starting point as the first segmentation starting point, determine the next segmentation starting point at preset time steps, and take the time node after each segmentation starting point with a preset segmentation time interval as the segmentation ending point. Based on each segmentation starting point and the corresponding segmentation ending point, a segmented sample segment is formed, where the preset time step is less than the preset segmentation time interval; take the segmented sample segment corresponding to the first preset time interval to construct the first weather data sample, and take the segmented sample segment corresponding to the second preset time interval to construct the second weather data sample.
[0019] Optionally, in this embodiment of the application, the extreme weather prediction based on the trained extreme weather prediction large model and the cue pool includes:
[0020] Receive extreme weather forecast signals, and based on the forecast time corresponding to the extreme weather forecast signals, obtain the weather data to be predicted for the first preset duration before the forecast time;
[0021] The starting time of the weather data to be predicted is taken as the target segmentation starting point. Each preset time step determines the next target segmentation starting point. The time node of the preset segmentation duration after each target segmentation starting point is taken as the target segmentation ending point. A segmented data segment is formed based on each target segmentation starting point and the corresponding target segmentation ending point. The segmented data segments are combined to form weather segmented data.
[0022] The prompt vector that matches the weather segmentation data is obtained from the prompt pool after training as the prompt vector to be concatenated. The weather segmentation data and the prompt vector to be concatenated are concatenated to obtain the concatenated weather segmentation data.
[0023] The spliced weather segmentation data is input into the trained extreme weather prediction model to determine the extreme weather prediction data for the second preset duration after the prediction time.
[0024] Optionally, in this embodiment of the application, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the alert pool includes a temperature alert pool, a humidity alert pool, a wind speed alert pool, a wind direction alert pool, and a precipitation alert pool; the large-scale extreme weather prediction model includes a large-scale temperature prediction model, a large-scale humidity prediction model, a large-scale wind speed prediction model, a large-scale wind direction prediction model, and a large-scale precipitation prediction model.
[0025] Optionally, in this embodiment of the application, the extreme weather prediction based on the trained extreme weather prediction large model and the cue pool includes:
[0026] Acquire multiple types of weather data to be predicted for the first preset duration prior to the predicted time;
[0027] The weather data to be predicted of each type is segmented and combined into weather segment data of each type.
[0028] For each type of weather segmentation data, a prompt vector matching the weather segmentation data is obtained from the 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. The spliced weather segmentation data is input into the corresponding type of trained extreme weather prediction big model to determine the extreme weather prediction data for the second preset time after the prediction time.
[0029] The extreme weather information for the second preset duration after the predicted time is determined based on a comprehensive analysis of various types of extreme weather forecast data.
[0030] According to another aspect of this application, an extreme weather prediction device based on a large model is provided, the device comprising:
[0031] The data acquisition module is used to acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at continuous time points;
[0032] The sample construction module is used to segment the extreme weather sample data according to each of the extreme weather sample data to obtain at least one set of sample data pairs, and to use each set of sample data pairs as a training sample to construct a training sample set. The sample data pairs include a first weather data sample of a first preset duration and a second weather data sample of a second preset duration, wherein the second preset duration is a continuous period of time after the first preset duration.
[0033] The prompt enhancement module is used to obtain a target prompt vector that matches the first weather data sample from the prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector;
[0034] The model training module is used to input the input vector into the extreme weather prediction large model to obtain the predicted weather data for the second preset duration, 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, so as to obtain the trained extreme weather prediction large model and prompt pool.
[0035] The weather forecasting module is used to forecast extreme weather based on a trained large-scale extreme weather forecasting model and a cue pool.
[0036] Optionally, in this embodiment of the application, the prompt enhancement module is further configured to:
[0037] The similarity between the first weather data sample and each weather data vector in the prompt pool is calculated, and the target weather data vector in each weather data vector is determined based on the similarity. 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 pool includes multiple weather data vectors and a prompt vector that matches each weather data vector.
[0038] Optionally, in this embodiment of the application, the prompt enhancement module is further configured to:
[0039] The similarity scores are sorted from largest to smallest, and the weather data vectors corresponding to the top preset similarity scores are taken as the target weather data vectors.
[0040] The step of constructing the input vector based on the first weather data sample and the target cue vector includes:
[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 their similarity. The encoded first weather data sample and the sorted target prompt vectors are then concatenated to obtain the input vector.
[0042] Optionally, in this embodiment of the application, the sample construction module is further configured to:
[0043] For any extreme weather sample data, take any time node in the extreme weather sample data as the starting point, and take a time node that is a preset time interval away from the starting point as the ending point, where the preset time interval is the sum of the first preset time interval and the second preset time interval; take the starting point as the first segmentation starting point, determine the next segmentation starting point at preset time steps, and take the time node after each segmentation starting point with a preset segmentation time interval as the segmentation ending point. Based on each segmentation starting point and the corresponding segmentation ending point, a segmented sample segment is formed, where the preset time step is less than the preset segmentation time interval; take the segmented sample segment corresponding to the first preset time interval to construct the first weather data sample, and take the segmented sample segment corresponding to the second preset time interval to construct the second weather data sample.
[0044] Optionally, in this embodiment of the application, the preset time step is half of the preset segmentation duration, and the first preset duration is longer than the second preset duration.
[0045] Optionally, in this embodiment of the application, the weather forecasting module is further configured to:
[0046] Receive extreme weather forecast signals, and based on the forecast time corresponding to the extreme weather forecast signals, obtain the weather data to be predicted for the first preset duration before the forecast time;
[0047] The starting time of the weather data to be predicted is taken as the target segmentation starting point. Each preset time step determines the next target segmentation starting point. The time node of the preset segmentation duration after each target segmentation starting point is taken as the target segmentation ending point. A segmented data segment is formed based on each target segmentation starting point and the corresponding target segmentation ending point. The segmented data segments are combined to form weather segmented data.
[0048] The prompt vector that matches the weather segmentation data is obtained from the prompt pool after training as the prompt vector to be concatenated. The weather segmentation data and the prompt vector to be concatenated are concatenated to obtain the concatenated weather segmentation data.
[0049] The spliced weather segmentation data is input into the trained extreme weather prediction model to determine the extreme weather prediction data for the second preset duration after the prediction time.
[0050] Optionally, in this embodiment of the application, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the alert pool includes a temperature alert pool, a humidity alert pool, a wind speed alert pool, a wind direction alert pool, and a precipitation alert pool; the large-scale extreme weather prediction model includes a large-scale temperature prediction model, a large-scale humidity prediction model, a large-scale wind speed prediction model, a large-scale wind direction prediction model, and a large-scale precipitation prediction model.
[0051] Optionally, in this embodiment of the application, the weather forecasting module is further configured to:
[0052] Acquire multiple types of weather data to be predicted for the first preset duration prior to the predicted time;
[0053] The weather data to be predicted of each type is segmented and combined into weather segment data of each type.
[0054] For each type of weather segmentation data, a prompt vector matching the weather segmentation data is obtained from the 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. The spliced weather segmentation data is input into the corresponding type of trained extreme weather prediction big model to determine the extreme weather prediction data for the second preset time after the prediction time.
[0055] The extreme weather information for the second preset duration after the predicted time is determined based on a comprehensive analysis of various types of extreme weather forecast data.
[0056] According to another aspect of this application, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described extreme weather prediction method based on a large model.
[0057] According to another aspect of this 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 executes the program to implement the above-described extreme weather prediction method based on a large model.
[0058] By employing the above technical solutions, this application provides a method, apparatus, storage medium, and computer device for extreme weather prediction based on a large model. This method constructs a training sample set by collecting extreme weather samples containing weather data at continuous time points. Each data pair in the training sample set consists of a first weather data sample of a first preset duration and a second weather data sample of a second preset duration. Next, a target cue vector matching the first weather data sample is selected from a cue pool and combined with the first weather data sample to construct an input vector. The input vector is input into the large-scale extreme weather prediction model to obtain predicted weather data, and loss calculation is performed between the predicted and actual weather data. Based on the loss calculation results, the model parameters of the large-scale extreme weather prediction model and the target cue vector in the cue pool are optimized. Finally, extreme weather prediction is performed using the trained model and the cue pool. This application, by introducing cue vectors and constructing a large model, can more accurately capture the spatiotemporal characteristics and nonlinear relationships of weather data, thereby improving the prediction accuracy of extreme weather. Furthermore, the use of cue vectors allows the model to better adapt to the characteristics of extreme weather in different regions and seasons, enhancing the model's generalization performance. In summary, this solution significantly improves the prediction accuracy and model generalization ability of extreme weather by introducing cue vectors and optimizing large models, providing strong technical support for addressing the challenges of extreme weather.
[0059] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0060] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0061] Figure 1 The diagram illustrates a flowchart of an extreme weather prediction method based on a large model, as provided in an embodiment of this application.
[0062] Figure 2 This paper illustrates a flowchart of another extreme weather prediction method based on a large model provided in an embodiment of this application.
[0063] Figure 3 This illustration shows a structural schematic diagram of an extreme weather prediction device based on a large model, provided in an embodiment of this application. Detailed Implementation
[0064] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0065] This embodiment provides a method for predicting extreme weather based on a large model, such as... Figure 1 As shown, the method includes:
[0066] Step 101: Obtain extreme weather sample data, wherein the extreme weather sample data includes weather data samples at continuous time points.
[0067] In this embodiment, extreme weather samples containing continuous time-point weather data are first acquired. These sample data typically originate from meteorological observation stations, satellite data, radar images, etc., and cover detailed weather information of historical extreme weather events (such as typhoons, heavy rain, blizzards, droughts, etc.). This data can include information from multiple dimensions such as temperature, humidity, air pressure, wind speed, wind direction, and precipitation, and is recorded continuously in chronological order. In addition to extreme weather data, the extreme weather sample data also includes normal weather data.
[0068] Step 102: Segment the extreme weather sample data according to each of the above-mentioned extreme weather samples 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. The sample data pairs include a first weather data sample of a first preset duration and a second weather data sample of a second preset duration, wherein the second preset duration is a continuous period of time after the first preset duration.
[0069] In this embodiment, the extreme weather sample data are segmented chronologically, with each extreme weather sample forming at least one sample data pair. Each sample data pair 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 and second preset durations are manually set according to the forecasting requirements. For example, if the goal is to predict extreme weather for the next week, the first preset duration might be set to 3 days, and the second preset duration to the next 7 days. If the goal is to predict extreme weather for the next 12 hours, the first preset duration could be set to 48 hours, and the second preset duration to the next 12 hours. This allows for the use of past weather data to predict future weather conditions, and those skilled in the art can set these parameters according to actual usage requirements.
[0070] Step 103: Obtain the target prompt vector that matches the first weather data sample from the prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector.
[0071] In this embodiment, extreme weather is a typical label shift problem. Directly using a large model to predict weather patterns due to label shift is ineffective. A simple approach is to input prompt words to learn the characteristics of extreme weather. However, static prompt words are also ineffective for this non-steady-state problem. Therefore, this embodiment automatically finds suitable prompt words based on different inputs. This method significantly improves prediction accuracy and enables long-term, non-steady-state predictions, allowing for early forecasting of future weather changes. To improve the performance of the prediction model, the concept of a prompt vector is introduced. A 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, a target prompt vector matching the characteristics of the first weather data sample is selected. Then, the first weather data sample and the target prompt vector are combined to construct an input vector. This input vector will serve as the input to the large-scale extreme weather prediction model.
[0072] Step 104: Input the input vector into the extreme weather prediction model to obtain the predicted weather data for the second preset duration. 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 model and the target prompt vector in the prompt pool according to the loss calculation results to obtain the trained extreme weather prediction model and prompt pool.
[0073] In this embodiment, the constructed input vector is input into a large-scale extreme weather prediction model. The model generates predicted weather data for a second preset duration based on the input vector. Then, the predicted weather data is compared with the actual second weather data sample, and a 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 large-scale extreme weather prediction model and the target cue vector in the cue pool are optimized to reduce prediction error and improve prediction accuracy. This process is iterated multiple times until a predetermined training stopping condition is reached (e.g., the loss value no longer decreases significantly).
[0074] Step 105: Make extreme weather predictions based on the trained extreme weather prediction big model and cue pool.
[0075] In this embodiment, after the model training is completed, the trained extreme weather prediction model and cue pool can be used to perform actual extreme weather predictions. New weather data (including weather data for a first preset duration) is input into the model, and the model outputs predicted weather conditions for a future period (a second preset duration). These predictions 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 alert pools include temperature alert pools, humidity alert pools, wind speed alert pools, wind direction alert pools, and precipitation alert pools; the large-scale extreme weather prediction models include large-scale temperature prediction models, large-scale humidity prediction models, large-scale wind speed prediction models, large-scale wind direction prediction models, and large-scale precipitation prediction models.
[0077] In this embodiment, a single-dimensional extreme weather prediction method can be adopted, using weather data of a first preset duration to predict weather data of a second preset duration. For example, temperature data of the past 48 hours can be used to predict temperature data for the next 12 hours. To improve the accuracy of weather prediction, specific alert pools and prediction models are designed for each type of weather data. For different types of weather sample data, corresponding alert pools are used to obtain alert vectors, and the corresponding alert pools and prediction models are trained based on the weather sample data. After the training of the alert pools and models is completed, different types of historical weather data can be used to predict different types of future weather data. Furthermore, a comprehensive prediction of future weather can be made based on the prediction information of different types of future weather data. For example, if precipitation and wind speed have reached the corresponding extreme weather thresholds, it can be determined that a typhoon 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 at continuous time points. Each data pair in the training sample set consists of a first weather data sample of a first preset duration and a second weather data sample of a second preset duration. Next, a target cue vector matching the first weather data sample is selected from the cue pool and combined with the first weather data sample to construct an input vector. The input vector is input into the large-scale extreme weather prediction model to obtain predicted weather data, and loss calculation is performed with the actual weather data. Based on the loss calculation results, the model parameters of the large-scale extreme weather prediction model and the target cue vector in the cue pool are optimized. Finally, extreme weather prediction is performed using the trained model and the cue pool. This embodiment, by introducing cue vectors and constructing a large-scale model, can more accurately capture the spatiotemporal characteristics and nonlinear relationships of weather data, thereby improving the prediction accuracy of extreme weather. Furthermore, the use of cue vectors allows the model to better adapt to the characteristics of extreme weather in different regions and seasons, enhancing the model's generalization performance. In summary, this solution, by introducing cue vectors and optimizing the large-scale model, significantly improves the prediction accuracy and model generalization ability of extreme weather, providing strong technical support for addressing the challenges of extreme weather.
[0079] Optionally, in this embodiment of the application, the step 103 of obtaining the 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, 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, firstly, the similarity between the first weather data sample and each weather data vector in the cue pool is calculated. This can be achieved using various similarity calculation methods, such as cosine similarity, Euclidean distance, Manhattan distance, etc., with the specific choice depending on the characteristics of the weather data vectors and the requirements of the prediction task. Next, based on the calculated similarity, a weather data vector with a high similarity to the first weather data sample is selected from the cue pool as the target weather data vector. Finally, the cue vector corresponding to the target weather data vector is determined as the target cue vector matching the first weather data sample. Cue vectors are associated with weather data vectors and may contain additional information or context about the features of the weather data vectors. This information helps the large-scale extreme weather prediction model to more accurately understand the input data. By introducing cue vectors and a similarity-based matching mechanism, the features of weather data can be captured more accurately, thereby improving the prediction accuracy of extreme weather.
[0081] Optionally, in this embodiment, determining the target weather data vector among the weather data vectors based on the similarity includes: sorting the similarities from largest to smallest, and taking the weather data vector corresponding to the first preset similarity as the target weather data vector; the step 103 of constructing an input vector based on the first weather data sample and the target prompt vector includes: vector encoding the first weather data sample, sorting the target prompt vectors corresponding to the target weather data vectors according to the similarity, sorting the target prompt vectors corresponding to the target weather data vectors, and concatenating 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 alert pool, these similarities are sorted from largest to smallest. The weather data vector corresponding to the top preset similarity is taken as the target weather data vector. This preset position can be adjusted according to actual needs to balance prediction accuracy and computational cost. After determining the target weather data vector, an input vector is constructed based on the first weather data sample and the target alert vector. Specifically: Vector encoding: First, the first weather data sample is vector encoded, converting it into a format suitable for input into the extreme weather prediction model. Next, the target alert vectors are sorted according to the similarity ranking of the target weather data vectors. This is done to preserve the order information of the alert vectors most similar to the target weather data vector, which helps the model better understand the context of the input data. Finally, the encoded first weather data sample and the sorted target alert vectors are concatenated to obtain the final input vector. This input vector will be used as the input to the extreme weather prediction model to generate predicted weather data. This application's embodiments, by introducing similarity ranking and cue vectors, can more accurately capture the features and time-series relationships of weather data, thereby improving the prediction accuracy of extreme weather. The ranked cue vectors provide additional contextual information, which helps the model better adapt to different weather conditions and regional characteristics, enhancing the model's generalization performance.
[0083] Optionally, in this embodiment, step 102, segmenting 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 a time node that is a preset time interval away from the starting point as the ending point, wherein the preset time interval is the sum of the first preset time interval and the second preset time interval; taking the starting point as the first segmentation starting point, determining the next segmentation starting point at preset time steps, and taking the time node after each segmentation starting point that is a preset segmentation time interval as the segmentation ending point, forming a segmented sample segment based on each segmentation starting point and the corresponding segmentation ending point, wherein the preset time step is less than the preset segmentation time interval; constructing the first weather data sample from the segmented sample segment corresponding to the first preset time interval, and constructing the second weather data sample from the segmented sample segment corresponding to the second preset time interval. The preset time step is half of the preset segmentation time interval, and the first preset time interval is greater than the second preset time interval.
[0084] In this embodiment, for any extreme weather sample data, firstly, any time node is selected as the starting point. Then, a time node that is a preset time interval (the preset time interval is the sum of the first preset time interval and the second preset time interval) away from the starting point is determined as the ending point. Next, the starting point is used as the first segmentation starting point, and the next segmentation starting point is determined every preset time step (the preset time step is less than the preset segmentation time interval). For each segmentation starting point, the time node that follows it for the preset segmentation time interval is taken as the segmentation ending point. Based on each segmentation starting point and its corresponding segmentation ending point, a segmented sample segment is formed. These segmented sample segments are continuous in time but overlap with each other (because the preset time step is less than the preset segmentation time interval). From each segmented sample segment, the part corresponding to the first preset time interval is taken as the first weather data sample. At the same time, the part corresponding to the second preset time interval (immediately following 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. This application's embodiments utilize a flexible segmentation method to extract more training sample pairs from limited extreme weather sample data, thereby improving data utilization. Because the segmented sample pairs are continuous and overlapping in time, this helps the model learn the time-series characteristics and changing patterns of weather data, thus enhancing the model's generalization ability.
[0085] Optionally, in this embodiment of the application, step 105, which involves making extreme weather predictions based on a trained large-scale extreme weather prediction model and a cue pool, includes:
[0086] Receive extreme weather forecast signals, and based on the forecast time corresponding to the extreme weather forecast signals, obtain the weather data to be predicted for the first preset duration before the forecast time;
[0087] The starting time of the weather data to be predicted is taken as the target segmentation starting point. Each preset time step determines the next target segmentation starting point. The time node of the preset segmentation duration after each target segmentation starting point is taken as the target segmentation ending point. A segmented data segment is formed based on each target segmentation starting point and the corresponding target segmentation ending point. The segmented data segments are combined to form weather segmented data.
[0088] The prompt vector that matches the weather segmentation data is obtained from the prompt pool after training as the prompt vector to be concatenated. The weather segmentation data and the prompt vector to be concatenated are concatenated to obtain the concatenated weather segmentation data.
[0089] The spliced weather segmentation data is input into the trained extreme weather prediction model to determine the extreme weather prediction data for the second preset duration after the prediction time.
[0090] In the above embodiment, an extreme weather forecast signal is received. This signal may originate from a user request, an automatic monitoring system, or other triggering mechanisms, instructing the system to predict future extreme weather conditions. Next, based on the forecast time specified in the forecast signal, a time period of a first preset duration is traced back to obtain the weather data to be predicted within this time period. This first preset duration is set based on the model's training data and prediction requirements to ensure sufficient data to support the prediction. Then, this weather data to be predicted is segmented. Specifically, the start time of the data is used as the first target segmentation starting point, and subsequent target segmentation starting points are determined according to a preset time step. For each target segmentation starting point, the time node of the next preset segmentation duration is taken as the target segmentation ending point. Thus, each target segmentation starting point and its corresponding target segmentation ending point constitute a segmented data segment. Through this method, the system can segment the original weather data to be predicted into multiple smaller, more easily processed data segments, i.e., segmented weather data. Next, the system searches the trained cue pool for cue vectors that match these weather segmentation data. Specifically, it calculates the similarity between the weather segmentation data and each weather data vector in the cue pool, sorts the similarities from highest to lowest, and selects the cue vector corresponding to the top-ranked weather data vector. These cue vectors are learned during model training and capture certain key features or patterns in the weather data. The found cue vectors are then used as concatenated cue vectors and concatenated with the weather segmentation data to enrich the feature representation of the input data. The concatenated weather segmentation data is then input into the trained extreme weather prediction model. This model has been trained using a large amount of historical weather data and extreme weather events, enabling it to learn the patterns and characteristics of extreme weather occurrences. Based on the input data, the model predicts the extreme weather conditions two preset time intervals after the prediction time and outputs the corresponding extreme weather prediction data.
[0091] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and 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 extreme weather forecast signal, and based on the forecast time corresponding to the extreme weather forecast signal, obtain multiple types of weather data to be predicted for the first preset duration before the forecast time.
[0093] Step 202: For each type of weather data to be predicted, take the start time of the weather data to be predicted as the target segmentation starting point, determine the next target segmentation starting point for each preset time step, and take the time node of the preset segmentation duration after each target segmentation starting point as the target segmentation ending point. Based on each target segmentation starting point and the corresponding target segmentation ending point, a segmented data segment is formed, and the segmented data segments are combined to form weather segmented data.
[0094] Step 203: For each type of weather segmented data, obtain the prompt vector matching the weather segmented data from the corresponding prompt pool as the prompt vector to be spliced, splice the weather segmented data and the prompt vector to be spliced to obtain spliced weather segmented data, input the spliced weather segmented data into the corresponding type of trained extreme weather prediction big model, and determine the extreme weather prediction data for the second preset time after the prediction time.
[0095] Step 204: Based on the comprehensive determination of extreme weather information for the second preset duration after the predicted time, the extreme weather forecast data of various types are determined.
[0096] In the above embodiment, an extreme weather forecast signal is received, which includes the specific time of the forecast. Based on the forecast time, multiple types of weather data to be predicted within a first preset time period prior to that time are retrieved. These data types may include temperature, humidity, air pressure, wind speed, wind direction, precipitation, etc. For each type of weather data to be predicted, the system uses its start time as the target segmentation starting point and determines subsequent target segmentation starting points sequentially according to a preset time step. For each target segmentation starting point, the system takes the time node of the preset segmentation time period after it as the target segmentation ending point. Each target segmentation starting point and its corresponding target segmentation ending point constitute a segmented data segment, thereby generating weather segmented data. For each type of weather segmented data, a matching prompt vector is searched in the corresponding prompt pool. Specifically, the similarity between the weather segmented 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 highest preset ranking after sorting the similarity from largest to smallest can be selected. The found cue vectors are concatenated with the weather segmentation data to obtain concatenated weather segmentation data. This concatenated data is then input into a trained extreme weather prediction model of the corresponding type. The model predicts the extreme weather conditions a second preset time after the predicted time based on the input data. Comprehensive analysis and processing are performed based on the extreme weather prediction data of various types. By integrating multiple types of prediction data, more accurate and comprehensive extreme weather information can be determined. This application's embodiments consider multiple types of weather data, which helps to more comprehensively understand the complexity of weather systems.
[0097] By applying the technical solution of this embodiment, a prompt pool is set up to address the problem of predicting extreme weather. Appropriate prompt words are automatically found based on different inputs. This method can significantly improve prediction accuracy and achieve long-term, non-steady-state predictions, allowing for early forecasting of future weather changes. This enables advance preparation and avoids property losses to the marine aquaculture industry caused by extreme weather.
[0098] Furthermore, as Figure 1 In terms of specific implementation, this application provides an extreme weather prediction device based on a large model, such as... Figure 3 As shown, the device includes:
[0099] The data acquisition module is used to acquire extreme weather sample data, wherein the extreme weather sample data includes weather data samples at continuous time points;
[0100] The sample construction module is used to segment the extreme weather sample data according to each of the extreme weather sample data to obtain at least one set of sample data pairs, and to use each set of sample data pairs as a training sample to construct a training sample set. The sample data pairs include a first weather data sample of a first preset duration and a second weather data sample of a second preset duration, wherein the second preset duration is a continuous period of time after the first preset duration.
[0101] The prompt enhancement module is used to obtain a target prompt vector that matches the first weather data sample from the prompt pool, and construct an input vector based on the first weather data sample and the target prompt vector;
[0102] The model training module is used to input the input vector into the extreme weather prediction large model to obtain the predicted weather data for the second preset duration, 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, so as to obtain the trained extreme weather prediction large model and prompt pool.
[0103] The weather forecasting module is used to forecast extreme weather based on a trained large-scale extreme weather forecasting model and a cue pool.
[0104] Optionally, in this embodiment of the application, the prompt enhancement module is further configured to:
[0105] The similarity between the first weather data sample and each weather data vector in the prompt pool is calculated, and the target weather data vector in each weather data vector is determined based on the similarity. 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 pool includes multiple weather data vectors and a prompt vector that matches each weather data vector.
[0106] Optionally, in this embodiment of the application, the prompt enhancement module is further configured to:
[0107] The similarity scores are sorted from largest to smallest, and the weather data vectors corresponding to the top preset similarity scores are taken as the target weather data vectors.
[0108] The step of constructing the input vector based on the first weather data sample and the target cue vector includes:
[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 their similarity. The encoded first weather data sample and the sorted target prompt vectors are then concatenated to obtain the input vector.
[0110] Optionally, in this embodiment of the application, the sample construction module is further configured to:
[0111] For any extreme weather sample data, take any time node in the extreme weather sample data as the starting point, and take a time node that is a preset time interval away from the starting point as the ending point, where the preset time interval is the sum of the first preset time interval and the second preset time interval; take the starting point as the first segmentation starting point, determine the next segmentation starting point at preset time steps, and take the time node after each segmentation starting point with a preset segmentation time interval as the segmentation ending point. Based on each segmentation starting point and the corresponding segmentation ending point, a segmented sample segment is formed, where the preset time step is less than the preset segmentation time interval; take the segmented sample segment corresponding to the first preset time interval to construct the first weather data sample, and take the segmented sample segment corresponding to the second preset time interval to construct the second weather data sample.
[0112] Optionally, in this embodiment of the application, the preset time step is half of the preset segmentation duration, and the first preset duration is longer than the second preset duration.
[0113] Optionally, in this embodiment of the application, the weather forecasting module is further configured to:
[0114] Receive extreme weather forecast signals, and based on the forecast time corresponding to the extreme weather forecast signals, obtain the weather data to be predicted for the first preset duration before the forecast time;
[0115] The starting time of the weather data to be predicted is taken as the target segmentation starting point. Each preset time step determines the next target segmentation starting point. The time node of the preset segmentation duration after each target segmentation starting point is taken as the target segmentation ending point. A segmented data segment is formed based on each target segmentation starting point and the corresponding target segmentation ending point. The segmented data segments are combined to form weather segmented data.
[0116] The prompt vector that matches the weather segmentation data is obtained from the prompt pool after training as the prompt vector to be concatenated. The weather segmentation data and the prompt vector to be concatenated are concatenated to obtain the concatenated weather segmentation data.
[0117] The spliced weather segmentation data is input into the trained extreme weather prediction model to determine the extreme weather prediction data for the second preset duration after the prediction time.
[0118] Optionally, in this embodiment of the application, the types of extreme weather sample data include temperature, humidity, air pressure, wind speed, wind direction, and precipitation; the alert pool includes a temperature alert pool, a humidity alert pool, a wind speed alert pool, a wind direction alert pool, and a precipitation alert pool; the large-scale extreme weather prediction model includes a large-scale temperature prediction model, a large-scale humidity prediction model, a large-scale wind speed prediction model, a large-scale wind direction prediction model, and a large-scale precipitation prediction model.
[0119] Optionally, in this embodiment of the application, the weather forecasting module is further configured to:
[0120] Acquire multiple types of weather data to be predicted for the first preset duration prior to the predicted time;
[0121] The weather data to be predicted of each type is segmented and combined into weather segment data of each type.
[0122] For each type of weather segmentation data, a prompt vector matching the weather segmentation data is obtained from the 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. The spliced weather segmentation data is input into the corresponding type of trained extreme weather prediction big model to determine the extreme weather prediction data for the second preset time after the prediction time.
[0123] The extreme weather information for the second preset duration after the predicted time is determined based on a comprehensive analysis of various types of extreme weather forecast data.
[0124] It should be noted that other corresponding descriptions of the functional units involved in the extreme weather prediction device based on a large model provided in this application embodiment can be found in the following references. Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.
[0125] This application also provides a computer device, specifically a personal computer, server, network device, etc. The computer device includes a bus, processor, memory, and communication interface, and may also include input / output interfaces and a display device. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores location information. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.
[0126] Those skilled in the art will understand that the structure of the computer device described above is only a partial structure related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. A specific computer device may include more or fewer components, or combine certain components, or have different component arrangements.
[0127] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0128] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[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, data stored, data displayed, 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 will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0131] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A large model-based extreme weather prediction method, characterized in that, The method comprises: acquiring extreme weather sample data, wherein the extreme weather sample data comprises weather data samples of continuous time nodes; segmenting according to each piece of extreme weather sample data to obtain at least one set of sample data pairs, and taking each set of sample data pairs as a training sample to construct a training sample set, wherein the sample data pair comprises 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 time period after the first preset time length; acquiring a target prompt vector matching the first weather data sample in a prompt pool, and constructing an input vector based on the first weather data sample and the target prompt vector; inputting the input vector into an extreme weather prediction large model to obtain predicted weather data of the second preset time length, performing loss calculation based on the second weather data sample and the predicted weather data, and optimizing 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 a trained extreme weather prediction large model and a prompt pool; performing extreme weather prediction based on the trained extreme weather prediction large model and the prompt pool; the segmentation according to each piece of extreme weather sample data to obtain at least one set of sample data pairs comprises: for any one piece of extreme weather sample data, taking any time node in the extreme weather sample data as a starting point, and taking a time node with a preset time length from the starting point as an ending point, wherein the preset time length is the sum of the first preset time length and the second preset time length; taking the starting point as the first segmentation starting point, determining the next segmentation starting point every preset time step, and taking the time node with a preset segmentation time length after each segmentation starting point as a segmentation ending point to form a segmentation sample segment based on each segmentation starting point and the corresponding segmentation ending point, wherein the preset time step is less than the preset segmentation time length; and taking the segmentation sample segment corresponding to the first preset time length to construct the first weather data sample, and taking the segmentation sample segment corresponding to the second preset time length to construct the second weather data sample.
2. The method of claim 1, wherein, the acquisition of the target prompt vector matching the first weather data sample in the prompt pool comprises: calculating the similarity between the first weather data sample and each weather data vector in the prompt pool, and determining a 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 comprises a plurality of weather data vectors and a prompt vector matching each weather data vector.
3. The method of claim 2, wherein, the determination of the target weather data vector in each weather data vector based on the similarity comprises: sorting the similarity from large to small, and taking the weather data vector corresponding to the similarity of the front preset rank as the target weather data vector; the construction of the input vector based on the first weather data sample and the target prompt vector comprises: The first weather data sample is vector encoded, the target prompt vector corresponding to the target weather data vector is sorted according to the similarity corresponding to the target weather data vector, the encoded first weather data sample and the sorted target prompt vector are spliced to obtain the input vector.
4. The method of claim 1, wherein, The extreme weather prediction based on the trained extreme weather prediction large model and the prompt pool comprises: An extreme weather prediction signal is received, and based on a prediction time corresponding to the extreme weather prediction signal, weather data to be predicted in the first preset time period before the prediction time is obtained; The starting time of the weather data to be predicted is taken as a target segmentation starting point, and each preset time step determines a next target segmentation starting point, and a time node of a preset segmentation time period after each target segmentation starting point is taken as a target segmentation ending point, a segmentation data segment is formed based on each target segmentation starting point and the corresponding target segmentation ending point, and weather segmentation data is formed by the segmentation data segments; A prompt vector matched with the weather segmentation data is obtained from the trained prompt pool as a to-be-spliced prompt vector, and the weather segmentation data and the to-be-spliced prompt vector are spliced to obtain spliced weather segmentation data; The spliced weather segmentation data is input into the trained extreme weather prediction large model to determine extreme weather prediction data in the second preset time period after the prediction time.
5. The method according to any one of claims 1 to 4, characterized in that, The types of the 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; and the extreme weather prediction large model includes a temperature prediction large model, a humidity prediction large model, a wind speed prediction large model, a wind direction prediction large model, and a precipitation prediction large model.
6. The method of claim 4, wherein, The extreme weather prediction based on the trained extreme weather prediction large model and the prompt pool comprises: Multiple types of weather data to be predicted in the first preset time period before the prediction time are obtained; Each type of weather data to be predicted is segmented and weather segmentation data of each type is formed; For each type of weather segmentation data, a prompt vector matched with the weather segmentation data is obtained from the prompt pool of the corresponding type as a to-be-spliced prompt vector, the weather segmentation data and the to-be-spliced prompt vector are spliced to obtain spliced weather segmentation data, and the spliced weather segmentation data is input into the trained extreme weather prediction large model of the corresponding type to determine extreme weather prediction data in the second preset time period after the prediction time; The extreme weather information in the second preset time period after the prediction time is determined based on the extreme weather prediction data of each type. 7.A large model-based extreme weather prediction apparatus, characterized by, The device comprises: A data acquisition module configured to acquire extreme weather sample data, wherein the extreme weather sample data comprises weather data samples at consecutive time nodes. a sample construction module, configured to obtain at least one sample data pair by segmenting each piece of the extreme weather sample data, and construct a training sample set by taking each sample data pair as a training sample, wherein the sample data pair comprises 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 time 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, configured to input the input vector into an extreme weather prediction large model to obtain predicted weather data of the second preset time length, perform loss calculation based on the second weather data sample and the predicted weather data, and optimize model parameters of the extreme weather prediction large model and the target prompt vector in the prompt pool according to a loss calculation result, to obtain a trained extreme weather prediction large model and prompt pool; a weather prediction module, configured to perform extreme weather prediction based on the trained extreme weather prediction large model and prompt pool; the sample construction module is further configured to: for any piece of extreme weather sample data, take any time node in the extreme weather sample data as a starting point, and take a time node at a preset time length from the starting point as an ending point, wherein the preset time length is a sum of the first preset time length and the second preset time length; take the starting point as a first segmentation starting point, determine a next segmentation starting point every preset time step, take a time node at a preset segmentation time length after each segmentation starting point as a segmentation ending point, and construct a segmentation sample segment based on each segmentation starting point and the corresponding segmentation ending point, wherein the preset time step is less than the preset segmentation time length; and construct the first weather data sample by taking a segmentation sample segment corresponding to the first preset time length, and construct the second weather data sample by taking a segmentation sample segment corresponding to the second preset time length.
8. A storage medium having stored thereon a computer program, characterized in that The computer program, when executed by a processor, implements the method of any one of claims 1 to 6.
9. A computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, The processor, when executing the computer program, implements the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Text processing method, man-machine interaction method, equipment and storage medium
CN116450792A
Wind power generation power prediction method and device
CN118114809A
Weather type determination method and device, equipment and medium
CN118330784A