Meteorological data downloading engine and method
Technical field
The present invention relates to weather service process field, relate in particular to a kind of meteorological data downloading engine and method.
Background technology
Meteorological service system moves required meteorological fields data and has instantaneity, conventionally online issue complete data is used this data to do real time business system to user and forecasts to only have short period interval, and ambient field data is conventionally larger and more, downloads in time complete data to user and bring certain difficulty.
The download tool that at present large multi-user adopts often be single-threaded, without the software of breakpoint transmission function, do not possess at a high speed and stable advantage, download complete file need to the more time, cannot meet real-time operation system operation demand.
It is slower, consuming time more that downloading service system is moved required ambient field data speed, cannot meet the time requirement of real time business operation.
It is very unsane that downloading service system is moved required ambient field data instrument, do not possess breakpoint transmission function, causes required information to be downloaded imperfect.
Summary of the invention
One or more problems for existing in correlation technique, the object of the present invention is to provide a kind of meteorological data downloading engine and method, with in addressing the above problem one of at least.
For achieving the above object, according to an aspect of the present invention, a kind of meteorological data downloading engine is provided, comprise: meteorological data download module, be used for adopting multithreading downloading mode to obtain meteorological background information from one or more external servers, meteorological data download module has breakpoint transmission function and many mirror points download function; Acquisition of information module, for obtaining the configuration information of downloaded meteorological background information; Integrity detection module, the integrality of the meteorological background information of downloading for the configuration information detection of obtaining according to acquisition of information module; Administration module, for managing meteorological data download module, acquisition of information module and integrity detection module; And memory module, for storing downloaded meteorological background information.
Meteorological data download module comprises: download module, for adopting multithreading downloading mode to download meteorological background information from one or more external servers, and is stored to memory module by downloaded meteorological background information; Breakpoint transmission function activation module, for starting breakpoint transmission function according to the indication of administration module; And many mirror points download function startup module, for starting many mirror points download function according to the indication of administration module.
Integrity detection module comprises: first detection module, for detect the integrality of the meteorological background information of downloading according to the configuration information of meteorological background information; The second detection module, for detecting at first detection module in the incomplete situation of meteorological background information, detects the integrality of the data in meteorological background information; And the 3rd detection module, for detecting at the second detection module in the incomplete situation of data of meteorological background information, detect data and whether be once downloaded, and notify administration module by testing result.
The configuration information of meteorological background information comprises: the download date of meteorological background information and download interval.
Administration module comprises: the first control module, starts to download or stop downloading meteorological background information for controlling meteorological downloaded data module; And second control module, the in the situation that of being once downloaded for data being detected in integrity detection module, controlling meteorological data download module and start breakpoint transmission function; The in the situation that of not being downloaded before integrity detection module detects data, controlling meteorological data download module and start many mirror points download function; And indicating module, for according to the processing of the first control module and/or the second control module, generate corresponding indication notice to download module.
In integrity detection module, meteorological background information detected complete in the situation that, the first control module is controlled download module and is stopped downloading.
For achieving the above object, according to another aspect of the present invention, provide a kind of meteorological data method for down loading, the method comprises: by meteorological data download module, adopt multithreading downloading mode to obtain meteorological background information from one or more external servers; By acquisition of information module, obtain the configuration information of downloaded meteorological background information; The configuration information of obtaining according to acquisition of information module detects the integrality of the meteorological background information of downloading by integrity detection module, and notifies control module by testing result; And according to testing result, by administration module, control meteorological data download module and carry out respective handling.
Respective handling comprises: breakpoint transmission and/or many mirror points are downloaded.
The integrality that detects the meteorological background information of downloading comprises: according to the configuration information of meteorological background information, by first detection module, detect the integrality of downloaded meteorological background information; At first detection module, detect in the incomplete situation of meteorological background information, detect the integrality of the data in meteorological background information; And detect in the incomplete situation of data in meteorological background information at the second detection module, detect data and whether be once downloaded, and notify administration module by testing result.
The configuration information of meteorological background information comprises: the download date of meteorological background information and download interval.
Controlling meteorological data download module carries out respective handling and comprises: in the situation that integrity detection module detects data and was once downloaded, by administration module, indicate meteorological data download module startup breakpoint transmission to process; And be not downloaded before integrity detection module detects data in the situation that, by administration module, indicate meteorological data download module to start many mirror points download process.
In integrity detection module, meteorological background information detected complete in the situation that, by administration module, indicate download module to stop downloading.
Download engine of the present invention and method can provide enriches parameter, meets the different download demands of user, takes into account user's debugging and practical business system operation demand, can provide many mirror points, multithreading, support breakpoint transmission to download.Implementation method is for adopting the multithreading download tool of optimizing, can utilize a plurality of links of this document to download simultaneously, there is speed of download at a high speed, file integrity detection can be provided, possess breakpoint transmission function, minimizing causes download to be interrupted because network quality is unstable so that file is downloaded incomplete.
Accompanying drawing explanation
Fig. 1 is the block diagram of meteorological data downloading engine according to an embodiment of the invention;
Fig. 2 is the block diagram of meteorological data download module according to an embodiment of the invention;
Fig. 3 is the block diagram of integrity detection module according to an embodiment of the invention;
Fig. 4 is the block diagram of administration module according to an embodiment of the invention;
Fig. 5 is the flow chart of meteorological data method for down loading according to an embodiment of the invention; And
Fig. 6 is the schematic diagram that detects according to an embodiment of the invention the integrality of downloaded meteorological background information and carry out the flow process of respective handling.
Embodiment
Fig. 1 is the block diagram of meteorological data downloading engine according to an embodiment of the invention.As shown in Figure 1, this meteorological data downloading engine comprises: meteorological data download module 102, be used for adopting multithreading downloading mode to obtain meteorological background information from one or more external servers, meteorological data download module has breakpoint transmission function and many mirror points download function; Acquisition of information module 104, for obtaining the configuration information of downloaded meteorological background information; Integrity detection module 106, the integrality of the meteorological background information of downloading for the configuration information detection of obtaining according to acquisition of information module; Administration module 108, for managing meteorological data download module, acquisition of information module and integrity detection module; And memory module 110, for storing downloaded meteorological background information.
Fig. 2 is the block diagram of meteorological data download module according to an embodiment of the invention.As shown in Figure 2, meteorological data download module comprises: download module 1022, for adopting multithreading downloading mode to download meteorological background information from one or more external servers, and is stored to memory module by downloaded meteorological background information; Breakpoint transmission function activation module 1024, for starting breakpoint transmission function according to the indication of administration module; And many mirror points download function startup module 1026, for starting many mirror points download function according to the indication of administration module.
Fig. 3 is the block diagram of integrity detection module according to an embodiment of the invention.As shown in Figure 3, this integrity detection module comprises: first detection module 1062, for detect the integrality of the meteorological background information of downloading according to the configuration information of meteorological background information; The second detection module 1064, for detecting at first detection module in the incomplete situation of meteorological background information, detects the integrality of the data in meteorological background information; And the 3rd detection module 1066, for detecting at the second detection module in the incomplete situation of data of meteorological background information, detect data and whether be once downloaded, and notify administration module by testing result.
The configuration information of meteorological background information comprises: the download date of meteorological background information and download interval.
Fig. 4 is the block diagram of administration module according to an embodiment of the invention.As shown in Figure 4, this administration module 108 comprises: the first control module 1082, starts to download or stop downloading meteorological background information for controlling meteorological downloaded data module; And second control module 1084, the in the situation that of being once downloaded for data being detected in integrity detection module, controlling meteorological data download module and start breakpoint transmission function; The in the situation that of not being downloaded before integrity detection module detects data, controlling meteorological data download module and start many mirror points download function; And indicating module 1086, for according to the processing of the first control module and/or the second control module, generate corresponding indication notice to download module.
In integrity detection module, meteorological background information detected complete in the situation that, the first control module is controlled download module and is stopped downloading.
Fig. 5 is the flow chart of meteorological data method for down loading according to an embodiment of the invention.As shown in Figure 5, meteorological data method for down loading comprises:
Step S502, adopts multithreading downloading mode to obtain meteorological background information from one or more external servers by meteorological data download module;
Step S504, obtains the configuration information of downloaded meteorological background information by acquisition of information module;
Step S506, the configuration information of obtaining according to acquisition of information module detects the integrality of the meteorological background information of downloading by integrity detection module, and notifies control module by testing result; And
Step S508, controls meteorological data download module according to testing result by administration module and carries out respective handling.
This respective handling comprises: breakpoint transmission and/or many mirror points are downloaded.
The flow process of the integrality of the meteorological background information that as shown in Figure 6, detection is downloaded according to an embodiment of the invention comprises:
Step S602, detects the integrality of downloaded whole meteorological background informations by first detection module according to the configuration information of meteorological background information;
Step S604, detects in the incomplete situation of meteorological background information at first detection module, detects the integrality of the data in meteorological background information; And
Whether step S606, detects in the incomplete situation of data in meteorological background information at the second detection module, detect data and be once downloaded, and notify administration module by testing result.
The configuration information of meteorological background information comprises: the download date of meteorological background information and download interval.
As shown in Figure 6, controlling according to an embodiment of the invention the flow process that meteorological data download module carries out respective handling comprises: step S608, in the situation that integrity detection module detects data and was once downloaded, by administration module, indicate meteorological data download module to start breakpoint transmission and process; And step S610, the in the situation that of not being downloaded before integrity detection module detects data, by administration module, indicate meteorological data download module to start many mirror points download process.
In integrity detection module, meteorological background information detected complete in the situation that, by administration module, indicate download module to stop downloading.
By the present invention, can reach following technique effect:
1, download engine of the present invention and method can provide and enrich parameter, meet the different download demands of user, take into account user's debugging and practical business system operation demand.
2, download engine of the present invention and method can provide many mirror points, multithreading, support breakpoint transmission to download.Implementation method, for adopting the multithreading download tool of optimizing, can utilize a plurality of links of this document to download simultaneously, has speed of download at a high speed.
3, download engine of the present invention and method can provide file integrity detection, possess breakpoint transmission function, and minimizing causes download to be interrupted because network quality is unstable so that file is downloaded incomplete.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.