Networking forecasting method and platform
By constructing a sunset event pair sample set and training a sunset forecast model based on feature difference vector samples, the problem of low sunset forecast accuracy in existing technologies is solved, and a more accurate and reliable sunset forecast is achieved.
Patent Information
- Application Number
- CN202510989337.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Current technology relies on the experience of meteorological experts for sunset forecasting, lacking a scientific and systematic forecasting method, which makes it difficult to guarantee forecast accuracy.
A sample set of sunset events is constructed. Feature difference vector samples are constructed by importing data from multiple sources and a sunset forecast model is trained. The model is then used to make predictions based on the multi-source data and feature difference vectors.
It improves the accuracy and reliability of sunset forecasts, providing more effective technical support for meteorological forecasting and related fields.
Smart Images

Figure CN120847918A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of weather forecasting, and more particularly to a method and platform for forecasting sunset. Background Technology
[0002] With the continuous development of meteorological science and people's increasing interest in natural phenomena, sunsets, as a beautiful but fleeting natural phenomenon, have received widespread attention. Sunsets not only have aesthetic value but are also often associated with weather changes; therefore, accurate forecasting of sunsets has significant scientific and practical value.
[0003] Traditional weather forecasts primarily focus on predicting conventional meteorological elements such as temperature, precipitation, and wind speed, while forecasting specific natural phenomena like sunsets is relatively rare. Currently, sunset forecasts rely heavily on the experience and intuitive judgment of meteorological experts, lacking scientific and systematic forecasting methods. This experience-based approach is often influenced by subjective factors, making it difficult to guarantee forecast accuracy. Summary of the Invention
[0004] This invention addresses the technical problem of low accuracy in sunset prediction in existing technologies by providing a sunset forecasting method and platform.
[0005] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: In a first aspect, the present invention provides a sunset forecasting method, the method comprising: constructing a sunset event pair sample set, each sunset event pair sample consisting of multi-source imported data samples of a sunset event occurring on the first day and multi-source imported data samples of whether or not a sunset event occurs on the second day; constructing feature difference vector samples based on each sunset event pair sample in the sunset event pair sample set, training a sunset forecasting model based on the feature difference vector samples and labels representing whether or not a sunset occurs on the second day; obtaining multi-source imported data pairs of the sunset event pairs to be predicted, and using the trained sunset forecasting model to predict the multi-source imported data pairs to obtain the result of the probability of sunset occurrence.
[0006] Secondly, the present invention provides a sunset forecasting platform, the platform comprising: a sample construction module for constructing a sample set of sunset event pairs, wherein each sample set of sunset events consists of multi-source imported data samples of a sunset event occurring on the first day and multi-source imported data samples of whether or not a sunset event occurs on the second day; a model training module for constructing feature difference vector samples based on each sample set of sunset events, and training a sunset forecasting model based on the feature difference vector samples and labels representing whether or not a sunset occurs on the second day; and a result prediction module for obtaining multi-source imported data pairs of sunset event pairs to be predicted, and using the trained sunset forecasting model to predict the multi-source imported data pairs to obtain the probability of sunset occurrence.
[0007] The beneficial effects of this invention are as follows: By constructing a sample set of sunset event pairs, each sample pair includes multi-source data samples of sunset on the first day and multi-source data samples of sunset or no sunset on the second day. Then, feature difference vector samples are constructed based on the sample set, and a sunset forecast model is trained by combining the label representing whether sunset occurs on the second day. Finally, multi-source imported data pairs of sunset event pairs to be predicted are obtained, and the trained model is used to make predictions to obtain the probability of sunset occurrence. By using multi-source data and feature difference vectors to train the model, the accuracy and reliability of sunset forecasts are improved, providing more effective technical support for weather forecasting and related fields. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating the sunset forecasting method provided by the present invention.
[0009] Figure 2 This is a schematic diagram of the structure of the sunset forecasting platform provided by the present invention.
[0010] Figure labeling: Sample construction module 11, model training module 12, result prediction module 13. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0013] In the description of this invention, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein. Example
[0014] like Figure 1 As shown, this embodiment of the invention provides a sunset forecasting method, the method comprising: S10: Construct a sample set of sunset event pairs. Each sunset event pair consists of multi-source imported data samples where a sunset event occurs on the first day and multi-source imported data samples where a sunset event occurs or does not occur on the second day.
[0015] For example, constructing the sample set of sunset events is a data organization process for a sunset prediction task. Specifically, each pair of samples in the set consists of two parts: one part is the multi-source imported data sample corresponding to the occurrence of a sunset event on the first day, and the other part is the multi-source imported data sample corresponding to the occurrence of a sunset event or the absence of a sunset event on the second day.
[0016] In this process, importing data samples from multiple sources means that the data comes from multiple different channels or dimensions, such as meteorological sensor data (including specific meteorological elements such as temperature, humidity, wind speed, and wind direction), satellite cloud image data (which can extract features such as cloud distribution, cloud thickness, and cloud movement speed), geographic information data (such as topography, altitude, and other geographic features that may affect the formation of sunsets), and historical sunset record data (used to analyze the patterns and trends of sunsets).
[0017] Taking meteorological sensor data as an example, if a certain location experiences a sunset on the first day, and the temperature sensor records a temperature of 25°C, the humidity sensor records a humidity of 60%, and the wind speed sensor records a wind speed of 3 m / s, these data constitute part of the multi-source imported data sample corresponding to the sunset event on the first day. The data for the second day is differentiated based on whether a sunset occurred. If a sunset occurred on the second day, multi-source data for the corresponding time is collected; if no sunset occurred, multi-source data for the corresponding time is also collected.
[0018] By constructing such a sample set of sunset event pairs, rich training data can be provided for sunset prediction models. The model can learn from these paired samples the potential correlations and patterns between the occurrence and non-occurrence of a sunset event on the first day and the occurrence of a sunset on the second day. For example, by analyzing the relationship between the weather conditions on the first evening and the probability of a sunset on the second day, the accuracy and reliability of sunset event predictions can be improved, providing more precise decision-making support for fields such as weather forecasting and tourism planning.
[0019] S20: Construct a feature difference vector sample for each pair of sunset event samples in the sunset event sample set, and train a sunset forecast model based on the feature difference vector sample and a label representing whether a sunset will appear the next day.
[0020] In detail, in the process of constructing a sunset forecast model based on a sample set of sunset events, the first step is to construct a feature difference vector sample for each pair of sunset event samples in the set. Each pair of sunset event samples consists of multi-source imported data samples where a sunset event occurs on the first day and multi-source imported data samples where a sunset event occurs or does not occur on the second day.
[0021] When constructing feature difference vector samples, it is necessary to perform a comparative analysis of the multi-source imported data for the first and second days in each pair of samples, calculating the differences between corresponding features. For example, if the temperature on the first evening is 28℃ and the temperature on the second evening is 22℃, then the difference for the feature of temperature is -6℃; if the cloud reflectance is 0.6 on the first day and 0.4 on the second day, then the difference for the feature of cloud reflectance is -0.2. Arranging these feature differences in a certain order forms the feature difference vector sample, which can intuitively reflect the feature changes of the first and second days in multiple dimensions.
[0022] After constructing the feature difference vector samples, each sample needs to be labeled to indicate whether a sunset will occur the next day. These labels are typically in binary form, such as "1" indicating a sunset and "0" indicating no sunset. Subsequently, the sunset forecasting model is trained using these feature difference vector samples and their corresponding labels. During training, the model continuously adjusts its parameters to learn the intrinsic relationship between the feature difference vectors and the occurrence of a sunset the following day. For example, the model might discover that when combinations of features such as temperature difference, cloud reflectivity difference, and humidity difference meet certain conditions, the probability of a sunset the next day is higher. Through training with a large number of samples, the model gradually masters these patterns, thus gaining the ability to accurately predict new feature difference vector samples.
[0023] By training a sunset forecast model based on feature difference vector samples, on the one hand, focusing on feature differences allows the model to more effectively capture changes in key factors that cause the appearance or disappearance of sunsets, improving its sensitivity and prediction accuracy for sunset events. On the other hand, the feature difference vector samples constructed using multi-source data contain rich information, helping the model to comprehensively consider various factors that may affect the formation of sunsets, enhancing the model's generalization ability and robustness. This allows the model to maintain good predictive performance in complex environments such as different regions and seasons, providing more reliable and accurate decision support for related fields such as weather forecasting and tourism planning.
[0024] S30: Obtain multi-source imported data pairs of the sunset event pairs to be predicted, and use the trained sunset forecasting model to predict the probability of sunset occurrence.
[0025] Specifically, in the practical application of sunset prediction, a multi-source imported data pair is acquired for the sunset event to be predicted. This multi-source imported data pair consists of two parts, corresponding to the data of the first and second days respectively. The data sources are extensive, covering meteorological monitoring data (such as key meteorological elements such as temperature, humidity, air pressure, wind speed, and wind direction, which reflect the basic state of the atmospheric environment), satellite remote sensing image data (from which cloud distribution, cloud thickness, cloud optical properties, etc., can be extracted, and these cloud attributes play a crucial role in the formation of sunset), and ground observation data (such as visibility, sky color observation records, etc., which can provide intuitive on-site information). Taking a certain prediction as an example, on the evening of the first day, meteorological monitoring data obtained from the meteorological station showed a temperature of 26℃, humidity of 55%, air pressure of 1010hPa, and wind speed of 2m / s. At the same time, satellite remote sensing imagery showed that the cloud distribution was relatively scattered and the cloud thickness was moderate. The meteorological monitoring data, satellite remote sensing imagery data, and ground observation data for the corresponding time on the second day constitute the other part of the data.
[0026] After obtaining the multi-source imported data pairs of the sunset event pairs to be predicted, they are input into a pre-trained sunset forecasting model. During its construction, the trained sunset forecasting model has learned the correlation between the feature difference vectors of a large number of historical sunset event pairs and the occurrence of a sunset the following day. The model performs feature extraction and analysis on the input multi-source imported data pairs, such as analyzing the changing trends of elements like temperature and humidity from meteorological monitoring data, and identifying the dynamic changes of clouds from satellite remote sensing imagery. The model then matches and calculates these features with the patterns learned during training, using complex internal algorithms, such as weight calculations and activation function operations in neural networks, to quantitatively assess the probability of a sunset.
[0027] Finally, the model outputs the probability of a sunset, presented as a specific probability value, such as 75%. This indicates that, based on the model's analysis and judgment, given the multi-source imported data pair, the probability of a sunset the next day is 75%.
[0028] Probability-based predictions offer several advantages. First, probability values directly reflect the likelihood of a sunset, providing decision-makers with richer and more accurate information. Compared to simple "yes" or "no" predictions, probability values better capture the complexity and uncertainty of the actual situation. Second, decision-makers can develop corresponding strategies based on different probability thresholds. For example, when the predicted probability is above 80%, tourist attractions can prepare in advance to accommodate large numbers of visitors watching the sunset; when the predicted probability is below 30%, photography enthusiasts can adjust their schedules to avoid unnecessary waiting. This probability-based prediction method significantly improves the scientific rigor and flexibility of decision-making, providing strong support for various fields such as meteorological services, tourism planning, and photography event organization.
[0029] In a preferred embodiment, a feature difference vector sample is constructed based on each pair of sunset event samples in the sunset event pair sample set, including: The original feature parameter pairs are extracted from the multi-source imported data sample pairs for each pair of sunset event samples. The original feature parameters include at least atmospheric cloud parameters, meteorological indicators, air quality indicators, and illumination parameters.
[0030] Analyze the influence of each parameter in the original feature parameters on the sunset event, obtain the preferred feature parameters that are greater than the preset influence level, and output the preferred feature parameter pair.
[0031] By comparing the preferred feature parameter pairs, a feature difference vector is constructed.
[0032] Optionally, during the process of constructing the feature difference vector samples of the sunset event pair sample set, the original feature parameters are extracted for the multi-source imported data sample pairs contained in each sunset event pair. Each sunset event pair consists of multi-source imported data samples where a sunset event occurs on the first day and multi-source imported data samples where a sunset event occurs or does not occur on the second day, and the multi-source imported data samples cover multiple dimensions.
[0033] The original characteristic parameters include at least atmospheric cloud parameters, meteorological indicators, air quality indicators, and illumination parameters. Among these, atmospheric cloud parameters are one of the key features, such as cloud height, cloud thickness, cloud coverage, and cloud type (e.g., cumulus, stratus). These parameters reflect the distribution and morphology of clouds in the atmosphere and have a direct impact on the formation and presentation of sunset. Meteorological indicators include temperature, humidity, air pressure, wind speed, and wind direction. These describe the basic physical state of the atmosphere, and the probability and characteristics of sunsets will vary under different meteorological conditions. Air quality indicators, such as particulate matter concentration (PM2.5, PM10), sulfur dioxide concentration, and nitrogen oxide concentration, are important. Pollutants in the air can affect light scattering and absorption, thus interfering with the formation and color expression of sunsets. Illumination parameters involve solar altitude angle, solar radiation intensity, and sky brightness. These parameters are closely related to sunlight exposure and directly affect the brightness and color saturation of sunsets. Using specific algorithms and tools, the above-mentioned original feature parameters are extracted from the multi-source imported data sample pairs of each pair of sunset event samples to form original feature parameter pairs.
[0034] After extracting the original feature parameters, it is necessary to analyze the degree of influence of each parameter on the sunset event. This process is usually achieved using statistical analysis methods, machine learning algorithms, or expert experience. For example, by analyzing historical data, it is found that when cloud thickness varies within a certain range, the frequency and color richness of sunsets change significantly, while certain air quality indicators have a relatively small impact on sunsets outside a certain threshold. Based on this, a preset threshold for the degree of influence is set, and preferred feature parameters that exceed this threshold are selected, and the preferred feature parameter pairs are output. Assuming that cloud type, cloud coverage, temperature, humidity, solar altitude angle, and particulate matter concentration are determined as preferred feature parameters during the analysis, then for each pair of sunset event samples, a preferred feature parameter pair composed of these preferred feature parameters will be obtained.
[0035] Finally, the preferred feature parameter pairs are compared to construct a feature difference vector. Specifically, the preferred feature parameters corresponding to the first and second days of each pair of sunset event samples are subtracted one by one to obtain the difference for each parameter. For example, if the cloud coverage rate is 60% on the first day and 40% on the second day, the difference in cloud coverage rate is -20%; if the temperature is 25℃ on the first day and 22℃ on the second day, the temperature difference is -3℃. These differences are arranged in the order of the preferred feature parameters to form a vector, which is the feature difference vector. This vector can intuitively reflect the changes in the key features affecting the sunset event on the first and second days.
[0036] By constructing feature difference vector samples through the above process, on the one hand, the optimal feature parameters can be extracted and screened from multi-source data, which can remove redundant information and focus on the key factors that have a greater impact on sunset events, thereby improving data processing efficiency and model training accuracy. On the other hand, feature difference vectors can clearly show feature changes, providing more targeted input for sunset forecast models. This helps the models better learn the intrinsic relationship between feature changes and the occurrence of sunset, thereby improving the accuracy and reliability of sunset prediction and providing better services for related fields such as weather forecasting and tourism planning.
[0037] In a preferred embodiment, training a sunset forecast model based on the feature difference vector samples and labels representing whether a sunset will occur the next day includes: Based on the feature difference vector samples and the labels representing whether a sunset will appear the next day, the prior probability is calculated, and the prior probability samples are output.
[0038] An initial sunset forecast model is defined by introducing the cross-entropy loss function and the prior probability samples. The initial sunset forecast model makes a model prediction based on the prior probability of sunset occurrence of the i-th sample, and obtains the model prediction result. The initial sunset forecast model is then iterated based on the model prediction result and the known labels to output the trained sunset forecast model.
[0039] Furthermore, during the training of the sunset forecast model, prior probability calculations are performed based on feature difference vector samples and labels representing whether a sunset will occur the following day. The feature difference vector samples consist of the differences in the corresponding preferred feature parameters for the first and second days of each pair of sunset event samples. These preferred feature parameters cover atmospheric cloud parameters (such as differences in cloud height and thickness), meteorological indicators (such as differences in temperature and humidity), air quality indicators (such as differences in particulate matter concentration), and illumination parameters (such as differences in solar altitude angle). They reflect changes in key factors influencing sunset formation from multiple dimensions. The labels are in binary form, with "1" indicating a sunset on the second day and "0" indicating no sunset on the second day. The prior probability calculation aims to statistically determine the initial probability distribution of whether a sunset will occur or not on the second day, given the feature difference vector samples. For example, if 60% of the feature difference vector samples correspond to a sunset the next day, then the prior probability of a sunset the next day is 0.6, and the prior probability of no sunset is 0.4. These prior probabilities are combined with the corresponding feature difference vector samples to output the prior probability samples.
[0040] Next, we introduce the cross-entropy loss function and prior probability samples to define the initial sunset forecast model. The cross-entropy loss function is an important indicator for measuring the difference between the model's prediction and the true label; it quantifies the uncertainty of the model's prediction. When the initial sunset forecast model receives the i-th sample, it makes a preliminary prediction based on the prior probability of a sunset occurring in that sample. For example, if the prior probability of the i-th sample indicates a higher probability of a sunset the next day, the model may tend to predict that a sunset will occur the next day, obtaining an initial model prediction result. This result is usually presented in the form of a probability value, such as predicting a sunset probability of 0.7 the next day.
[0041] Then, the initial sunset forecast model is iterated based on the model's predictions and known labels. During the iteration, the model's predictions are compared with the known labels, and the difference between the two is calculated using the cross-entropy loss function. If the model's predictions differ significantly from the true labels, it indicates poor predictive performance. In this case, the model's parameters are adjusted based on the gradient information of the loss function, allowing the model to more closely approximate the true labels in subsequent predictions. For example, if the model predicts a 0.7 probability of sunset for the i-th sample the next day, but the actual label is "0" (meaning no sunset the next day), the cross-entropy loss function will calculate a large loss value. The model will then adjust its parameters based on this loss value, reducing the predicted probability of sunset the next day. Through multiple iterations, the model's parameters are continuously optimized, and the predictive performance gradually improves.
[0042] Finally, after sufficient target iterations, a well-trained sunset forecast model is output. This model can accurately predict the probability of a sunset the next day based on the input feature difference vector samples. Through prior probability calculation and target iterative training based on the cross-entropy loss function, the model can fully utilize the information in the feature difference vector samples, learn the intrinsic relationship between feature changes and sunset occurrence, and improve the accuracy and stability of the prediction. In practical applications such as weather forecasting and tourism planning, the well-trained sunset forecast model can provide a reliable basis for relevant decision-making. For example, tourist attractions can rationally arrange tourist activities based on the predicted probability of sunset occurrence, and photography enthusiasts can choose appropriate shooting times and locations based on the prediction results, thereby improving the experience and effectiveness of related activities.
[0043] In a preferred embodiment, defining an initial sunset forecast model further includes: Construct a conditional distribution sample, which includes the season, region, and time period.
[0044] Based on the set of sunset event pairs, the season, region, and time period are used as prior probability guide terms and encoded and fused with the prior probability samples to redefine the initial sunset forecast model.
[0045] Specifically, in defining the initial sunset forecast model, a conditional distribution sample is first constructed, encompassing key factors such as season, region, and time period. Seasonal factors significantly influence sunset formation. For example, the atmosphere is relatively stable in spring and autumn, with cloud cover and meteorological conditions relatively suitable for sunset appearance. In contrast, summer sees more thunderstorms, and winter is characterized by frequent cold air activity, potentially reducing the probability of sunset appearance. Regional factors are also crucial. Different regions have significantly different geographical environments and climate types. Coastal areas may be influenced by maritime climates, resulting in different cloud cover variations and air humidity compared to inland areas, thus affecting the presentation of sunset. The time period determines the sun's position and illumination angle. Evening is a common time for sunset appearance, but the solar altitude angle and duration of illumination vary across different seasons. By collecting and organizing relevant data, a conditional distribution sample incorporating these factors is constructed. For instance, regions are divided into eastern coastal areas, central plains, and western mountainous areas; seasons are divided into spring, summer, autumn, and winter; and time periods are divided into different evening intervals.
[0046] Subsequently, based on the sunset event sample set, season, region, and time period are used as prior probability guides and encoded and fused with the prior probability samples. The prior probability samples are calculated based on feature difference vector samples and labels representing whether a sunset will occur the next day, reflecting the initial probability distribution of whether a sunset will occur the next day given a feature difference vector. The encoding and fusion process employs specific algorithms, such as one-hot encoding of discrete variables like season, region, and time period, and concatenating or weighting the encoded vectors with the prior probability samples. For example, if a sample is in autumn, located in the eastern coastal region, and occurs between 18:00 and 19:00, after one-hot encoding, the season, region, and time period are converted into corresponding vectors, which are then combined with the prior probability values in the prior probability samples to form a new fused vector.
[0047] Based on the aforementioned coding fusion results, the initial sunset forecast model is redefined. The new model not only considers information from the feature difference vector samples during the prediction process but also incorporates prior probability guidance terms such as season, region, and time period. This allows the model to better adapt to the formation patterns of sunsets in different regions, seasons, and time periods. For example, in coastal areas during summer, the model, based on the region's summer climate characteristics and evening light conditions, combined with the feature difference vector samples, makes a more accurate prediction of the probability of sunset occurrence. Through this coding fusion and redefinition, the initial sunset forecast model can fully utilize more prior information, improving its predictive ability and generalization performance for sunset events. When facing complex and ever-changing real-world scenarios, it can more stably and accurately output the predicted probability of sunset occurrence, providing more reliable decision support for meteorological forecasting, tourism planning, and other related fields.
[0048] In a preferred embodiment, a trained sunset forecasting model predicts the probability of sunset occurrence from a multi-source imported data pair, including: The multi-source imported data includes the multi-source imported data known from the observations on the first day and the multi-source imported data currently observed in real time on the second day.
[0049] The feature difference vector of the multi-source imported data pair is calculated, and the sunset forecast model predicts the probability of sunset occurrence based on the feature difference vector.
[0050] Preferably, in the process of using a trained sunset forecast model to predict the probability of sunset occurrence from multiple source imported data pairs, the composition of the multiple source imported data pairs should be clarified first. The multi-source imported data consists of two parts. One part is the multi-source imported data known from the observations on the first day. This part of the data covers atmospheric cloud parameters (such as cloud height, cloud thickness, cloud coverage, etc., which can be obtained through meteorological radar, satellite remote sensing, etc., and can reflect the distribution and morphological characteristics of clouds on that day), meteorological indicators (including temperature, humidity, air pressure, wind speed, wind direction, etc., which are obtained by real-time monitoring by meteorological stations and describe the physical state of the atmosphere on that day), air quality indicators (such as particulate matter concentration, sulfur dioxide concentration, etc., which are measured by air quality monitoring stations and reflect the degree of air pollution on that day), and illumination parameters (such as solar altitude angle, solar radiation intensity, etc., which are obtained through professional illumination measurement instruments and are closely related to the sunlight illumination). The other part is the multi-source imported data currently observed on the second day. Its data type is consistent with the multi-source imported data known from the observations on the first day, but it reflects the actual situation of the atmosphere, meteorology, air quality, and illumination at the current moment on the second day.
[0051] After acquiring the multi-source imported data pairs, their feature difference vector is calculated. Specifically, for each type of feature parameter, the difference between the current real-time observation data of the second day and the known observation data of the first day is obtained. For example, if the cloud height on the first day is 2000 meters and the current real-time observed cloud height on the second day is 1800 meters, then the difference in cloud height is -200 meters; if the temperature on the first day is 25℃ and the current real-time observed temperature on the second day is 22℃, then the temperature difference is -3℃. The differences of all feature parameters are arranged in a predetermined order to form a vector, which is the feature difference vector. This feature difference vector clearly shows the changes in key features affecting the formation of sunset on the first and second days, providing important input information for the sunset forecast model.
[0052] After receiving a feature difference vector, the trained sunset forecasting model predicts the occurrence of sunset based on the intrinsic correlation between feature changes and sunset events learned internally. The model analyzes and weights each parameter in the feature difference vector, comprehensively considering the influence of different parameters on sunset occurrence, and ultimately outputs the probability of sunset appearance. For example, the model might find from historical data that a high probability of sunset occurs when the cloud height difference is negative and large in absolute value, while the temperature difference is negative and the humidity difference is relatively small. Through this feature difference vector-based prediction method, the sunset forecasting model can fully utilize data changes from the first and second days, improving the accuracy and reliability of predictions. In practical applications, this prediction result can provide important reference for weather forecasting, tourism planning, and photography event scheduling, helping relevant personnel make more scientific and rational decisions and improve the experience and effectiveness of activities.
[0053] In a preferred embodiment, training the sunset forecast model further includes: Based on the set of sunset event pairs, a counterfactual sunset event pair simulation sample is constructed. The counterfactual sunset event pair simulation sample includes simulation samples obtained by perturbing at least one feature parameter through a perturbation factor, wherein the perturbation factor includes a preset perturbation range and a perturbation strategy.
[0054] Based on the trained sunset forecast model, predict the counterfactual sunset event pairs for simulated samples and output a counterfactual sunset occurrence label.
[0055] The sunset forecast model is trained by positive and negative pairs based on the simulated samples and the labels of the counterfactual sunset events, thereby optimizing the sunset forecast model.
[0056] In detail, during the training of the sunset forecast model, counterfactual sunset event pairs are further constructed based on the sample set of sunset event pairs. The construction of these counterfactual sunset event pair simulations is based on counterfactual assumptions, aiming to create virtual samples of "whether a sunset would have occurred if the weather conditions had been slightly different." Specifically, these simulation samples are obtained by perturbing at least one feature parameter using a perturbation factor. The perturbation factor includes a preset perturbation range and a perturbation strategy. The preset perturbation range defines the range within which the feature parameter can vary, while the perturbation strategy specifies how to adjust the feature parameter within that range.
[0057] Taking specific data as an example, the characteristic parameters cover mid-to-high-altitude cloud cover, humidity, PM2.5, solar altitude angle, cloud type, and wind direction angle. When constructing simulation samples, these characteristic parameters can be perturbed according to preset perturbation factors. For example, for the characteristic parameter of mid-to-high-altitude cloud cover, if the original sample's D1 value (real sample) is 0.6 and the simulated sample's D2 value is 0.75, the difference Δf is -0.15. Within the preset perturbation range, its value can be appropriately adjusted according to the perturbation strategy, such as increasing or decreasing by a certain percentage. The same applies to the humidity parameter. The original D1 value is 65%, and the D2 value is 72%, with a difference of -7%. During the perturbation process, its value can be adjusted to other reasonable ranges, such as from 65% to 80%, to simulate different humidity conditions.
[0058] After constructing the simulated sample of counterfactual sunset events, the trained sunset forecast model is used to predict these simulated samples and output a counterfactual sunset occurrence label, which indicates whether the model predicts that a sunset will occur under the weather conditions after the disturbance.
[0059] Finally, the sunset forecast model was trained with positive and negative pairs based on the simulated samples and the counterfactual sunset event labels to optimize model performance. Positive and negative pair training means the model learns the differences between real and counterfactual samples, as well as the impact of different feature parameter perturbations on sunset occurrence. Through this training method, the model can better understand the complex relationship between feature parameters and sunset occurrence, improve the accuracy of sunset probability prediction under various meteorological conditions, enhance the model's generalization ability and robustness, and provide more reliable and accurate prediction results when facing the diversity and uncertainty of actual meteorological data, thus providing stronger support for meteorological forecasting, tourism planning, and other related fields.
[0060] In a preferred embodiment, the perturbation strategy includes univariate perturbation and combined variable perturbation; Based on the single-variable perturbation and combined-variable perturbation of the perturbation strategy, multiple sets of counterfactual sunset event pairs and multiple sets of confidence intervals are output. When the multiple sets of counterfactual sunset event pairs are used to train the sunset forecast model with positive and negative pairs, the model is trained by confidence partitioning based on the multiple sets of confidence intervals, and the optimized sunset forecast model is output.
[0061] Specifically, in constructing the counterfactual sunset event pair simulation samples, the perturbation strategy includes two methods: univariate perturbation and combined variable perturbation. Univariate perturbation refers to perturbing only one feature parameter at a time to explore the impact of changes in that single feature parameter on the occurrence of sunset. For example, among the feature parameters related to sunset, humidity is perturbed alone. Assuming the humidity in the original sample is 65%, it is adjusted to 75% within a preset perturbation range, while other feature parameters such as mid-to-high-altitude cloud cover, PM2.5, and solar altitude angle remain unchanged, thus generating a set of counterfactual sunset event pair simulation samples. In this way, the impact of humidity changes alone on the probability of sunset occurrence can be clearly analyzed.
[0062] Combined variable perturbation involves simultaneously perturbing multiple characteristic parameters to simulate the probability of sunset events occurring when various meteorological conditions change concurrently. For example, simultaneously perturbing the mid-to-high-altitude cloud cover and humidity, if the original mid-to-high-altitude cloud cover was 0.6 and the humidity was 65%, after perturbation the mid-to-high-altitude cloud cover to 0.7 and the humidity to 70%, while keeping other parameters unchanged, generates another set of counterfactual sunset event simulation samples. This method can more comprehensively consider the combined influence of multiple factors on the occurrence of sunset events.
[0063] Based on univariate and combined variable perturbation strategies, the model outputs multiple sets of counterfactual sunset event pairs in the simulated sample, along with multiple confidence intervals. The confidence intervals reflect the reliability of the model's predictions for each set of counterfactual sunset event pairs in the simulated sample. For example, for a set of simulated samples obtained through univariate perturbation (perturbing humidity only), the model predicts a 70% probability of a sunset, and provides a confidence interval of 65% - 75%, indicating that the model's confidence in this prediction falls within this range.
[0064] When training a sunset forecast model using multiple sets of counterfactual sunset events on simulated samples, positive and negative pairs are used, and training is performed based on multiple confidence intervals. Specifically, simulated samples with different confidence intervals are trained separately, allowing the model to learn the relationship between feature parameters and sunset occurrence at different confidence levels. For example, for simulated samples with higher confidence, the model will pay more attention to the changing patterns of their feature parameters; for simulated samples with lower confidence, the model will try to uncover potential patterns or noise effects. Through this confidence-based training, the model can finely adjust its parameters, improve the prediction accuracy of sunset occurrence probability under different meteorological conditions, and ultimately output an optimized sunset forecast model. This optimized model can better adapt to complex and changing meteorological environments, providing more accurate and reliable sunset forecast services for meteorological forecasting, tourism planning, and other related fields.
[0065] The sunset forecasting method provided in this embodiment of the invention has at least the following technical effects: 1. By extracting original feature parameters covering various aspects such as atmospheric cloud layer, meteorology, air quality and light from multi-source imported data, and selecting the preferred feature parameters with a high degree of influence on sunset events to construct feature difference vectors, the model focuses on key influencing factors and removes redundant information, enabling it to learn the close relationship between feature changes and the occurrence of sunset more efficiently, and significantly improving the pertinence and accuracy of prediction.
[0066] 2. The initial sunset forecast model is redefined by using the conditional distribution samples such as season, region, and time period as prior probability guides and encoding and fusing them with the prior probability samples. This takes into account the unique climate and illumination characteristics of different regions, seasons, and time periods, allowing the model to better adapt to complex and ever-changing real-world scenarios, and enhancing the model's generalization ability and adaptability to sunset prediction under different environments.
[0067] 3. Construct counterfactual sunset event pairs to simulate samples, and use univariate and combined variable perturbation strategies to output multiple sets of simulated samples and confidence intervals. Then, perform partitioned training based on the confidence intervals. This approach expands the diversity of training data, enabling the model to learn more patterns of sunset occurrence under extreme or rare weather conditions. At the same time, the training focus is adjusted according to the confidence intervals to further optimize model parameters and improve the accuracy and reliability of model predictions. Example
[0068] like Figure 2 As shown, based on the same inventive concept as the sunset forecasting method provided in Embodiment 1, this embodiment of the invention also provides a sunset forecasting platform, the platform comprising: The sample construction module 11 is used to construct a sample set of sunset event pairs. Each sunset event sample consists of multi-source imported data samples where a sunset event occurs on the first day and multi-source imported data samples where a sunset event occurs or does not occur on the second day.
[0069] The model training module 12 is used to construct feature difference vector samples for each pair of sunset event samples in the sunset event sample set, and to train the sunset forecast model based on the feature difference vector samples and the labels representing whether a sunset will appear the next day.
[0070] The result prediction module 13 is used to obtain multi-source imported data pairs of sunset events to be predicted, and the trained sunset forecast model predicts the probability of sunset occurrence by using the multi-source imported data pairs.
[0071] Furthermore, the model training module 12 also includes: Based on the multi-source imported data sample pairs of each pair of sunset event samples, original feature parameter pairs are extracted. The original feature parameters include at least atmospheric cloud parameters, meteorological indicators, air quality indicators, and illumination parameters. The influence degree of each parameter in the original feature parameters on the sunset event is analyzed, and preferred feature parameters with a greater than preset influence degree are obtained and the preferred feature parameter pairs are output. The preferred feature parameter pairs are compared to construct a feature difference vector.
[0072] Furthermore, the model training module 12 also includes: Based on the feature difference vector samples and the labels representing whether a sunset will appear on the next day, the prior probability is calculated, and the prior probability samples are output. The cross-entropy loss function and the prior probability samples are introduced to define an initial sunset forecast model. The initial sunset forecast model makes a model prediction based on the prior probability of sunset appearance of the i-th sample, and the model prediction result is obtained. The initial sunset forecast model is iterated based on the model prediction result and the known labels to output the trained sunset forecast model.
[0073] Furthermore, the model training module 12 also includes: A conditional distribution sample is constructed, which includes the season, region, and time period. Based on the sunset event sample set, the season, region, and time period are used as prior probability guide terms and encoded and fused with the prior probability sample to redefine the initial sunset forecast model.
[0074] Furthermore, the result prediction module 13 also includes: The multi-source imported data pair includes the multi-source imported data known from the observations on the first day and the multi-source imported data currently observed in real time on the second day; the feature difference vector of the multi-source imported data pair is calculated, and the sunset forecast model makes a prediction based on the feature difference vector to obtain the probability of sunset occurrence.
[0075] Furthermore, the result prediction module 13 also includes: Based on the set of sunset event pairs, a counterfactual sunset event pair simulation sample is constructed. The counterfactual sunset event pair simulation sample includes simulation samples obtained by perturbing at least one feature parameter through a perturbation factor, wherein the perturbation factor includes a preset perturbation range and a perturbation strategy. The counterfactual sunset event pair simulation sample is predicted based on the trained sunset forecast model, and a counterfactual sunset occurrence label is output. The sunset forecast model is trained with positive and negative pairs based on the counterfactual sunset event pair simulation sample and the counterfactual sunset occurrence label to optimize the sunset forecast model.
[0076] Furthermore, the result prediction module 13 also includes: The perturbation strategy includes univariate perturbation and combined variable perturbation; based on the univariate perturbation and combined variable perturbation of the perturbation strategy, multiple sets of counterfactual sunset event pairs and multiple sets of confidence intervals are output; when the multiple sets of counterfactual sunset event pairs are used to train the sunset forecast model with positive and negative pairs, confidence partition training is performed based on the multiple sets of confidence intervals to output an optimized sunset forecast model.
[0077] Through the foregoing detailed description of the sunset forecasting method, those skilled in the art can clearly understand the sunset forecasting platform in this embodiment. As the platform disclosed in the embodiment corresponds to the method disclosed in the embodiment, the description is relatively simple, and relevant parts can be referred to the method section description.
[0078] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for forecasting sunset, characterized in that, The method comprises: Construct a sample set of sunset event pairs. Each sunset event sample consists of multi-source imported data samples where a sunset event occurs on the first day and multi-source imported data samples where a sunset event occurs or does not occur on the second day. For each pair of sunset event samples in the sunset event sample set, a feature difference vector sample is constructed, and a sunset forecast model is trained based on the feature difference vector sample and a label representing whether a sunset will appear the next day. Obtain multi-source imported data pairs of the sunset event pairs to be predicted, and use the trained sunset forecasting model to predict the probability of sunset occurrence.
2. The sunset forecasting method as described in claim 1, characterized in that, Based on each pair of sunset event samples in the sample set of the sunset event pairs. Constructing feature difference vector samples includes: Based on the multi-source imported data sample pairs of each pair of sunset event samples, the original feature parameter pairs are extracted respectively. The original feature parameters include at least atmospheric cloud parameters, meteorological indicators, air quality indicators, and illumination parameters. Analyze the influence of each parameter in the original feature parameters on the sunset event, obtain the preferred feature parameters that are greater than the preset influence level, and output the preferred feature parameter pair; By comparing the preferred feature parameter pairs, a feature difference vector is constructed.
3. The sunset forecasting method as described in claim 1, characterized in that, A sunset forecast model is trained based on the aforementioned feature difference vector samples and labels representing whether a sunset will appear the next day, including: Based on the feature difference vector samples and the labels representing whether a sunset will appear on the second day, the prior probability is calculated and the prior probability samples are output. An initial sunset forecast model is defined by introducing the cross-entropy loss function and the prior probability samples. The initial sunset forecast model makes a model prediction based on the prior probability of sunset occurrence of the i-th sample, and obtains the model prediction result. The initial sunset forecast model is then iterated based on the model prediction result and the known labels to output the trained sunset forecast model.
4. The sunset forecasting method as described in claim 3, characterized in that, Defining the initial sunset forecast model also includes: Construct a conditional distribution sample, which includes the season, region, and time period; Based on the set of sunset event pairs, the season, region, and time period are used as prior probability guide terms and encoded and fused with the prior probability samples to redefine the initial sunset forecast model.
5. The sunset forecasting method as described in claim 1, characterized in that, The trained sunset forecasting model predicts the probability of sunset occurrence from multi-source imported data pairs. include: The multi-source imported data includes the multi-source imported data known from the observations on the first day and the multi-source imported data currently observed in real time on the second day. The feature difference vector of the multi-source imported data pair is calculated, and the sunset forecast model predicts the probability of sunset occurrence based on the feature difference vector.
6. The sunset forecasting method as described in claim 3, characterized in that, Training the sunset forecast model also includes: Based on the set of sunset event pairs, a counterfactual sunset event pair simulation sample is constructed. The counterfactual sunset event pair simulation sample includes a simulation sample obtained by perturbing at least one feature parameter through a perturbation factor, wherein the perturbation factor includes a preset perturbation range and a perturbation strategy. Based on the trained sunset forecast model, predict the counterfactual sunset event pairs for simulated samples and output the counterfactual sunset occurrence label; The sunset forecast model is trained by positive and negative pairs based on the simulated samples and the labels of the counterfactual sunset events, thereby optimizing the sunset forecast model.
7. The sunset forecasting method as described in claim 6, characterized in that, The perturbation strategies include single-variable perturbations and combined-variable perturbations; Based on the single-variable perturbation and combined-variable perturbation of the perturbation strategy, multiple sets of counterfactual sunset event pairs and multiple sets of confidence intervals are output. When the multiple sets of counterfactual sunset event pairs are used to train the sunset forecast model with positive and negative pairs, the model is trained by confidence partitioning based on the multiple sets of confidence intervals, and the optimized sunset forecast model is output.
8. A sunset forecast platform, characterized in that, For implementing the sunset forecasting method according to any one of claims 1-7, the platform comprises: The sample construction module is used to construct a sample set of sunset event pairs. Each sunset event sample consists of multi-source imported data samples where a sunset event occurs on the first day and multi-source imported data samples where a sunset event occurs or does not occur on the second day. The model training module is used to construct feature difference vector samples for each pair of sunset event samples in the sunset event sample set, and to train the sunset forecast model based on the feature difference vector samples and the labels representing whether a sunset will appear the next day. The result prediction module is used to obtain multi-source imported data pairs of sunset events to be predicted. The trained sunset forecasting model predicts the probability of sunset occurrence based on the multi-source imported data pairs.
9. The sunset forecast platform as described in claim 8, characterized in that, The model training module also includes: Based on the multi-source imported data sample pairs of each pair of sunset event samples, the original feature parameter pairs are extracted respectively. The original feature parameters include at least atmospheric cloud parameters, meteorological indicators, air quality indicators, and illumination parameters. Analyze the influence of each parameter in the original feature parameters on the sunset event, obtain the preferred feature parameters that are greater than the preset influence level, and output the preferred feature parameter pair; By comparing the preferred feature parameter pairs, a feature difference vector is constructed.
10. The sunset forecast platform as described in claim 8, characterized in that, The model training module also includes: Based on the feature difference vector samples and the labels representing whether a sunset will appear on the second day, the prior probability is calculated and the prior probability samples are output. An initial sunset forecast model is defined by introducing the cross-entropy loss function and the prior probability samples. The initial sunset forecast model makes a model prediction based on the prior probability of sunset occurrence of the i-th sample, and obtains the model prediction result. The initial sunset forecast model is then iterated based on the model prediction result and the known labels to output the trained sunset forecast model.