Weather forecast method, device, computer equipment, storage medium and program product
By using a polymorphic prediction algorithm to encapsulate and process different types of weather data in a unified format, the problem of high complexity of the weather prediction algorithm is solved, and efficient and fast weather prediction is achieved.
Patent Information
- Application Number
- CN202211161967.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-09-23
AI Technical Summary
The weather prediction algorithms in the existing technology are complex and have low prediction efficiency, and cannot efficiently process different types of weather data.
A polymorphic prediction algorithm is used to encapsulate different types of weather data in a unified format, and prediction processing is performed through a unified entry algorithm. Multiple prediction algorithms are fused to generate an initial fusion algorithm, overlapping instructions are deleted, and the data are sorted in a preset logical order to generate a polymorphic prediction algorithm.
It reduces the complexity of weather forecast algorithms, improves forecast speed, efficiency and timeliness, simplifies debugging difficulty and saves debugging time.
Smart Images

Figure CN115629429B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a weather forecasting method, apparatus, computer equipment, storage medium, and program product. Background Art
[0002] With the development of social informatization, the relationship between weather and people's lives is becoming increasingly close, and weather forecasts have become the focus of people's attention.
[0003] In related technologies, weather forecasting involves a series of processing steps based on a large amount of weather data to produce the forecast results. Weather data is generally classified into various data types based on their characteristics, and different types of weather data require different processing methods when performing weather forecasting.
[0004] However, in the related art, when performing weather forecasting, there are problems such as complex weather forecasting algorithms and low forecasting efficiency. Summary of the Invention
[0005] Based on this, it is necessary to provide a weather forecasting method, device, computer equipment, storage medium and program product to address the above technical problems, which can reduce the complexity of weather forecasting algorithms and improve weather forecasting efficiency.
[0006] In a first aspect, the present application provides a weather forecasting method, the method comprising:
[0007] Obtain at least one type of weather data within a preset time period in the area to be predicted;
[0008] Based on the preset polymorphic prediction algorithm, each weather data is predicted and processed to obtain the weather forecast result corresponding to the predicted area; the polymorphic prediction algorithm is an algorithm obtained by fusing the prediction algorithms corresponding to multiple different types of weather data.
[0009] The weather forecasting method provided in the embodiment of the present application can obtain at least one type of weather data within a preset time period in the area to be predicted, and perform forecasting processing on each weather data based on a preset polymorphic forecasting algorithm to obtain a weather forecast result corresponding to the area to be predicted; the method does not need to classify the weather data before the forecasting processing, and then input different types of weather data into the corresponding preset algorithm according to the judgment type to realize the weather forecasting process. The method proposes a unified entry algorithm, that is, the polymorphic forecasting algorithm can process different types of weather data, thereby reducing the complexity of the weather forecasting algorithm and further improving the speed, efficiency and timeliness of the weather forecast; in addition, the polymorphic forecasting algorithm proposed by the method is relatively simple. When a calculation error occurs in the polymorphic forecasting algorithm, the debugging difficulty of the polymorphic forecasting algorithm can be reduced, and debugging time can also be saved, thereby improving the debugging speed.
[0010] In one embodiment, the weather data is forecasted based on a preset polymorphic forecasting algorithm to obtain a weather forecast result corresponding to the area to be forecasted, including:
[0011] Encapsulate each weather data in a unified format to obtain the encapsulated weather information of each weather data;
[0012] The packaged weather information is input into the polymorphic prediction algorithm for prediction processing to obtain the weather forecast result corresponding to the area to be predicted.
[0013] The weather prediction method in the embodiment of the present application can encapsulate various weather data in a unified format, obtain encapsulated weather information of various weather data, and input each encapsulated weather information into a polymorphic prediction algorithm for prediction processing to obtain a weather prediction result corresponding to the area to be predicted; the method can encapsulate the acquired weather data of different types in a unified format, so that the encapsulated weather information obtained after the unified format encapsulation can be input into a unified entry algorithm to perform unified prediction processing on different types of weather data through the unified entry algorithm. The method can predict and process different types of weather data only through the unified entry algorithm, thereby avoiding the problem of predicting and processing different types of weather data by calling different processing methods multiple times, thereby reducing the complexity of weather prediction processing.
[0014] In one embodiment, each weather data is packaged in a unified format to obtain packaged weather information of each weather data, including:
[0015] Based on the polymorphic function, various weather data are encapsulated in a unified format to obtain encapsulated weather information in a unified format for various types of weather data.
[0016] The embodiment of the present application can encapsulate different types of weather data in a unified format based on polymorphic functions to achieve fuzzy processing of the types of weather data, thereby preparing for unified prediction processing, and further enabling different types of weather data to be input into a unified entry algorithm by calling a unified interface.
[0017] In one embodiment, the method further comprises:
[0018] For each weather data, detecting whether the weather data is data in a preset format;
[0019] If the weather data is in a preset format, a step is performed to perform prediction processing on each weather data based on a preset polymorphic prediction algorithm to obtain a weather prediction result corresponding to the area to be predicted.
[0020] The weather forecasting method in the embodiment of the present application can detect whether the weather data is in a preset format for each weather data. Only when it is determined that the weather data is in a preset format, will it execute the step of predicting and processing each weather data based on the preset polymorphic prediction algorithm to obtain the weather forecast result corresponding to the area to be predicted, so as to ensure that the prediction processing process can be executed smoothly and correctly, thereby further improving the success rate and accuracy of the prediction processing.
[0021] In one embodiment, the generation process of the polymorphic prediction algorithm includes:
[0022] Fusion of prediction algorithms corresponding to multiple different types of weather data to obtain an initial fusion algorithm;
[0023] According to the initial fusion algorithm and the preset processing logic sequence, a polymorphic prediction algorithm is obtained.
[0024] The weather prediction method in the embodiment of the present application can fuse the prediction algorithms corresponding to multiple different types of weather data to obtain an initial fusion algorithm, and obtain a polymorphic prediction algorithm based on the initial fusion algorithm and the preset processing logic sequence, so that different types of weather data can be uniformly predicted and processed through a hybrid prediction algorithm. During the processing, it is only necessary to call the prediction algorithms in sequence to realize the prediction processing of different types of weather data, which reduces the number of calls to the preset algorithm, thereby saving the prediction processing time and improving the efficiency of the prediction processing.
[0025] In one embodiment, the initial fusion algorithm includes at least one overlapping instruction, and the overlapping instruction includes at least two identical processing instructions. According to the initial fusion algorithm and a preset processing logic sequence, a polymorphic prediction algorithm is obtained, including:
[0026] If there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction is deleted to retain any processing instruction among the overlapping instructions. The remaining processing instructions after the initial fusion algorithm is deleted are sorted according to the preset processing logic order of the retained processing instructions to obtain a polymorphic prediction algorithm.
[0027] In an embodiment of the present application, when it is determined that there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction can be deleted to retain any processing instruction in the overlapping instructions, and the remaining processing instructions after the initial fusion algorithm is deleted are sorted according to the preset processing logic order of the retained processing instructions to obtain a polymorphic prediction algorithm; this method can reduce the number of processing instructions in the weather prediction algorithm as much as possible, reduce the scale of the weather prediction algorithm, and improve the prediction processing efficiency, while ensuring that the weather prediction algorithm can perform unified prediction processing on different types of weather data; and when a calculation error occurs in the weather prediction algorithm, it can reduce the debugging difficulty of the polymorphic prediction algorithm, save debugging time, and improve debugging efficiency.
[0028] In one embodiment, the initial fusion algorithm further includes at least one non-overlapping instruction, and the method further includes:
[0029] If there is at least one non-overlapping instruction in the initial fusion algorithm, all processing instructions after deletion and all processing instructions of the non-overlapping instructions are sorted according to a preset processing logic order to obtain a polymorphic prediction algorithm.
[0030] In an embodiment of the present application, when it is determined that there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction can be deleted to retain any processing instruction in the overlapping instructions. All remaining processing instructions after deletion are sorted according to a preset processing logic order to obtain a polymorphic prediction algorithm, thereby ensuring the prediction integrity of the weather prediction algorithm, reducing the scale of the weather prediction algorithm, and reducing the development cost of the weather prediction algorithm.
[0031] In a second aspect, the present application provides a weather forecasting device, comprising:
[0032] A weather data acquisition module is used to acquire at least one type of weather data within a preset time period in the area to be predicted;
[0033] The prediction processing module is used to predict and process various weather data based on a preset polymorphic prediction algorithm to obtain the weather prediction results corresponding to the area to be predicted; the polymorphic prediction algorithm is an algorithm obtained by fusing the prediction algorithms corresponding to multiple different types of weather data.
[0034] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of any one of the embodiments of the first aspect when executing the computer program.
[0035] In a fourth aspect, the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any one of the embodiments of the first aspect above.
[0036] The aforementioned weather forecasting method, apparatus, computer device, and readable storage medium enable the computer device to obtain at least one type of weather data within a preset time period for the area to be forecasted, and then perform forecast processing on each type of weather data based on a preset polymorphic forecasting algorithm to obtain a weather forecast result corresponding to the area to be forecasted. This method eliminates the need to categorize weather data prior to forecasting. Instead, different types of weather data are input into the corresponding preset algorithm based on the determined type to achieve weather forecasting. This method proposes a unified entry algorithm, namely, a polymorphic forecasting algorithm capable of processing different types of weather data, thereby reducing the complexity of the weather forecasting algorithm and further improving the speed, efficiency, and timeliness of weather forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a diagram of the internal structure of a computer device in one embodiment;
[0038] Figure 2 1 is a flow chart of a weather forecasting method according to an embodiment;
[0039] Figure 3 is a flow chart of a weather forecasting method according to another embodiment;
[0040] Figure 4 is a flow chart of a weather forecasting method according to another embodiment;
[0041] Figure 5 FIG. 4 is a structural block diagram of a weather forecasting device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0043] In the field of weather forecasting, a series of processing steps are primarily performed on at least one type of weather data to achieve a weather forecast. However, weather forecasting algorithms in related technologies include various processing methods, requiring different types of weather data to be processed using corresponding processing methods. This results in a complex weather forecasting process and low prediction efficiency.
[0044] Based on this, a weather forecasting method is proposed in the embodiment of the present application, which can reduce the complexity of the weather forecasting algorithm and improve the efficiency of weather forecasting. The weather forecasting method provided by the present application can be applied to Figure 1The computer device shown. The computer device can be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, and portable wearable devices. It can also be implemented as an independent server or a server cluster composed of multiple servers. This embodiment does not limit the specific form of the computer device. The following embodiment will specifically describe the specific process of the weather forecast method, and the specific process of the weather forecast method will be described using a computer device as the execution subject.
[0045] like Figure 2 FIG. 1 is a flow chart of a weather forecasting method according to an embodiment of the present application. The weather forecasting method may include the following steps:
[0046] S100: Obtain at least one type of weather data within a preset time period in a region to be predicted.
[0047] The above-mentioned area to be predicted can be a city area or a part of a city area, or can also be at least one county area or a part of a county area, or of course, can also be at least one town area or a part of a town area. In the embodiment of the present application, the area to be predicted can be an area where weather forecasting is required, and the specific area range is not limited in the embodiment of the present application. Optionally, the above-mentioned preset time period can be a historical time period of 4 hours, 8 hours, 10 hours, one day, two days, four days, etc.
[0048] Among them, weather data can include parameters such as wind speed, wind direction, wind direction standard deviation, temperature, air pressure, rainfall, atmospheric stability, humidity, etc. The types of these weather data can be integer, floating point, complex, Boolean, logical, string, etc.
[0049] In the embodiment of the present application, one type of weather data within a preset time period of the area to be predicted can be obtained to achieve weather forecasting. However, in order to improve the accuracy of weather forecasting, multiple types of weather data within a preset time period of the area to be predicted can also be obtained to achieve weather forecasting.
[0050] It should be noted that the above-mentioned method of obtaining at least one type of weather data within a preset time period in the area to be predicted can be obtained from a Network Common Data Format (NetCDF) file stored in a local memory, or from a NetCDF file stored in a weather data collection system, and of course, can also be obtained from a NetCDF file stored in the cloud.
[0051] S200 , forecasting and processing each weather data based on a preset polymorphic forecasting algorithm to obtain a weather forecast result corresponding to the area to be forecasted; the polymorphic forecasting algorithm is an algorithm obtained by fusing forecasting algorithms corresponding to multiple different types of weather data.
[0052] Based on the at least one type of weather data obtained in the above steps, the at least one type of weather data can be input into a unified entry algorithm, namely a preset polymorphic prediction algorithm. The preset polymorphic prediction algorithm is used to predict and process each type of weather data to obtain a weather forecast result corresponding to the predicted area. The weather forecast result can be a short-term (e.g., 2-3 days) weather forecast result, a medium-term (e.g., 4-9 days) weather forecast result, or a long-term (e.g., 10-15 days or more) weather forecast result.
[0053] In an embodiment of the present application, a polymorphic prediction algorithm is an algorithm obtained by fusing prediction algorithms corresponding to multiple different types of weather data. Each preset algorithm can be an algorithm generated by a neural network model, which can be composed of at least one of a fully convolutional neural network model, a recurrent neural network model, and an adversarial neural network model. Of course, each preset algorithm can also be an algorithm generated by multiple processing steps, which can be data conversion, data comparison, data calculation, and other processing.
[0054] In one embodiment, the polymorphic prediction algorithm may be generated solely through a neural network model. In another embodiment, the polymorphic prediction algorithm may be generated solely through multiple processing steps. In yet another embodiment, the polymorphic prediction algorithm may be generated through a combination of a neural network model and multiple processing steps.
[0055] The weather forecasting method provided in the embodiment of the present application can obtain at least one type of weather data within a preset time period in the area to be predicted, and perform forecasting processing on each weather data based on a preset polymorphic forecasting algorithm to obtain a weather forecast result corresponding to the area to be predicted; the method does not need to classify the weather data before the forecasting processing, and then input different types of weather data into the corresponding preset algorithm according to the judgment type to realize the weather forecasting process. The method proposes a unified entry algorithm, that is, the polymorphic forecasting algorithm can process different types of weather data, thereby reducing the complexity of the weather forecasting algorithm and further improving the speed, efficiency and timeliness of the weather forecast; in addition, the polymorphic forecasting algorithm proposed by the method is relatively simple. When a calculation error occurs in the polymorphic forecasting algorithm, the debugging difficulty of the polymorphic forecasting algorithm can be reduced, and debugging time can also be saved, thereby improving the debugging speed.
[0056] In order to receive different types of weather data through a unified entry algorithm and perform unified forecasting on different types of weather data, different types of weather data can be packaged in a unified format first, and then the packaged weather data can be forecasted. Based on this, the following describes the process of forecasting each weather data based on the preset polymorphic forecasting algorithm to obtain the weather forecast result corresponding to the area to be forecasted. In one embodiment, if Figure 3As shown, the steps in the above S200 may include:
[0057] S210: Encapsulate each weather data in a unified format to obtain encapsulated weather information of each weather data.
[0058] The unified format encapsulation described above can be understood as the process of encapsulating different types of weather data in a unified manner without distinguishing between data types. It should be noted that the encapsulated weather information after unified format encapsulation may include weather data, type, and other attribute information of the weather data. However, the type of weather data cannot be determined solely from the encapsulated weather information after unified format encapsulation. Optionally, each type of weather data may correspond to a corresponding encapsulated weather information, so the total number of encapsulated weather information obtained in this embodiment may be equal to the total number of types of weather data obtained.
[0059] In one embodiment, the keywords used to declare variables can be used to encapsulate the weather data in a unified format to obtain the encapsulated weather information for each weather data. It should be noted that the keywords used to declare variables vary depending on the language used to write the polymorphic prediction algorithm. The polymorphic prediction algorithm can be written in C, JAVA, C++, etc.
[0060] In another embodiment, a data packaging method may be used to uniformly package various weather data, that is, to package them in a unified format to obtain packaged weather information of various weather data.
[0061] The following describes the steps of encapsulating the weather data in a unified format to obtain encapsulated weather information for each weather data. In one embodiment, the process in S210 may include: encapsulating the weather data in a unified format based on a polymorphic function to obtain encapsulated weather information for each type of weather data in a unified format.
[0062] In the embodiment of the present application, a polymorphic prediction algorithm is generated by taking Fortran as an example, where the language used to write the polymorphic prediction algorithm is Fortran, which is a language for implementing object-oriented programming. For Fortran, the polymorphic function can be a class function, i.e., class(*), which can dynamically bind different types of weather data so that after the polymorphic prediction algorithm receives the encapsulated weather information, the weather data can be extracted from the encapsulated weather information to implement prediction processing. Among them, the polymorphic function can be used to encapsulate each type of weather data in a unified format, encapsulating the same type of weather data together to obtain encapsulated weather information with a unified format for each type of weather data.
[0063] The embodiment of the present application can encapsulate different types of weather data in a unified format based on polymorphic functions to achieve fuzzy processing of the types of weather data, thereby preparing for unified prediction processing, and further enabling different types of weather data to be input into a unified entry algorithm by calling a unified interface.
[0064] S220: Input each packaged weather information into a polymorphic prediction algorithm for prediction processing to obtain a weather prediction result corresponding to the area to be predicted.
[0065] Based on the packaged weather information obtained in the previous steps, it can be input into a unified entry algorithm, namely a polymorphic prediction algorithm. The polymorphic prediction algorithm performs prediction processing based on the packaged weather information to obtain the weather forecast result corresponding to the area to be predicted. Among them, the polymorphic prediction algorithm may include multiple processing instructions. The polymorphic prediction algorithm can first extract each weather data from each packaged weather information, then determine the type of each weather data, and then use the corresponding processing instructions in the polymorphic prediction algorithm to perform prediction processing according to the type of each weather data. Optionally, the above weather forecast results can be light rain, sunny, cloudy, heavy rain, rainstorm, hail, etc.
[0066] The weather prediction method in the embodiment of the present application can encapsulate various weather data in a unified format, obtain encapsulated weather information of various weather data, and input each encapsulated weather information into a polymorphic prediction algorithm for prediction processing to obtain a weather prediction result corresponding to the area to be predicted; the method can encapsulate the acquired weather data of different types in a unified format, so that the encapsulated weather information obtained after the unified format encapsulation can be input into a unified entry algorithm to perform unified prediction processing on different types of weather data through the unified entry algorithm. The method can predict and process different types of weather data only through the unified entry algorithm, thereby avoiding the problem of predicting and processing different types of weather data by calling different processing methods multiple times, thereby reducing the complexity of weather prediction processing.
[0067] Because the polymorphic prediction algorithm in this embodiment is written in Fortran, before using the polymorphic function to uniformly encapsulate the various weather data, it is necessary to determine whether the format of the weather data satisfies the requirements for uniform format encapsulation. Only if the format satisfies the requirements can the uniform format encapsulation be performed. Therefore, in one embodiment, before executing S220, the method further includes the following steps: For each weather data item, checking whether the weather data item is in a preset format; if so, executing a pre-set polymorphic prediction algorithm to predict the weather data item, thereby obtaining a weather forecast result for the area to be predicted.
[0068] Optionally, the preset format may be an array and / or vector format, etc. However, in the embodiment of the present application, the preset format may be an allocatable data item, a pointer, or a dummy element.
[0069] For each piece of weather data, it may be detected whether the weather data is data in an allocatable data item, a pointer or a dummy element format.
[0070] For example, a method for detecting whether weather data is data in a preset format may be to search for weather data that is equal to the above weather data in the mapping relationship between weather data and data formats, and use the data format corresponding to the found weather data as the target format, and then determine whether the target format is equal to the preset format.
[0071] For another example, the method of detecting whether the weather data is data in a preset format can also be to input the above weather data into a pre-trained algorithm model, and then the algorithm model outputs the target format corresponding to the weather data, and then determines whether the target format is equal to the preset format. Alternatively, the algorithm model can be directly used to detect whether the weather data is data in a preset format, and finally output the result of whether the above weather data is data in a preset format.
[0072] Furthermore, when it is determined that the weather data is in a preset format, the step of performing prediction processing on each weather data based on the preset polymorphic prediction algorithm to obtain a weather prediction result corresponding to the area to be predicted may be performed.
[0073] The weather forecasting method in the embodiment of the present application can detect whether the weather data is in a preset format for each weather data. Only when it is determined that the weather data is in a preset format, will it execute the step of predicting and processing each weather data based on the preset polymorphic prediction algorithm to obtain the weather forecast result corresponding to the area to be predicted, so as to ensure that the prediction processing process can be executed smoothly and correctly, thereby further improving the success rate and accuracy of the prediction processing.
[0074] Before executing the steps in S200 above, it is necessary to obtain a polymorphic prediction algorithm. The following describes the generation process of the polymorphic prediction algorithm. Figure 4 As shown, the generation process of the above polymorphic prediction algorithm may include the following steps:
[0075] S300: Fusing prediction algorithms corresponding to multiple weather data of different types to obtain an initial fusion algorithm.
[0076] In an embodiment of the present application, at least two prediction algorithms corresponding to different types of weather data may be obtained, and then these prediction algorithms corresponding to the different types of weather data may be fused to obtain an initial fusion algorithm. To improve computational efficiency and accuracy during the prediction process, the above prediction algorithm may be a finite volume cubic sphere dynamic core model, i.e., an FV3 model.
[0077] The method for obtaining prediction algorithms corresponding to multiple different types of weather data may be to obtain them from a local storage, a cloud, or other location. Furthermore, the method for fusing prediction algorithms corresponding to multiple different types of weather data may be to combine different preset algorithms according to the order in which they were obtained, or to combine the obtained prediction algorithms in any order.
[0078] S400: Obtain a polymorphic prediction algorithm according to an initial fusion algorithm and a preset processing logic sequence.
[0079] In an embodiment of the present application, based on the initial fusion algorithm obtained in the above steps, the different prediction algorithms in the initial fusion algorithm can be sorted according to a preset processing logic order to obtain a polymorphic prediction algorithm. In one embodiment, the preset processing logic order can be a user-defined order of different prediction algorithms, or the order in which different prediction algorithms are obtained. Of course, it can also be an order set according to different types of weather data.
[0080] In another embodiment, the processing instructions in different preset algorithms are different, and the preset processing logic order can also be determined according to the processing instructions in the different preset algorithms. In this case, it can be understood that the different processing instructions in the different prediction algorithms in the initial fusion algorithm are sorted according to the preset processing logic order to obtain a polymorphic prediction algorithm. It should be noted that the different processing instructions in the different prediction algorithms in the sorted results can be mixed and arranged, or can be sorted according to the order of prediction algorithms corresponding to different types. This embodiment of the application does not limit this.
[0081] Among them, when the polymorphic prediction algorithm performs prediction processing for different types of weather data, not all processing instructions in the polymorphic prediction algorithm necessarily participate in the processing at the same time. Some processing instructions in the polymorphic prediction algorithm can participate in the processing, and other processing instructions can be in an idle state.
[0082] The weather prediction method in the embodiment of the present application can fuse the prediction algorithms corresponding to multiple different types of weather data to obtain an initial fusion algorithm, and obtain a polymorphic prediction algorithm based on the initial fusion algorithm and the preset processing logic sequence, so that different types of weather data can be uniformly predicted and processed through a hybrid prediction algorithm. During the processing, it is only necessary to call the prediction algorithms in sequence to realize the prediction processing of different types of weather data, which reduces the number of calls to the preset algorithm, thereby saving the prediction processing time and improving the efficiency of the prediction processing.
[0083] The following describes the process of obtaining a polymorphic prediction algorithm based on the initial fusion algorithm and the preset processing logic sequence. In one embodiment, the initial fusion algorithm includes at least one overlapping instruction, and the overlapping instruction includes at least two identical processing instructions. The step of obtaining the polymorphic prediction algorithm based on the initial fusion algorithm and the preset processing logic sequence in S400 may include: if there is at least one overlapping instruction in the initial fusion algorithm, deleting each overlapping instruction to retain any processing instruction from each overlapping instruction, and sorting the remaining processing instructions after the initial fusion algorithm is deleted according to the preset processing logic sequence of the retained processing instructions to obtain the polymorphic prediction algorithm.
[0084] Specifically, the initial fusion algorithm may include multiple processing instructions, and the multiple processing instructions may include at least one overlapping instruction, and the total number of overlapping instructions may be greater than or equal to 2. Among them, all processing instructions in the initial fusion algorithm may be overlapping instructions.
[0085] For example, the initial fusion algorithm includes 4 processing instructions, namely processing instruction 1, processing instruction 2, processing instruction 1 and processing instruction 2. These 4 processing instructions include 2 overlapping instructions, namely processing instruction 1 and processing instruction 2, and the total number of processing instruction 1 is 2, and the total number of processing instruction 2 is also 2.
[0086] In this embodiment, overlapping instructions in the initial fusion algorithm can be deleted to retain any processing instruction from the overlapping instructions. After all overlapping instructions are deleted, the remaining processing instructions from the initial fusion algorithm after deletion are sorted according to the preset processing logic order of all retained processing instructions to obtain a polymorphic prediction algorithm. In this embodiment, all processing instructions in the polymorphic prediction algorithm do not overlap, that is, there are no overlapping code segments in the polymorphic prediction algorithm, which reduces the redundancy of the code in the polymorphic prediction algorithm and improves the readability of the polymorphic prediction algorithm.
[0087] In an embodiment of the present application, when it is determined that there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction can be deleted to retain any processing instruction in the overlapping instructions, and the remaining processing instructions after the initial fusion algorithm is deleted are sorted according to the preset processing logic order of the retained processing instructions to obtain a polymorphic prediction algorithm; this method can reduce the number of processing instructions in the weather prediction algorithm as much as possible, reduce the scale of the weather prediction algorithm, and improve the prediction processing efficiency, while ensuring that the weather prediction algorithm can perform unified prediction processing on different types of weather data; and when a calculation error occurs in the weather prediction algorithm, it can reduce the debugging difficulty of the polymorphic prediction algorithm, save debugging time, and improve debugging efficiency.
[0088] In some scenarios, the initial fusion algorithm also includes at least one non-overlapping instruction. In one embodiment, the above-mentioned step of sorting the remaining processing instructions after the initial fusion algorithm deletes the processing according to the preset processing logic order of the retained processing instructions may include: if there is at least one non-overlapping instruction in the initial fusion algorithm, then sorting all processing instructions after the deletion and all processing instructions in the non-overlapping instructions according to the preset processing logic order to obtain a polymorphic prediction algorithm.
[0089] Specifically, if there is at least one non-overlapping instruction in the initial fusion algorithm, it can be understood that there is at least one non-overlapping instruction in addition to the at least one overlapping instruction in the initial fusion algorithm. All processing instructions in the initial fusion algorithm may include overlapping instructions and non-overlapping instructions. All processing instructions in the initial fusion algorithm may include at least one overlapping instruction and at least one non-overlapping instruction, and the total number of non-overlapping instructions may be greater than or equal to 2.
[0090] In this embodiment, for each overlapping instruction in the initial fusion algorithm, the overlapping instructions can be deleted to retain any processing instruction in the overlapping instructions. After all overlapping instructions are deleted, all processing instructions after the deletion and all processing instructions in the non-overlapping instructions are sorted according to a preset processing logic order to obtain a polymorphic prediction algorithm.
[0091] In an embodiment of the present application, when it is determined that there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction can be deleted to retain any processing instruction in the overlapping instructions. All remaining processing instructions after deletion are sorted according to a preset processing logic order to obtain a polymorphic prediction algorithm, thereby ensuring the prediction integrity of the weather prediction algorithm, reducing the scale of the weather prediction algorithm, and reducing the development cost of the weather prediction algorithm.
[0092] In one embodiment, the present application further provides a weather forecasting method, which includes the following process:
[0093] (1) Obtain at least one type of weather data within a preset time period in the area to be predicted.
[0094] (2) Based on the polymorphic function, all weather data are packaged in a unified format to obtain packaged weather information in a unified format for all types of weather data.
[0095] (3) For each weather data, check whether the weather data is data in a preset format.
[0096] (4) If the weather data is in a preset format, the weather data is predicted based on a preset polymorphic prediction algorithm to obtain a weather prediction result corresponding to the area to be predicted.
[0097] The generation process of the polymorphic prediction algorithm includes:
[0098] (5) The prediction algorithms corresponding to multiple different types of weather data are integrated to obtain the initial fusion algorithm.
[0099] (6) If there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction is deleted to retain any processing instruction among the overlapping instructions, and the remaining processing instructions after the initial fusion algorithm is deleted are sorted according to the preset processing logic order of the retained processing instructions to obtain a polymorphic prediction algorithm; or, if there is at least one non-overlapping instruction in the initial fusion algorithm, all processing instructions after the deletion and all processing instructions in the non-overlapping instructions are sorted according to the preset processing logic order to obtain a polymorphic prediction algorithm.
[0100] The execution process of the above (1) to (6) can be specifically referred to the description of the above embodiment. The implementation principles and technical effects are similar and will not be repeated here.
[0101] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0102] Based on the same inventive concept, embodiments of the present application also provide a weather forecasting device for implementing the aforementioned weather forecasting method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more weather forecasting device embodiments provided below can be found in the above-described limitations of the weather forecasting method and will not be further elaborated here.
[0103] In one embodiment, Figure 5 This is a structural diagram of a weather forecasting device in one embodiment of the present application. The weather forecasting device provided in the embodiment of the present application can be applied to a computer device. Figure 5 As shown, the weather forecasting device of the embodiment of the present application may include: a weather data acquisition module 11 and a forecast processing module 12, wherein:
[0104] The weather data acquisition module 11 is used to acquire at least one type of weather data within a preset time period of the area to be predicted;
[0105] The prediction processing module 12 is used to predict and process various weather data based on a preset polymorphic prediction algorithm to obtain a weather prediction result corresponding to the area to be predicted; the polymorphic prediction algorithm is an algorithm obtained by fusing prediction algorithms corresponding to multiple different types of weather data.
[0106] The weather forecasting device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned weather forecasting method embodiment of the present application. Its implementation principle and technical effects are similar and will not be repeated here.
[0107] In one embodiment, the prediction processing module 12 includes: a format encapsulation unit and a prediction processing unit, wherein:
[0108] The format encapsulation unit is used to encapsulate various weather data in a unified format to obtain encapsulated weather information of various weather data;
[0109] The prediction processing unit is used to input each packaged weather information into the polymorphic prediction algorithm for prediction processing to obtain the weather prediction result corresponding to the area to be predicted.
[0110] The weather forecasting device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned weather forecasting method embodiment of the present application. Its implementation principle and technical effects are similar and will not be repeated here.
[0111] In one embodiment, the weather forecasting device further includes: a detection module and an execution processing module, wherein:
[0112] A detection module, used for detecting whether the weather data is in a preset format for each weather data;
[0113] The execution processing module is used to execute the step of performing prediction processing on each weather data based on the preset polymorphic prediction algorithm when the result of the detection module is yes, and obtain the weather prediction result corresponding to the area to be predicted.
[0114] The weather forecasting device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned weather forecasting method embodiment of the present application. Its implementation principle and technical effects are similar and will not be repeated here.
[0115] In one embodiment, the weather forecasting device further includes: an algorithm fusion module and a polymorphic forecasting algorithm generation module, wherein:
[0116] The algorithm fusion module is used to fuse the prediction algorithms corresponding to multiple different types of weather data to obtain the initial fusion algorithm;
[0117] The polymorphic prediction algorithm generation module is used to obtain the polymorphic prediction algorithm according to the initial fusion algorithm and the preset processing logic sequence.
[0118] The weather forecasting device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned weather forecasting method embodiment of the present application. Its implementation principle and technical effects are similar and will not be repeated here.
[0119] In one embodiment, the initial fusion algorithm includes at least one overlapping instruction, and the overlapping instruction includes at least two identical processing instructions; the polymorphic prediction algorithm generation module is specifically configured to:
[0120] If there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction is deleted to retain any processing instruction among the overlapping instructions. The remaining processing instructions after the initial fusion algorithm is deleted are sorted according to the preset processing logic order of the retained processing instructions to obtain a polymorphic prediction algorithm.
[0121] The weather forecasting device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned weather forecasting method embodiment of the present application. Its implementation principle and technical effects are similar and will not be repeated here.
[0122] In one embodiment, the initial fusion algorithm further includes at least one non-overlapping instruction; and the polymorphic prediction algorithm generation module is further configured to:
[0123] If there is at least one non-overlapping instruction in the initial fusion algorithm, all processing instructions after deletion and all processing instructions of the non-overlapping instructions are sorted according to a preset processing logic order to obtain a polymorphic prediction algorithm.
[0124] The weather forecasting device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned weather forecasting method embodiment of the present application. Its implementation principle and technical effects are similar and will not be repeated here.
[0125] The specific definition of the weather prediction device can be found in the definition of the weather prediction method above and will not be repeated here. Each module in the above-mentioned weather prediction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0126] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 1 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store a preset polymorphic prediction algorithm. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a weather prediction method.
[0127] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0128] In one embodiment, a computer device is also provided, including a memory and a processor, wherein a computer program is stored in the memory. When the processor executes the computer program, the technical solution in the above-mentioned weather forecasting method embodiment of the present application is implemented. The implementation principle and technical effect are similar and will not be repeated here.
[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the technical solution of the weather forecasting method mentioned above in the present application is implemented. The implementation principle and technical effect are similar and will not be repeated here.
[0130] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the technical solution of the weather forecasting method described above in the present application is implemented. The implementation principle and technical effects are similar and will not be repeated here.
[0131] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0132] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A weather forecasting method, characterized in that: The method comprises: Obtain at least one type of weather data within a preset time period in the area to be predicted; Based on the polymorphic function, each of the weather data is encapsulated in a unified format to obtain encapsulated weather information of each of the weather data; Input each packaged weather information into a polymorphic prediction algorithm for prediction processing to obtain a weather forecast result corresponding to the area to be predicted; The generation process of the polymorphic prediction algorithm includes: fusing prediction algorithms corresponding to multiple different types of weather data to obtain an initial fusion algorithm; wherein the prediction algorithms corresponding to the multiple different types of weather data include algorithms generated by a neural network model and algorithms generated by multiple processing steps; The polymorphic prediction algorithm is obtained according to the initial fusion algorithm and a preset processing logic sequence.
2. The method according to claim 1, characterized in that The method further comprises: For each weather data, detecting whether the weather data is data in a preset format; If the weather data is in the preset format, a step is performed to perform forecasting processing on each weather data according to the polymorphic forecasting algorithm to obtain a weather forecast result corresponding to the area to be forecasted.
3. The method according to claim 1 or 2, characterized in that The initial fusion algorithm includes at least one overlapping instruction, and the overlapping instruction includes at least two identical processing instructions. The polymorphic prediction algorithm is obtained according to the initial fusion algorithm and a preset processing logic sequence, including: If there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction is deleted to retain any processing instruction among the overlapping instructions. The remaining processing instructions after the deletion of the initial fusion algorithm are sorted according to the preset processing logic order of the retained processing instructions to obtain the polymorphic prediction algorithm.
4. The method according to claim 3, characterized in that The initial fusion algorithm further includes at least one non-overlapping instruction, and the method further includes: If there is at least one non-overlapping instruction in the initial fusion algorithm, the remaining processing instructions after the deletion and all processing instructions in the non-overlapping instructions are sorted according to the preset processing logic order to obtain the polymorphic prediction algorithm.
5. A weather forecasting device, characterized in that: The device comprises: A weather data acquisition module is used to acquire at least one type of weather data within a preset time period in the area to be predicted; A prediction processing module is used to encapsulate the weather data in a unified format based on a polymorphic function to obtain encapsulated weather information of each weather data, and input each encapsulated weather information into a polymorphic prediction algorithm for prediction processing to obtain a weather prediction result corresponding to the area to be predicted; An algorithm fusion module is used to fuse prediction algorithms corresponding to multiple different types of weather data to obtain an initial fusion algorithm; the prediction algorithms corresponding to the multiple different types of weather data include algorithms generated by a neural network model and algorithms generated through multiple processing steps; The polymorphic prediction algorithm generation module is used to obtain the polymorphic prediction algorithm according to the initial fusion algorithm and a preset processing logic sequence.
6. The device according to claim 5, characterized in that The weather forecasting device further comprises: A detection module, configured to detect, for each weather data, whether the weather data is data in a preset format; The execution processing module is used to execute the step of performing prediction processing on each weather data according to the polymorphic prediction algorithm when the weather data is in the preset format, so as to obtain the weather prediction result corresponding to the area to be predicted.
7. The device according to claim 5, characterized in that The initial fusion algorithm includes at least one overlapping instruction, and the overlapping instruction includes at least two identical processing instructions; the polymorphic prediction algorithm generation module is specifically used to: If there is at least one overlapping instruction in the initial fusion algorithm, each overlapping instruction is deleted to retain any processing instruction among the overlapping instructions. The remaining processing instructions after the deletion of the initial fusion algorithm are sorted according to the preset processing logic order of the retained processing instructions to obtain the polymorphic prediction algorithm.
8. The device according to claim 7, characterized in that The initial fusion algorithm further includes at least one non-overlapping instruction; the polymorphic prediction algorithm generation module is further configured to: If there is at least one non-overlapping instruction in the initial fusion algorithm, the remaining processing instructions after the deletion and all processing instructions in the non-overlapping instructions are sorted according to the preset processing logic order to obtain the polymorphic prediction algorithm.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the weather forecasting method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the weather forecasting method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Meteorological data processing method and system, electronic device and storage medium
CN111103635A
Weather prediction method and system, medium and electronic equipment
CN112836864A
Multi-model fusion adaptive new energy power prediction method and system
CN114493052A