CN113032122A - Weather forecasting method, device, equipment and storage medium - Google Patents

Weather forecasting method, device, equipment and storage medium Download PDF

Info

Publication number
CN113032122A
CN113032122A CN202110334802.6A CN202110334802A CN113032122A CN 113032122 A CN113032122 A CN 113032122A CN 202110334802 A CN202110334802 A CN 202110334802A CN 113032122 A CN113032122 A CN 113032122A
Authority
CN
China
Prior art keywords
function
thread
language
result
meteorological
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110334802.6A
Other languages
Chinese (zh)
Inventor
李震坤
苏仲岳
闫正
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Eye Control Technology Co Ltd
Original Assignee
Shanghai Eye Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Eye Control Technology Co Ltd filed Critical Shanghai Eye Control Technology Co Ltd
Priority to CN202110334802.6A priority Critical patent/CN113032122A/en
Publication of CN113032122A publication Critical patent/CN113032122A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01WMETEOROLOGY
    • G01W1/00Meteorology
    • G01W1/10Devices for predicting weather conditions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Atmospheric Sciences (AREA)
  • Environmental Sciences (AREA)
  • Ecology (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a weather forecasting method, a weather forecasting device, weather forecasting equipment and a storage medium. The method comprises the following steps: executing a first function through a first thread to calculate the radiation process of the first meteorological data through the first function to obtain a first result; executing a second function through a second thread to calculate a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are asynchronously executed and adopt different languages; and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively. According to the technical scheme, the radiation process, the power frame and other physical processes are asynchronously executed by utilizing the two threads, so that the calculation time of the radiation process in the WRF mode, the calculation time of the power frame and other physical processes are overlapped, the calculation efficiency of the forecast result is improved, and the waiting time of a user is reduced.

Description

Weather forecasting method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of meteorology, in particular to a weather forecasting method, a weather forecasting device, weather forecasting equipment and a storage medium.
Background
The WRF (Weather Research and Forecasting) mode is a commonly used numerical mode in Weather Forecasting and is widely applied to medium-short term Weather Forecasting. In view of the timeliness requirement of medium-short term weather forecast, the WRF calculation efficiency is improved, the benefits of calculation resources are fully played, and the method has important application value.
At present, some methods for improving the computational efficiency of the WRF exist, such as optimizing some parameterization schemes of the WRF mode, or optimizing input and output options of pre-processing and post-processing of the WRF mode, but the results are not good enough.
Disclosure of Invention
Embodiments of the present invention provide a weather forecasting method, apparatus, device, and storage medium, which can effectively improve WRF calculation efficiency and reduce user waiting time.
In a first aspect, an embodiment of the present invention provides a weather forecasting method, applied to a weather forecasting mode, where the weather forecasting mode includes a dynamic framework and a physical process, and the physical process includes a radiation process and other physical processes except the radiation process, and the method includes:
executing a first function through a first thread to calculate the radiation process of first meteorological data through the first function to obtain a first result, wherein the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized based on a first language;
executing a second function through a second thread, and calculating a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages;
and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively.
In a second aspect, an embodiment of the present invention further provides a weather forecasting apparatus applied to a weather forecasting mode, where the weather forecasting mode includes a dynamic framework and a physical process, and the physical process includes a radiation process and other physical processes except the radiation process, and the apparatus includes:
the first result determining module is used for executing a first function through a first thread so as to calculate the radiation process of first meteorological data through the first function to obtain a first result, wherein the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized based on a first language;
a second result determination module, configured to execute a second function through a second thread, so as to calculate a dynamic framework and other physical processes of second meteorological data through the second function, and obtain a second result, where the second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at a current time point, the second thread is implemented based on a second language, and the second language is different from the first language;
and the forecast result determining module is used for respectively using the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, implement the weather forecasting method of the first aspect.
In a fourth aspect, the embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the weather forecasting method according to the first aspect.
The embodiment of the invention provides a weather forecasting method, a weather forecasting device, weather forecasting equipment and a storage medium, wherein a first function is executed through a first thread, the radiation process of first meteorological data is calculated through the first function, a first result is obtained, the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized on the basis of a first language; executing a second function through a second thread, and calculating a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages; and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively. According to the technical scheme, the radiation process, the power frame and other physical processes are asynchronously executed by utilizing the two threads, so that the calculation time of the radiation process in the WRF mode, the calculation time of the power frame and other physical processes are overlapped, the calculation efficiency of the forecast result is improved, and the waiting time of a user is reduced.
Drawings
FIG. 1 is a diagram illustrating a WRF mode calculation process in the prior art;
fig. 2 is a flowchart of a weather forecasting method according to an embodiment of the present invention;
fig. 3 is a flowchart of a weather forecasting method according to a second embodiment of the present invention;
fig. 4 is a schematic process diagram of asynchronous WRF mode calculation according to a second embodiment of the present invention;
fig. 5 is a structural diagram of a weather forecasting apparatus according to a third embodiment of the present invention;
fig. 6 is a structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like. In addition, the embodiments and features of the embodiments in the present invention may be combined with each other without conflict.
The WRF mode is a weather forecast mode which is commonly used at present, mainly comprises a power framework and a physical process, and a weather forecast result is obtained by calculating the power framework and the physical process of the WRF mode. The dynamic framework is mainly used for discretizing a model equation without source and sink terms, and parallel solving is carried out in a numerical mode, so that the theoretical value of meteorological elements in a specified area at a future time point is calculated. The physical process mainly comprises a radiation process, a micro-physical process, a boundary layer process, a land surface process and the like, and is used for correcting the theoretical value obtained by the calculation of the power frame. The WRF mode is mainly developed based on Fortran language at present, and this language does not support asynchronous calculation, so that in the prior art, when weather forecast is performed based on the WRF mode, each process included in the WRF mode is mainly sequentially executed according to a sequence, referring to fig. 1, a radiation process needs to be calculated first, and a power frame and other physical processes need to be calculated sequentially after the radiation process is calculated. Practical tests show that the calculation time of the radiation process is far longer than that of a power frame and other physical processes, and according to the calculation mode of the figure 1, a user needs to wait for a long time. Although some techniques optimize the parameters, the method is performed in a sequential manner, and the effect is not obvious. The method and the device mainly achieve the overlapping of the calculation time of the radiation process and other processes in an asynchronous calculation mode on the basis of the WRF mode, thereby greatly improving the calculation efficiency of the WRF and reducing the waiting time of users.
Example one
Fig. 2 is a flowchart of a weather forecasting method according to an embodiment of the present invention, where the present embodiment is applicable to a case of performing numerical weather forecast prediction on a specified area, and the method may be executed by a weather forecasting apparatus, and the apparatus may be implemented by software and/or hardware, and may be integrated in an electronic device with a data processing function. Referring to fig. 2, the method may include the steps of:
s110, executing a first function through a first thread, and calculating the radiation process of the first meteorological data through the first function to obtain a first result.
Wherein the first meteorological data is meteorological data of a first meteorological element at a current time point, and the first thread is implemented based on a first language. The first thread is a thread for calculating a radiation process, and may also be referred to as a main thread, and taking development of the WRF mode based on the Fortran language as an example, the first thread may be implemented based on the Fortran language, which is the first language described in this embodiment. The first function is a function corresponding to the radiation process, and for convenience of description, the first function may be referred to as radiation (). Similar to the first thread, the first function may also be written based on the Fortran language. The first meteorological element is a meteorological element which is greatly influenced by the radiation process but is less changed along with time in the meteorological element needing to be predicted. Specifically, when the calculation process of the WRF mode is started, the first thread may execute the first function, and the radiation process of the first meteorological element is calculated, so as to obtain a result of the first meteorological element at a future predetermined time point, and the embodiment records the result as the first result. The future predetermined time point is a time point after the current time point, and the embodiment is not particularly limited.
And S120, executing a second function through a second thread, and calculating a dynamic frame and other physical processes of second meteorological data through the second function to obtain a second result.
The second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages. The second thread is used to compute the dynamic framework and other physical processes of the second meteorological element, and optionally, the second thread may be created by the first thread when the computation process of the WRF mode is started. The second thread and the first thread of the embodiment are asynchronous threads, so that asynchronous calculation can be performed on the radiation process and other processes, calculation time overlapping is realized, calculation efficiency is improved, and waiting time of a user is shortened. Considering that the WRF mode is developed based on the Fortran language and does not support asynchronous computation, in one example, a Fortran language interface may be created in advance and a function supporting asynchronous computation may be written, and when the WRF computation process is started, the function supporting asynchronous computation may be called by the first thread through the Fortran language interface, so as to create a second thread through the function, and then execute the second function through the second thread, perform computation on the power framework and other physical processes of the second meteorological element, and implement asynchronization with the first thread. Optionally, the function supporting asynchronous computation may be written based on C + + language, and for convenience of description, the function may be denoted as asyncFunc (). Accordingly, the second thread may be implemented based on the C + + language, i.e., the second language described in this embodiment.
The second meteorological element is a meteorological element which is less affected by the radiation process but has larger change with time in the meteorological elements needing to be predicted, the sum of the number of the second meteorological element and the number of the first meteorological element is larger than the number of the meteorological elements needing to be predicted, and the sum of the second meteorological element and the first meteorological element is equal to the meteorological elements needing to be predicted. The second function is a function corresponding to the power framework and other physical processes, and for convenience of description, the second function may be denoted as others (). Similar to the first function, the second function may also be written based on the Fortran language. Specifically, when the WRF calculation process is started, the first thread may call an asyncFunc () function through the Fortran language interface to create a second thread through the asyncFunc () function, and the second thread executes the second function, thereby completing the calculation of the dynamic framework and other physical processes to obtain a second result.
And S130, taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively.
Alternatively, the first result may be used as a forecast of the first meteorological element at a future predetermined time point, and the second result may be used as a forecast of the second meteorological element at a future predetermined time point.
The embodiment one of the invention provides a weather forecasting method, which comprises the steps of calling a first function through a first thread, calculating the radiation process of first meteorological data through the first function, and obtaining a first result, wherein the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized on the basis of a first language; calling a second function through a second thread, and calculating a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are asynchronously executed, the second meteorological data are meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages; and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively. According to the technical scheme, the radiation process, the power frame and other physical processes are asynchronously executed by utilizing the two threads, so that the calculation time of the radiation process in the WRF mode, the calculation time of the power frame and other physical processes are overlapped, the calculation efficiency of the forecast result is improved, and the waiting time of a user is reduced.
Example two
Fig. 3 is a flowchart of a weather forecasting method according to a second embodiment of the present invention, where the present embodiment is optimized based on the foregoing embodiment, and referring to fig. 3, the method may include the following steps:
and S210, creating a third function.
Wherein the third function is written in the second language, the third function to create the second thread. The third function is the asyncFunc () function described in the above embodiment, which is written based on the C + + language, and optionally, the asyncFunc () function may be written through the following statements: auto handle is std:: async (std:: launch:: async, others ()), and instructions, and handle is std:: future type object for storing the result returned by the thread function, std:: async is an asynchronous interface provided by C + + language through which the execution result of the thread function can be obtained, std:: launch:: async indicates that an incoming thread function is to be executed asynchronously in another thread, others () is a second function, i.e. a thread function that needs to be executed asynchronously, instructions are parameters of the ers () function, and a new thread can be created for the ers () function through the above statements and executed asynchronously, and the new thread is the second thread described in the above embodiment.
S220, creating a first language interface, so that the first thread calls the third function through the first language interface, and creating the second thread.
Since the third function is written based on the second language, a language interface needs to be additionally written so that the first thread based on the first language can call the third function through the language interface. Optionally, the first language interface is a Fortran language interface, so that the first thread based on the Fortran language can call a third function written based on the C + + language through the Fortran language interface, thereby completing creation of the second thread and providing a basis for an asynchronous computing dynamic framework and other physical processes. Alternatively, the Fortran language interface may be created as follows:
Figure BDA0002997006690000081
s230, executing a first function through the first thread, and calculating the radiation process of the first meteorological data through the first function to obtain a first result.
And S240, acquiring a fourth function corresponding to the power frame and other physical processes of the second meteorological data.
Wherein the fourth function is written in the first language. The fourth function in this embodiment is written based on the Fortran language.
S250, modifying the fourth function to obtain the second function, so that the second function allows the second thread to be called.
The conventional fourth function is written based on the Fortran language, and the fourth function needs to be modified in order to enable the function to be called by the second thread written based on the C + + language. Optionally, the fourth function may be modified by:
adding a second language mark in the function name of the fourth function, wherein the second language mark is used for indicating that the modified fourth function allows the second thread to be called;
adding a call indication statement in the fourth function, wherein the call indication statement is used for realizing that the second thread calls the modified fourth function;
and modifying the variable type of the fourth function into the variable type supporting the second language.
For example, the function name of the fourth function is called sub-others (), and the added second language tag becomes sub-others () bind (c), where bind (c) is the second language tag used to indicate that the modified fourth function is allowed to be called by the second thread. The added call indicates that the statement may be use, intra:iso _ c _ binding, which may be added next to the function name, e.g., when the function name is in the first row, the statement may be in the second row. The variable type modification is to modify the variable type in the Fortran language into a type corresponding to the C + + language, for example, integer in the Fortran language can be modified into C _ int, real can be modified into C _ float, and local can be modified into C _ pool. By modifying the fourth function, the mutual calling of the Fortran language and the C + + language can be realized.
And S260, executing a second function through a second thread, and calculating a dynamic frame and other physical processes of second meteorological data through the second function to obtain a second result.
And S270, taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively.
Exemplarily, referring to fig. 4, fig. 4 is a schematic process diagram of asynchronous computation in a WRF mode according to a second embodiment of the present invention. After the WRF calculation process is started, a first thread calls an asyncFunc () function through a Fortran language interface, a second thread is created by the asyncFunc () function, an others () function is asynchronously executed by the second thread, the dynamic frame and other physical processes are calculated, and meanwhile, the first thread continues to execute a radiation () function to calculate the radiation process. Compared with the traditional sequential computing mode, the scheme realizes asynchronous computing of the radiation process, the power frame and other physical processes through the asynchronous interface of the C + + language, so that time overlapping between different operations is realized, computing time is greatly shortened, computing efficiency is improved, and waiting time of users is reduced. Considering that the variation of the radiation process is relatively slow, the radiation process does not need to be calculated at each calculation time step, in other words, the power frame and other physical processes can be calculated once at each calculation time step in addition to the radiation process, and the process shown in fig. 4 takes as an example that one radiation process corresponds to three power frames and other physical processes, that is, the radiation process is calculated once, the power frame and other physical processes are calculated three times, that is, the power frame and other physical processes are calculated once at each calculation time step, and the radiation process is calculated once every three calculation time steps. Fig. 4 takes three calculation time steps as an example, in practical application, the short dashed line in fig. 4 represents the waiting time of the threads, and it can be understood that the calculation time of the first thread and the second thread is not necessarily the same, and especially when the second thread needs to calculate the power frame and other physical processes for multiple times, the situation that the second thread waits after the calculation of the first thread is completed may occur, and the prediction result is output after all the calculation of the two threads is completed.
The second embodiment of the invention provides a weather forecasting method, and an asynchronous interface of C + + language is introduced on the basis of the second embodiment to perform asynchronous calculation on the radiation process, the dynamic framework and other physical processes, so that time overlapping among different operations is realized, the calculation time is shortened, the calculation efficiency is improved, and the waiting time of a user is reduced.
EXAMPLE III
Fig. 5 is a structural diagram of a weather forecasting apparatus according to a third embodiment of the present invention, where the apparatus is applied to a weather forecasting mode, where the weather forecasting mode includes a dynamic frame and a physical process, the physical process includes a radiation process and other physical processes except the radiation process, and the apparatus may perform the weather forecasting method according to the third embodiment, and with reference to fig. 5, the apparatus may include:
a first result determining module 31, configured to execute a first function through a first thread, so as to calculate a radiation process of first meteorological data through the first function, and obtain a first result, where the first meteorological data is meteorological data of a first meteorological element at a current time point, and the first thread is implemented based on a first language;
a second result determination module 32, configured to execute a second function through a second thread, so as to calculate a dynamic framework and other physical processes of second meteorological data through the second function, and obtain a second result, where the second thread is executed asynchronously with the first thread, the second meteorological data is meteorological data of a second meteorological element at a current time point, the second thread is implemented based on a second language, and the second language is different from the first language;
a forecast result determining module 33, configured to use the first result and the second result as forecast results of the first meteorological element and the second meteorological element at future predetermined time points, respectively.
The third embodiment of the invention provides a weather forecasting device, which calls a first function through a first thread to calculate a radiation process of first meteorological data through the first function to obtain a first result, wherein the first meteorological data are meteorological data of a first meteorological element at a current time point, and the first thread is realized based on a first language; calling a second function through a second thread, and calculating a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are asynchronously executed, the second meteorological data are meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages; and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively. According to the technical scheme, the radiation process, the power frame and other physical processes are asynchronously executed by utilizing the two threads, so that the calculation time of the radiation process in the WRF mode, the calculation time of the power frame and other physical processes are overlapped, the calculation efficiency of the forecast result is improved, and the waiting time of a user is reduced.
On the basis of the above embodiment, the apparatus may further include:
a fourth function creation module for creating a third function written in the second language before the first function is executed by the first thread, the third function being used for creating the second thread;
and the first language interface creating module is used for creating a first language interface so that the first thread calls the third function through the first language interface to create the second thread.
On the basis of the above embodiment, the apparatus may further include:
the fourth function acquisition module is used for acquiring a fourth function corresponding to the dynamic framework and other physical processes of the second meteorological data before executing the second function through a second thread, and the fourth function is written through the first language;
and the modifying module is used for modifying the fourth function to obtain the second function so that the second function allows the second thread to be called.
On the basis of the above embodiment, the modification module is specifically configured to:
adding a second language mark in the function name of the fourth function, wherein the second language mark is used for indicating that the modified fourth function allows the second thread to be called;
adding a call indication statement in the fourth function, wherein the call indication statement is used for realizing that the second thread calls the modified fourth function;
and modifying the variable type of the fourth function into the variable type supporting the second language.
The weather forecasting device provided by the embodiment of the invention and the weather forecasting method provided by the embodiment belong to the same inventive concept, technical details which are not described in detail in the embodiment can be referred to the embodiment, and the embodiment has the same beneficial effects of executing the weather forecasting method.
Example four
Fig. 6 is a structural diagram of an electronic device according to a fourth embodiment of the present invention, and referring to fig. 6, the electronic device may include: the electronic device includes a processor 41, a memory 42, an input device 43, and an output device 44, where the number of the processors 41 in the electronic device may be one or more, one processor 41 is illustrated in fig. 6, the processor 41, the memory 42, the input device 43, and the output device 44 in the electronic device may be connected by a bus or in another manner, and the processor 41, the memory 42, the input device 43, and the output device 44 in the electronic device are illustrated in fig. 6 as being connected by a bus.
The memory 42 is used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the weather forecast method in the embodiment of the present invention. The processor 41 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 42, that is, implements the weather forecast method of the above-described embodiment.
The memory 42 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 42 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 42 may further include memory located remotely from processor 41, which may be connected to the electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 43 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic apparatus. The output device 44 may include a display device such as a display screen, and an audio device such as a speaker and a buzzer.
The electronic device provided by the embodiment of the invention and the weather forecasting method provided by the embodiment belong to the same inventive concept, technical details which are not described in detail in the embodiment can be referred to the embodiment, and the embodiment has the same beneficial effects of executing the weather forecasting method.
EXAMPLE five
An embodiment five of the present invention provides a computer-readable storage medium, on which a computer program is stored, the program being when executed by a processor for performing a weather forecasting method applied to a weather forecasting mode including a dynamic frame and a physical process including a radiative process and a physical process other than the radiative process, the method including:
executing a first function through a first thread to calculate the radiation process of first meteorological data through the first function to obtain a first result, wherein the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized based on a first language;
executing a second function through a second thread, and calculating a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages;
and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively.
Storage media for embodiments of the present invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A weather forecast method applied to a weather forecast mode including a dynamic frame and physical processes including a radiation process and other physical processes except the radiation process, the method comprising:
executing a first function through a first thread to calculate the radiation process of first meteorological data through the first function to obtain a first result, wherein the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized based on a first language;
executing a second function through a second thread, and calculating a dynamic framework and other physical processes of second meteorological data through the second function to obtain a second result, wherein the second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at the current time point, the second thread is realized based on a second language, and the second language and the first language are different languages;
and taking the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point respectively.
2. The method of claim 1, further comprising, prior to executing the first function by the first thread:
creating a third function, written in the second language, for creating the second thread;
and creating a first language interface so that the first thread calls the third function through the first language interface to create the second thread.
3. The method of claim 1, further comprising, prior to executing the second function by the second thread:
acquiring a fourth function corresponding to the dynamic framework and other physical processes of the second meteorological data, wherein the fourth function is compiled through the first language;
and modifying the fourth function to obtain the second function so that the second function allows the second thread to be called.
4. The method of claim 3, wherein said modifying said fourth function comprises:
adding a second language mark in the function name of the fourth function, wherein the second language mark is used for indicating that the modified fourth function allows the second thread to be called;
adding a call indication statement in the fourth function, wherein the call indication statement is used for realizing that the second thread calls the modified fourth function;
and modifying the variable type of the fourth function into the variable type supporting the second language.
5. A weather forecast apparatus, applied to a weather forecast mode including a dynamic frame and physical processes including a radiation process and other physical processes except the radiation process, the apparatus comprising:
the first result determining module is used for executing a first function through a first thread so as to calculate the radiation process of first meteorological data through the first function to obtain a first result, wherein the first meteorological data are meteorological data of a first meteorological element at the current time point, and the first thread is realized based on a first language;
a second result determination module, configured to execute a second function through a second thread, so as to calculate a dynamic framework and other physical processes of second meteorological data through the second function, and obtain a second result, where the second thread and the first thread are executed asynchronously, the second meteorological data is meteorological data of a second meteorological element at a current time point, the second thread is implemented based on a second language, and the second language is different from the first language;
and the forecast result determining module is used for respectively using the first result and the second result as the forecast results of the first meteorological element and the second meteorological element at the future preset time point.
6. The apparatus of claim 5, further comprising:
a fourth function creation module for creating a third function written in the second language before the first function is executed by the first thread, the third function being used for creating the second thread;
and the first language interface creating module is used for creating a first language interface so that the first thread calls the third function through the first language interface to create the second thread.
7. The apparatus of claim 5, further comprising:
the fourth function acquisition module is used for acquiring a fourth function corresponding to the dynamic framework and other physical processes of the second meteorological data before executing the second function through a second thread, and the fourth function is written through the first language;
and the modifying module is used for modifying the fourth function to obtain the second function so that the second function allows the second thread to be called.
8. The apparatus of claim 7, wherein the modification module is specifically configured to:
adding a second language mark in the function name of the fourth function, wherein the second language mark is used for indicating that the modified fourth function allows the second thread to be called;
adding a call indication statement in the fourth function, wherein the call indication statement is used for realizing that the second thread calls the modified fourth function;
and modifying the variable type of the fourth function into the variable type supporting the second language.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, implement the weather forecasting method of any of claims 1-4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a weather forecasting method according to any one of claims 1 to 4.
CN202110334802.6A 2021-03-29 2021-03-29 Weather forecasting method, device, equipment and storage medium Pending CN113032122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110334802.6A CN113032122A (en) 2021-03-29 2021-03-29 Weather forecasting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110334802.6A CN113032122A (en) 2021-03-29 2021-03-29 Weather forecasting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113032122A true CN113032122A (en) 2021-06-25

Family

ID=76452725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110334802.6A Pending CN113032122A (en) 2021-03-29 2021-03-29 Weather forecasting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113032122A (en)

Similar Documents

Publication Publication Date Title
CN103189853B (en) For the method and apparatus providing efficient context classification
US20230394330A1 (en) A method and system for designing ai modeling processes based on graph algorithms
CN107305486B (en) Neural network maxout layer computing device
CN117271101B (en) Operator fusion method and device, electronic equipment and storage medium
CN114429195A (en) Performance optimization method and device for hybrid expert model training
CN113836454A (en) Content display page display method, device, medium and equipment
CN113032122A (en) Weather forecasting method, device, equipment and storage medium
CN110704099B (en) Alliance chain construction method and device and electronic equipment
CN117311975A (en) Large model parallel training method, system and readable storage medium
CN116360989A (en) Execution processing method and device of computing engine job, electronic equipment and medium
CN111915017B (en) Calibration method, device, terminal equipment and storage medium
CN113051173B (en) Method, device, computer equipment and storage medium for arranging and executing test flow
CN111736968B (en) Distribution system cloud data center computing resource optimal configuration method, device, equipment and medium
CN114461299A (en) Unloading decision determining method and device, electronic equipment and storage medium
CN114220014A (en) Method, device, equipment and medium for determining saliency target detection model
CN114692824A (en) Quantitative training method, device and equipment of neural network model
CN109002684B (en) Interval information analysis method
CN116822259B (en) Evaluation information generation method and device based on scene simulation and electronic equipment
CN112035523B (en) Determination method, device, equipment and storage medium for parallelism
CN117113727B (en) Interactive numerical simulation equipment configuration method and device and electronic equipment
CN109308327A (en) Figure calculation method device medium apparatus based on the compatible dot center's model of subgraph model
CN118277291A (en) Operator-based data processing method and device, electronic equipment and storage medium
CN117714446B (en) Unloading method and device for satellite cloud edge cooperative computing
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium
CN114707708B (en) ENSO prediction method, apparatus and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination