Summary of the invention
In order to solve the problems of the technologies described above, to the invention provides a kind of weather data method and weather data service system are provided, thereby make application apparatus can obtain the inquiry service of weather data based on application apparatus.
For addressing the above problem, the invention provides a kind of weather data method is provided based on application apparatus, comprising:
After the weather query requests that acquisition is sent by application apparatus, resolve described weather query requests, obtain weather information key word and time information key word in the described weather query requests at least;
From the weather sources extracting data critical data relevant with analysis result;
Described critical data is formatd, form weather data, and described weather data is provided to application apparatus.
Optionally, described weather query requests also includes city title key word; Resolve described weather query requests and also comprise the described city of acquisition title key word.
Optionally, described weather query requests does not include city title key word; Resolve described weather query requests and also comprise,, obtain city title key word according to city, the current place of described application apparatus.
Optionally, described weather sources data obtain by following manner: after resolving described weather query requests acquisition analysis result, gather and the corresponding weather sources data of described city title key word.
Optionally, described weather sources data are that timing acquiring obtains, and comprising: after setting fixedly city list, timing is carried out the collection of weather sources data according to described fixedly city list.
Optionally, the critical data relevant with analysis result from the weather sources extracting data comprises: based on weather information key word the analysis result and time information key word, extract critical data from the weather sources data.
Optionally, described critical data is formatd, form weather data and comprise: with txt, any one form among word, the excel is preserved with critical data.
Optionally, also be included in described weather data when carrying or afterwards, weather data is stored to application apparatus.
Optionally, after described weather data is stored, if acquisition is then resolved described other weather query requests by other weather query requests that application apparatus sends, whether has the weather data of required inquiry in the weather data according to analysis result inquiry storage; If have, then directly described weather data is provided to application apparatus; If do not have, then trigger the collection of weather sources data, then from the weather sources data extract critical data relevant with analysis result based on described analysis result; Critical data after extracting is formatd, form weather data, and described weather data is provided to application apparatus.
Optionally, described weather data to be stored as with the city be that master record is stored respectively.
Optionally, described application apparatus is mobile unit or pc client.
The present invention also provides a kind of weather data service system based on application apparatus, comprising:
Application apparatus is used to send the weather query requests;
Service centre is used to receive and resolve the weather query requests that described application apparatus sends, and obtains weather information key word and time information key word in the described weather query requests at least, and analysis result is sent to data center; And provide by data center to described application apparatus and to form the weather data corresponding with the weather query requests;
Data center is used to receive the analysis result that is provided by service centre, forms the weather data described data center corresponding with the weather query requests and comprises:
Collecting unit is gathered the weather sources data;
Extraction unit is from the weather sources extracting data critical data relevant with described analysis result;
Formatting unit after described critical data formatd, forms the weather data corresponding with the weather query requests.
Optionally, described service centre comprises:
Resolution unit is resolved the weather query requests that is sent by application apparatus, obtains weather information key word and time information key word in the described weather query requests at least, and analysis result is sent to the communication unit of signal transmission with it;
Communication unit receives and sends analysis result to data center, and receives the weather data that data center forms, and provides to application apparatus.
Optionally, described weather query requests also includes city title key word, and then resolution unit obtains described city title key word from described weather query requests.
Optionally, described weather query requests does not include city title key word, and then resolution unit obtains city title key word according to city, the current place of described application apparatus.
Optionally, described collecting unit receives the analysis result that described communication unit sends, and behind the acquisition analysis result, gathers and the corresponding weather sources data of described city title key word.
Optionally, be preset with city list in the described collecting unit, described collecting unit regularly carries out the collection of weather sources data according to described city list.
Optionally, described extraction unit comprises from the weather sources extracting data critical data relevant with analysis result: weather information key word and time information key word the analysis result that sends based on communication unit extract from the weather sources data.
Optionally, described formatting unit formats described critical data, forms weather data and comprises: with txt, any one form among word, the excel is preserved with critical data.
Optionally, described data center also comprises storage unit, stores behind the weather data that described storage unit reception formatting unit forms, and described weather data is provided to application apparatus.
Optionally, described data center also includes control module;
Described communication unit is behind the analysis result that obtains the resolution unit transmission, weather data in the storage unit is inquired about, if have the weather data corresponding in the described storage unit, then weather data corresponding in the described storage unit is provided to application apparatus with the weather query requests; If do not have, then communication unit is sent to control module with described analysis result;
Described control module triggers the weather sources data acquisition of described collecting unit behind the analysis result that obtains the communication unit transmission.
Optionally, described storage unit is for being that master record is stored weather data respectively with the city.
Optionally, described application apparatus is mobile unit or pc client.
Compare with prior art and the invention has the advantages that:
The weather data that the present invention is based on application apparatus provides method and weather data service system, and it can be by resolving the weather query requests that application apparatus sends, and then generate corresponding weather data, for application apparatus provides inquiry service;
Can also pass through timing acquiring weather sources data on the other hand, and then generate corresponding weather data, the weather data of described generation can be stored earlier, for application apparatus provides follow-up inquiry service.
Embodiment
Also can't realize diversified multimedia operations at Che Nei at present, for example real-time inquiry of weather conditions etc.Even wherein there are some multimedia operations to be undertaken by the wireless Internet access or the phone of mobile phone, but such complicated operation, expense are higher, and carry out multimedia operations and can make troubles on automobile.
For solving described problem, the inventor provides a kind of weather data based on application apparatus that method is provided, comprise: after the weather query requests that obtains to send by application apparatus, resolve described weather query requests, obtain weather information key word and time information key word in the described weather query requests at least; From the weather sources extracting data critical data relevant with analysis result; Described critical data is formatd, form weather data, and described weather data is provided to application apparatus.
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described in detail.Only for illustrating, the present invention is not limited in the scheme among the embodiment to following embodiment, and in addition, the simple transformation that those skilled in the art can carry out in the prior art scope and the technical scheme that obtains are all in protection scope of the present invention.
Fig. 1 comprises for the weather data that the present invention is based on application apparatus provides the method flow diagram of first embodiment of method:
Execution in step S101 obtains the weather query requests of being sent by application apparatus.Described application apparatus can be mobile unit or pc client.
Include weather information key word and time information key word in the described weather query requests.Particularly:, can be divided into the information key word of relevant short-time forecast and the information key word of relevant Long-term forecasting according to the temporal information key word.Short-time forecast is meant following 72 hours, that is, and and for today, tomorrow and posteriori weather forecast.Short-time forecast also has 3 hours, weather forecast in 6 hours.Long-term forecasting has week forecast, ten days forecast, month forecast, seasonal forecasting, forecasts in 6 months etc.; According to the weather information key word, then include: air pressure, temperature (highest temperature, the lowest temperature, temperature on average), wet-bulb temperature, dewpoint temperature, relative humidity, wind direction, quantity of precipitation, cloud, evaporation capacity, sunshine-duration, sunshine amount, rain frequency and other meteorological key words.
Further, also include city title key word in the described weather query requests.
Execution in step S102 resolves described weather query requests.Analysis result will obtain weather information key word and the time information key word in the described weather query requests at least.
Resolve described weather query requests and also comprise acquisition city title key word: if also include city title key word in the described weather Query Result, then directly from as an embodiment, described parsing comprises acquisition city title key word to be checked from the weather query requests; If in the weather query requests, the user does not include the specific city title key word of input, then according to the locating content of the automatic GPRS that obtains in city, the current place of described application apparatus, obtains the city title key word at user access point place.
Execution in step S103 gathers the weather sources data.Particularly, according to the city title key word in the analysis result, gather and the corresponding weather sources data of described city title key word.
The approach of described collection comprises: obtain the webpage of the weather sources data corresponding with city title key word from the internet, perhaps directly with from forecast center's downloaded weather sources data corresponding with city title key word.
Execution in step S104 is from the weather sources extracting data critical data relevant with analysis result.
Collection through S103, described weather sources data include and the incoherent information of weather query requests toward contact, as advertisement or other link informations that often adds on the webpage, so after gathering acquisition weather sources data, also comprise and read and resolve the weather sources data that collect, be specially: based on weather information key word in the analysis result and time information key word, from the weather sources data, extract critical data, to remove incoherent information in the weather sources data.
Execution in step S105 formats described critical data, forms weather data, and described weather data is provided to application apparatus.
Wherein, to the format of weather data should be taken into account application apparatus identification, read and show.The concrete weather data that forms comprises: with txt, any one form among word, the excel is preserved with critical data.
The weather data that following scheme conduct the present invention is based on application apparatus provides second embodiment of method, specifically comprises as follows:
Before the weather query requests that application apparatus sends, the weather sources data are carried out timing acquiring, comprising: after setting fixedly city list, timing is carried out the collection of weather sources data according to described fixedly city list;
After the weather query requests that acquisition is sent by application apparatus, resolve described weather query requests, obtain weather information key word and time information key word in the described weather query requests at least;
From the weather sources extracting data of the described timing acquiring critical data relevant with analysis result;
Described critical data is formatd, form weather data, and described weather data is provided to application apparatus.
About to the parsing of weather query requests, to the extraction of weather sources data and can be with reference to first embodiment to the formative detailed description of critical data.
Following scheme provides method the 3rd embodiment as the weather data that the present invention is based on application apparatus, specifically comprises:
After the weather query requests that acquisition is sent by application apparatus, resolve described weather query requests, obtain weather information key word and time information key word in the described weather query requests at least;
From the weather sources extracting data critical data relevant with analysis result;
Described critical data is formatd, form weather data, and described weather data is provided to application apparatus, wherein, when described weather data is carried to application apparatus or afterwards, weather data is stored.
After described weather data is stored,, whether has the weather data of required inquiry in the weather data according to analysis result inquiry storage if acquisition is then resolved described other weather query requests by other weather query requests that application apparatus sends; If have, then directly described weather data is provided to application apparatus; If do not have, then trigger the collection of weather sources data, then from the weather sources data extract critical data relevant with analysis result based on described analysis result; Critical data after extracting is formatd, form weather data, and described weather data is provided to application apparatus.
Weather data provides among method the 3rd embodiment, about to the parsing of weather query requests, can provide method first embodiment or weather data to provide method second embodiment with reference to weather data to the extraction of weather sources data and to the formative detailed description of critical data.
The present invention also provides a kind of weather data service system based on application apparatus, comprising: application apparatus is used to send the weather query requests; Service centre is used to receive and resolve the weather query requests that described application apparatus sends, and obtains weather information key word and time information key word in the described weather query requests at least, and analysis result is sent to data center; And provide by data center to described application apparatus and to form the weather data corresponding with the weather query requests; Data center is used to receive the analysis result that is provided by service centre, forms the weather data described data center corresponding with the weather query requests and comprises: collecting unit, gather the weather sources data; Extraction unit is from the weather sources extracting data critical data relevant with described analysis result; Formatting unit after described critical data formatd, forms the weather data corresponding with the weather query requests.
Below in conjunction with accompanying drawing the weather data service system that the present invention is based on application apparatus is described in detail.
Fig. 2 is that weather data service system first embodiment that the present invention is based on application apparatus uses synoptic diagram, specifically comprises:
Application apparatus 100, the weather data query requests is provided, and described application apparatus 100 can be mobile unit or pc client, includes weather information key word and time information key word in the described weather query requests, further, also include city title key word in the described weather query requests;
Service centre 200 is used to receive and resolve the weather query requests that described application apparatus 100 sends, and obtains weather information key word and time information key word in the described weather query requests at least, and analysis result is sent to data center 300; And provide by data center 300 to described application apparatus 100 and to form, the weather data corresponding with the weather query requests is used for receiving and resolving described weather query requests, and the weather data that is provided by data center 300 for described application apparatus 100 transmission;
Data center 300 is used to receive the weather query requests after the parsing that is provided by service centre 200, generates weather data, and provides weather data by service centre 200 to application apparatus 100.
Described service centre 200 is made up of resolution unit 201 and communication unit 202, particularly: described resolution unit 201 is used to resolve the weather query requests that is sent by application apparatus 100, at least obtain weather information key word and time information key word in the described weather query requests, and analysis result is sent to the communication unit 202 of signal transmission with it; Described communication unit 202 receives and sends analysis result to data center 300, and receives the weather data that data center 300 forms, and provides to application apparatus 100.
Wherein, described resolution unit 201 also comprises acquisition city title key word, if described weather query requests includes city title key word, then resolution unit 201 directly obtains described city title key word from described weather query requests, if described weather query requests do not include city title key word then resolution unit 201 obtain city title key word according to city, described application apparatus 100 current place.
Continuation is with reference to figure 2, and described data center 300 comprises:
Collecting unit 301 is used to gather the weather sources data, and the collection approach comprises: obtain the webpage with weather sources data from the internet, perhaps directly from forecast center's downloaded weather sources data;
Extraction unit 302 is from the weather sources extracting data critical data relevant with described analysis result.Promptly weather information key word and the time information key word in the analysis result that sends based on communication unit 202 extracts critical data from the weather sources data, to remove as incoherent information such as the advertisement of the frequent adding of institute on the webpage or other link informations;
Formatting unit 303 is used for described critical data is formatd, and forms the weather data corresponding with the weather query requests.Format should be taken into account application apparatus 100 identification, read and show.Formatting unit 303 can be with critical data with txt, and any one form among word, the excel is preserved.
Described weather data transfers to communication unit 202, and provides to application apparatus 100 by communication unit 202.
Wherein, the collecting unit 301 in the described data center 300 can carry out the collection of weather sources data according to following mode: behind the analysis result that obtains to be provided by communication unit 202, gather and the corresponding weather sources data of described city title key word; Perhaps be preset with city list in described collecting unit 301, described collecting unit 301 regularly carries out the collection of weather sources data according to described city list.Subsequently, carrying out above-mentioned critical data by 302 pairs of weather sources data of described extraction unit extracts.
Fig. 3 is the application synoptic diagram of data service system second embodiment of the present invention, simultaneously with reference to figure 2, is that with the difference of data service system first embodiment data center 300 also includes:
Storage unit 304 is stored after being used to receive the weather data that formatting unit 303 forms, and described weather data is provided to application apparatus 100;
Control module 305 receives resolution unit 202 analysis results that described communication unit 202 sends, and triggers the weather sources data acquisition of described collecting unit 301.
Particularly, communication unit 202 is inquired about storage unit 304 according to analysis result, if have the weather data corresponding in the described storage unit 304, then corresponding weather data in the described storage unit 304 is provided to application apparatus 100 with the weather query requests; If do not have, then communication unit 202 is sent to control module 305 with described analysis result, gathers by control module 305 triggering collection unit 301.
Further, described storage unit 304 can be carried out the classification and storage weather data with the city title, and being the city is that master record is stored weather data respectively.
Further, described storage unit 304 can be stored all weather datas that described formatting unit 303 forms, and can also only store current up-to-date formation weather data.
Though the present invention with preferred embodiment openly as above; but it is not to be used for limiting the present invention; any those skilled in the art without departing from the spirit and scope of the present invention; can make possible change and modification, so protection scope of the present invention should be as the criterion with the scope that claim of the present invention was defined.