CN102970651A - Processing method and device and mobile terminal for weather forecast data - Google Patents

Processing method and device and mobile terminal for weather forecast data Download PDF

Info

Publication number
CN102970651A
CN102970651A CN2012105059106A CN201210505910A CN102970651A CN 102970651 A CN102970651 A CN 102970651A CN 2012105059106 A CN2012105059106 A CN 2012105059106A CN 201210505910 A CN201210505910 A CN 201210505910A CN 102970651 A CN102970651 A CN 102970651A
Authority
CN
China
Prior art keywords
weather forecast
data
source
weather
access
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.)
Granted
Application number
CN2012105059106A
Other languages
Chinese (zh)
Other versions
CN102970651B (en
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.)
Beijing Xiaomi Technology Co Ltd
Original Assignee
Beijing Xiaomi 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 Beijing Xiaomi Technology Co Ltd filed Critical Beijing Xiaomi Technology Co Ltd
Priority to CN201210505910.6A priority Critical patent/CN102970651B/en
Publication of CN102970651A publication Critical patent/CN102970651A/en
Application granted granted Critical
Publication of CN102970651B publication Critical patent/CN102970651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a processing method and device and a mobile terminal for weather forecast data. The method comprises the following steps of: requesting to acquire the weather forecast data from a current weather forecast data source; taking the acquired weather forecast data as the weather forecast data to be provided for a user when the weather forecast data is successfully acquired from the current weather forecast data source; and acquiring at least one available weather forecast data source from preset optional weather forecast data sources and acquiring the weather forecast data from the available weather forecast data source as the weather forecast data to be provided for the user when the weather forecast data is not successfully acquired from the current weather forecast data source. By adopting the technical scheme disclosed by the embodiment of the invention, when the weather forecast data can not be acquired from a current data source device, the weather forecast data can be still provided for a weather application by switching to the available weather forecast data source, so that the weather application can acquire the weather forecast data and the reliability of the weather application can be improved.

Description

A kind of processing method of data of weather forecast and device, portable terminal
Technical field
The present invention relates to technical field of mobile terminals, relate in particular to a kind of processing method of data of weather forecast and device, portable terminal.
Background technology
Along with the development of science and technology, portable terminal has obtained universal use in users.And for the ease of user's use, the increasing application (Application is called for short APP) developed by the technical staff.
For example, in the correlation technique, for the ease of user's Real-time Obtaining weather condition, the technical staff has developed the weather application of a lot of uses on portable terminal, such as ink marks weather etc., can obtain to get the same day or data of weather forecast within these few days by weather application.During use, the user of portable terminal loads weather application by the portable terminal in its use, when the user need to obtain data of weather forecast, can obtain the same day or data of weather forecast within these few days from data source by this weather application, and the display screen by portable terminal is shown to the user after resolving.Like this, the user can make arrangement to life plans such as trips in advance according to the data of weather forecast that obtains, and is very easy to use.
In realizing process of the present invention, the inventor finds to have at least following problem: the data source of the data of weather forecast of present weather application is single, when single data-source device breaks down can't access the time, can't obtain data of weather forecast, and cause the reliability of weather application lower.
Summary of the invention
The embodiment of the invention provides a kind of processing method of data of weather forecast and device, portable terminal, is used for realizing breaking down can't access the time when single data-source device, guarantees to get access to data of weather forecast, thus the reliability of raising weather application.
First aspect, the embodiment of the invention provide a kind of processing method of data of weather forecast, may further comprise the steps:
To current data of weather forecast source acquisition request data of weather forecast;
When successfully getting access to data of weather forecast from described current data of weather forecast source, with the described data of weather forecast that gets access to as the data of weather forecast that offers the user;
When successfully not getting access to data of weather forecast from described current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by described available data of weather forecast source.
Alternatively, in the first implementation of above-mentioned first aspect, to current data of weather forecast source acquisition request data of weather forecast, in the following way:
To current data of weather forecast source acquisition request data of weather forecast, and detect when request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet;
When request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet, determine not get access to data of weather forecast from described current data of weather forecast source;
When request number of times does not reach preset times and namely gets access to data of weather forecast from described current data of weather forecast source, determine to get access to data of weather forecast from described current data of weather forecast source.
Alternatively, in the second implementation of above-mentioned first aspect, determine that as before the data of weather forecast that offers the user, described method also comprises with the described data of weather forecast that gets access to after described current data of weather forecast source gets access to data of weather forecast:
Obtain the verification data of weather forecast;
Judgement also determines that described verification data of weather forecast and current described data of weather forecast are complementary.
Alternatively, in the 3rd implementation of above-mentioned first aspect, obtain the verification data of weather forecast, comprising: the described verification data of weather forecast that receives user's input; Perhaps obtain described verification data of weather forecast from described default alternative data of weather forecast source.
Alternatively, in the 4th implementation of above-mentioned first aspect, determine that as before the data of weather forecast that offers the user, described method also comprises with the described data of weather forecast that gets access to after described current data of weather forecast source gets access to data of weather forecast:
Judge and determine at least one data of weather forecast source in the described default alternative data of weather forecast source, the number in data of weather forecast source that data of weather forecast that the data of weather forecast that provides and described current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and described current data of weather forecast source is not complementary.
Alternatively, in the 5th implementation of above-mentioned first aspect, obtained after the data of weather forecast by described available data of weather forecast source, described method also comprises:
Described data of weather forecast is converted to supports the form of resolving.
Alternatively, in the 6th implementation of above-mentioned first aspect, the form of described data of weather forecast comprises JSON (JavaScript Object Notation, java scripting object form) form or XML (extensible markup language, extend markup language) form.
Second aspect, the embodiment of the invention provide a kind of deriving means of data of weather forecast, comprising:
Request module is used for to current data of weather forecast source acquisition request data of weather forecast;
Acquisition module is used for when the described request module successfully gets access to data of weather forecast from described current data of weather forecast source, with the described data of weather forecast that gets access to as the data of weather forecast that offers the user;
Handover module, be used for when the described request module does not successfully get access to data of weather forecast from described current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by described available data of weather forecast source.
Alternatively, in the first implementation of above-mentioned second aspect, the described request module comprises:
Detecting unit is used for to described current data of weather forecast source acquisition request data of weather forecast, and detects when request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet;
The first determining unit, be used for obtaining when request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet when detecting unit detects, definitely do not get access to data of weather forecast from described current data of weather forecast source;
The second determining unit is used for obtaining when request number of times does not reach preset times and namely gets access to data of weather forecast from described current data of weather forecast source when detecting unit detects, and definitely gets access to data of weather forecast from described current data of weather forecast source.
Alternatively, in the second implementation of above-mentioned second aspect, the described request module also comprises:
Matching unit, be used for determining after described current data of weather forecast source gets access to data of weather forecast in described the second determining unit, described acquisition module with the described data of weather forecast that gets access to as before the data of weather forecast that offers the user, obtain the verification data of weather forecast, judgement also determines that described verification data of weather forecast and current described data of weather forecast are complementary.
Alternatively, in the 3rd implementation of above-mentioned second aspect, described matching unit, the concrete described verification data of weather forecast that is used for receiving user's input; Perhaps obtain described verification data of weather forecast from described default alternative data of weather forecast source.
Alternatively, in the 4th implementation of above-mentioned second aspect, described matching unit, also be used for determining after described current data of weather forecast source gets access to data of weather forecast in described the second determining unit, described acquisition module with the described data of weather forecast that gets access to as before the data of weather forecast that offers the user, judge and determine at least one data of weather forecast source in the described default alternative data of weather forecast source, the number in the data of weather forecast source that the data of weather forecast that the data of weather forecast that provides and described current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and described current data of weather forecast source is not complementary.
Alternatively, in the 5th implementation of above-mentioned second aspect, described device also comprises parsing module;
Described parsing module is used for after obtaining data of weather forecast by described available data of weather forecast source, described alternative data of weather forecast is converted to can supports the form of resolving.
Alternatively, in the 6th implementation of above-mentioned second aspect, the form of described data of weather forecast comprises JSON form or XML form.
The third aspect, the embodiment of the invention provide a kind of portable terminal, are provided with the as above processing unit of arbitrary described data of weather forecast on the described portable terminal.
The processing method of the data of weather forecast that the embodiment of the invention provides and device, portable terminal are by to current data of weather forecast source acquisition request data of weather forecast; When successfully getting access to data of weather forecast from current data of weather forecast source, with the data of weather forecast that gets access to as the data of weather forecast that offers the user; When successfully not getting access to data of weather forecast from current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by available data of weather forecast source.Adopt the technical scheme of the embodiment of the invention, when current data-source device breaks down can't successfully obtain data of weather forecast from it the time, can switch to available data of weather forecast source and provide data of weather forecast for the user, the weather application that guarantees the user can get access to data of weather forecast, improves the reliability of weather application.
Further, in the technical scheme of the embodiment of the invention, after getting access to data of weather forecast, the data of weather forecast that gets access to as before the data of weather forecast that offers the user, can also be obtained the verification data of weather forecast; When judgement and definite verification data of weather forecast and current weather forecast data are complementary, definite current data of weather forecast source can be used again, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability of weather application.
Further, in the technical scheme of the embodiment of the invention, after getting access to data of weather forecast, with the data of weather forecast that gets access to as before the data of weather forecast that offers the user, can also be by at least one the data of weather forecast source in the alternative data of weather forecast source of judging and determining to preset, the number in the data of weather forecast source that the data of weather forecast that the data of weather forecast that provides and current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and current data of weather forecast source is not complementary, definite current data of weather forecast source can be used again, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability that improves weather application.
Further, in the technical scheme of the embodiment of the invention, after determining to obtain data of weather forecast by available data of weather forecast source, data of weather forecast is converted to supports the form of resolving, can change the form of data of weather forecast, produce with the error code of avoiding format error, further improved the reliability that data of weather forecast obtains, strengthened the availability of weather application.
Other features and advantages of the present invention will be set forth in the following description, and, partly from specification, become apparent, perhaps understand by implementing the present invention.Purpose of the present invention and other advantages can realize and obtain by specifically noted structure in the specification of writing, claims and accompanying drawing.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Description of drawings
Accompanying drawing is used to provide a further understanding of the present invention, and consists of the part of specification, is used for together with embodiments of the present invention explaining the present invention, is not construed as limiting the invention.In the accompanying drawings:
The flow chart of the processing method of the data of weather forecast that Fig. 1 provides for the embodiment of the invention one;
The flow chart of the processing method of the data of weather forecast that Fig. 2 provides for the embodiment of the invention two;
The flow chart of the processing method of the data of weather forecast that Fig. 3 provides for the embodiment of the invention three;
The structural representation of the processing unit of the data of weather forecast that Fig. 4 provides for the embodiment of the invention four;
The structural representation of the processing unit of the data of weather forecast that Fig. 5 provides for the embodiment of the invention five.
Embodiment
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for description and interpretation the present invention, is not intended to limit the present invention.
Embodiment one
The flow chart of the processing method of the data of weather forecast that Fig. 1 provides for the embodiment of the invention one.As shown in Figure 1, the processing method of the data of weather forecast of present embodiment specifically can may further comprise the steps:
Step 100: to current data of weather forecast source acquisition request data of weather forecast;
Step 101: judge whether successfully to get access to data of weather forecast from current data of weather forecast source, when successfully getting access to data of weather forecast from current data of weather forecast source, execution in step 102; Otherwise when successfully not getting access to data of weather forecast from current data of weather forecast source, execution in step 103;
Step 102: with the data of weather forecast that gets access to as the data of weather forecast that offers the user;
Step 103: obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by available data of weather forecast source.
The executive agent of present embodiment is the processing unit of data of weather forecast, and for example the data processing equipment of this weather forecast specifically can be realized by a certain weather application.
The processing method of the data of weather forecast that present embodiment provides is by to current data of weather forecast source acquisition request data of weather forecast; When successfully getting access to data of weather forecast from current data of weather forecast source, with the data of weather forecast that gets access to as the data of weather forecast that offers the user; When successfully not getting access to data of weather forecast from current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by available data of weather forecast source.Adopt the technical scheme of present embodiment, when current data-source device breaks down can't successfully obtain data of weather forecast from it the time, can switch to available data of weather forecast source and provide data of weather forecast for the user, the weather application that guarantees the user can get access to data of weather forecast, improves the reliability of weather application.
Further alternatively, on the basis of the technical scheme of the described embodiment of above-mentioned Fig. 1, step 100 " to current data of weather forecast source acquisition request data of weather forecast " wherein, specifically can be in the following way:
Step (1): to current data of weather forecast source acquisition request data of weather forecast;
Step (2): detect when request number of times reaches preset times and do not get access to data of weather forecast from current data of weather forecast source yet; When request number of times reaches preset times and does not get access to data of weather forecast from current data of weather forecast source yet, execution in step (3), otherwise when request number of times does not reach preset times and namely gets access to data of weather forecast from current data of weather forecast source, execution in step (4);
Step (3): determine not get access to data of weather forecast from current data of weather forecast source;
Step (4): determine to get access to data of weather forecast from current data of weather forecast source.
In this embodiment technical scheme, as long as can get access to data of weather forecast from the data of weather forecast source, just determine to get access to data of weather forecast from current data of weather forecast source, but sometimes, namely allow to get access to data of weather forecast from current weather forecast data source, these data of weather forecast may also be extremely inaccurate, in order further to improve the reliability of data of weather forecast, can also " determine to get access to data of weather forecast from current data of weather forecast source " afterwards in step (4), the step 102 of above-described embodiment " with the data of weather forecast that gets access to as the data of weather forecast that offers the user " before, the data of weather forecast that obtains from current weather forecast data source is simply verified, to improve the reliability of data of weather forecast.Specifically can adopt following dual mode:
First kind of way comprises the steps:
Step (a): get access to after the data of weather forecast, obtain again the verification data of weather forecast;
Step (b): judge whether verification data of weather forecast and current weather forecast data are complementary, when determining coupling; Execution in step (c); Otherwise execution in step (d);
Step (c): determining can be with the data of weather forecast that gets access to as the data of weather forecast that offers the user;
Step (d): determining cannot be with the data of weather forecast that gets access to as the data of weather forecast that offers the user.
Obtaining the verification data of weather forecast and specifically can comprise in the step (a) wherein: the verification data of weather forecast that receives user's input; Perhaps obtain the verification data of weather forecast from default alternative data of weather forecast source.Alternative data of weather forecast source that wherein should be default can be for thinking comparatively accurately data of weather forecast source of data of weather forecast through long-time statistical.
Verification data of weather forecast source thinks that for the user relatively approaching really is the data of weather forecast of weather, can comprise basic state of weather such as the verification data of weather forecast: basic state of weather such as cloudy day or light rain or moderate rain or thunder shower or rain and snow mixed or severe snow etc., these basic state of weather can be drawn according to the true state of weather judgement on the same day by the user, and these basic state of weather can be according to weather conditions by getting well to bad according to class letter.Whether the verification data of weather forecast can also comprise every suitable parameter, the suitable carwash as whether, suitable motion etc.; And wear the clothes suggestion index or pollution situation etc., these also can the user according to the true state of weather on the same day general judge draw.And input to the data of weather forecast processing unit by human-machine interface module.Perhaps the user can obtain from default alternative data of weather forecast source, and reacts comparatively truly the data of weather forecast source of state of weather on the same day as the verification data of weather forecast through user's subjective judgement.
In above-described embodiment, the concrete condition that verification data of weather forecast and current weather forecast data are complementary is as follows: for the data value in the data of weather forecast, such as temperature value, perhaps wind-force sizes values etc., data value in the verification data of weather forecast is (such as temperature value, perhaps wind-force sizes values) during less than the first predetermined threshold value, can think that both are complementary with the difference of the correlation of current weather forecast data.The first predetermined threshold value can obtain according to practical experience.For for the every matters parameter in the data of weather forecast, the suitable carwash as whether, whether suitable motion etc., only have when the Appropriate of verification data of weather forecast identical with the Appropriate of current weather forecast data, can think that just both are complementary, otherwise think that both are not complementary.For wear the clothes suggestion index parameter or the pollution situation index parameter etc. in the data of weather forecast, can according to actual conditions be set to wear the clothes thick by being thinned to, pollute by light to heavily being divided into several grades, when the difference of the index of correlation parameter of the index parameter in the verification data of weather forecast (as wear the clothes suggestion index parameter or pollution situation index parameter) and current weather forecast data during less than the second predetermined threshold value, can think that both are complementary.The second predetermined threshold value can obtain according to practical experience, and for example the second predetermined threshold value can be 2.
When comprising a parameter in verification data of weather forecast and the current weather forecast data, when this parameter in the verification data of weather forecast and this parameter in the current weather forecast data are complementary, can think that verification data of weather forecast and current weather forecast data are complementary.When comprising a plurality of parameter in verification data of weather forecast and the current weather forecast data, when the number of the parameter that is complementary accounts for the certain proportion of number of parameters altogether, can think that verification data of weather forecast and current weather forecast data are complementary.
Adopt the technical scheme of above-described embodiment, by judging whether verification data of weather forecast and current weather forecast data are complementary, and determine that in when coupling current data of weather forecast source can use, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability that improves weather application.
The second way comprises the steps:
Step (A): get access to after the data of weather forecast, determine from default alternative data of weather forecast source that again at least one can provide the data of weather forecast source of data of weather forecast;
Wherein each data of weather forecast source provides a data of weather forecast, and at least one data of weather forecast source provides at least one data of weather forecast.Wherein default alternative data of weather forecast source can be for a plurality of.
Step (B): according to current data of weather forecast and at least one data of weather forecast, the number in the data of weather forecast source that the data of weather forecast that determining at least one data of weather forecast source provides with current data of weather forecast source is complementary (being the number that is complementary with current data of weather forecast at least one data of weather forecast) is N, and the number of the data of weather forecast that the data of weather forecast that provides with current data of weather forecast source at least one data of weather forecast source is not complementary (being the number that is not complementary with current data of weather forecast at least one data of weather forecast) is M.
Step (C): whether judge N greater than M, when determine greater than the time; Execution in step (D); Otherwise execution in step (E);
Step (D): determining can be with the data of weather forecast that gets access to as the data of weather forecast that offers the user;
Step (E): determining cannot be with the data of weather forecast that gets access to as the data of weather forecast that offers the user.
And also can adopt above-mentioned arbitrary mode to determine whether default alternative data of weather forecast source is available for default alternative data of weather forecast source.
Adopt the technical scheme of above-described embodiment, availability and the accuracy of data of weather forecast also can have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability that improves weather application.
Further alternatively, on the basis of the technical scheme of the described embodiment of above-mentioned Fig. 1, wherein step 103 " is obtained data of weather forecast by available data of weather forecast source " and afterwards, can also be comprised: data of weather forecast is converted to can supports the form of resolving.Then with the data of weather forecast behind the format transformation as the data of weather forecast that offers the user.
A kind of data of weather forecast form of acquiescence for example can be set in use, and when adopting acquiescence data of weather forecast form, the processing unit of data of weather forecast can this data format of Direct Recognition, and the terminal that offers the user shows.And in the time can't successfully getting access to data of weather forecast from the data of weather forecast source of acquiescence, when switching to other available data of weather forecast sources alternative data of weather forecast being provided, can with the form of format conversion for supporting to resolve of alternative data of weather forecast, for example specifically can adopt adapter to carry out the conversion of data format.
Need to prove that the form of the data of weather forecast of above-described embodiment can comprise JSON form or XML form.
Adopt the technical scheme of above-described embodiment, can change the form of data of weather forecast, produce with the error code of avoiding format error, further improved the reliability that data of weather forecast obtains, strengthened the availability of weather application.
Embodiment two
The flow chart of the processing method of the data of weather forecast that Fig. 2 provides for the embodiment of the invention two.The processing method of the data of weather forecast of present embodiment is described the detailed technology scheme of an optional embodiment of the present invention on the basis of above-described embodiment.As shown in Figure 2, the processing method of the data of weather forecast of present embodiment specifically can may further comprise the steps:
Step 200: to current data of weather forecast source acquisition request data of weather forecast;
Step 201: judge whether successfully to get access to data of weather forecast from current data of weather forecast source, when successfully getting access to data of weather forecast from current data of weather forecast source, execution in step 202; Otherwise when successfully not getting access to data of weather forecast from current data of weather forecast source, execution in step 203;
Step 202: receive the user by the verification data of weather forecast of human-machine interface module input, execution in step 204;
Step 203: with request number of times cumulative 1; Execution in step 205;
The initial value of request number of times is 0.
Step 204: judge whether verification data of weather forecast and current weather forecast data are complementary, when determining coupling; Execution in step 206; Otherwise execution in step 207;
Concrete determination methods can with reference to the associated description of above-described embodiment, not repeat them here.
Step 205: judge whether request number of times reaches preset times, when request number of times reaches preset times, execution in step 207; Otherwise when request number of times does not reach preset times, execution in step 200;
Step 206: with the data of weather forecast that gets access to as the data of weather forecast that offers the user; Finish.
Step 207: obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast, execution in step 208 from available data of weather forecast source;
The data of weather forecast that is wherein obtained by available data of weather forecast source also must be complementary with the verification data of weather forecast, also can adopt in detail the implementation procedure of above-mentioned steps 200-206.
Step 208: adopt adapter that alternative data of weather forecast is converted to and to support the form of resolving, execution in step 209;
Step 209: the alternative data of weather forecast behind the format transformation as the data of weather forecast that will use, is finished.
The processing method of the data of weather forecast that present embodiment provides, by adopting the technical scheme of above-described embodiment, can realize in the time can't obtaining data of weather forecast from current data-source device, can switch to available data of weather forecast source and provide data of weather forecast for weather application, guarantee that weather application can get access to data of weather forecast, improve the reliability of weather application.And can be by obtaining the verification data of weather forecast; When judgement and definite verification data of weather forecast and current weather forecast data are complementary, definite current data of weather forecast source can be used again, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability of weather application.And by after switching to available data of weather forecast source, obtain alternative data of weather forecast from available data of weather forecast source; And alternative data of weather forecast is converted to supports the form of resolving, can change the form of data of weather forecast, produce with the error code of avoiding format error, further improved the reliability that data of weather forecast obtains, strengthened the availability of weather application.
Embodiment three
The flow chart of the processing method of the data of weather forecast that Fig. 3 provides for the embodiment of the invention three.The processing method of the data of weather forecast of present embodiment is described the detailed technology scheme of an optional embodiment of the present invention on the basis of above-described embodiment.As shown in Figure 3, the processing method of the data of weather forecast of present embodiment specifically can may further comprise the steps:
Step 300: to current data of weather forecast source acquisition request data of weather forecast;
Step 301: judge whether successfully to get access to data of weather forecast from current data of weather forecast source, when successfully getting access to data of weather forecast from current data of weather forecast source, execution in step 302; Otherwise when successfully not getting access to data of weather forecast from current data of weather forecast source, execution in step 303;
Step 302: determine that from default alternative data of weather forecast source at least one can provide the data of weather forecast source of data of weather forecast, execution in step 304;
Wherein each data of weather forecast source provides a data of weather forecast, and at least one data of weather forecast source provides at least one data of weather forecast.Wherein default alternative data of weather forecast source can be for a plurality of.
Step 303: with request number of times cumulative 1; Execution in step 305;
The initial value of request number of times is 0.
Step 304: according to current data of weather forecast and at least one data of weather forecast, the number of determining at least one data of weather forecast the data of weather forecast source that is complementary with current data of weather forecast is N, and the number of the data of weather forecast that is not complementary with current data of weather forecast at least one data of weather forecast is M; Execution in step 306;
Step 305: judge whether request number of times reaches preset times, when request number of times reaches preset times, execution in step 308; Otherwise when request number of times does not reach preset times, execution in step 300;
Step 306: whether judge N greater than M, when determine greater than the time; Execution in step 307; Otherwise execution in step 308;
Step 307: with the data of weather forecast that gets access to as the data of weather forecast that offers the user; Finish.
Step 308: obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast, execution in step 309 from available data of weather forecast source;
The data of weather forecast that is wherein obtained by available data of weather forecast source also must be complementary with the verification data of weather forecast, also can adopt in detail the implementation procedure of above-mentioned steps 300-307.
Step 309: adopt adapter that alternative data of weather forecast is converted to and to support the form of resolving, execution in step 310;
Step 310: the alternative data of weather forecast behind the format transformation as the data of weather forecast that will use, is finished.
The processing method of the data of weather forecast that present embodiment provides, by adopting technique scheme can realize breaking down to access the time when current data-source device, can switch to available data of weather forecast source and provide data of weather forecast for weather application, guarantee that weather application can get access to data of weather forecast, improve the reliability of weather application.And can be by judging and determining at least one data of weather forecast source, the number in the data of weather forecast source that the data of weather forecast that the data of weather forecast that provides and current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and current data of weather forecast source is not complementary, definite current data of weather forecast source can be used again, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability that improves weather application.And by after switching to available data of weather forecast source, obtain alternative data of weather forecast from available data of weather forecast source; And alternative data of weather forecast is converted to supports the form of resolving, can change the form of data of weather forecast, produce with the error code of avoiding format error, further improved the reliability that data of weather forecast obtains, strengthened the availability of weather application.
Embodiment four
The structural representation of the processing unit of the data of weather forecast that Fig. 4 provides for the embodiment of the invention four.As shown in Figure 4, the processing unit of the data of weather forecast of present embodiment specifically can comprise: request module 10, acquisition module 11 and handover module 12.
Wherein, request module 10 is used for to current data of weather forecast source acquisition request data of weather forecast; Acquisition module 11 is connected with request module 10, and acquisition module 11 is used for when request module 10 successfully gets access to data of weather forecast from current data of weather forecast source, with the data of weather forecast that gets access to as the data of weather forecast that offers the user; Handover module 12 is connected with request module 10, handover module 12 is used for when request module 10 does not successfully get access to data of weather forecast from current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by available data of weather forecast source.
The processing unit of the data of weather forecast of present embodiment realizes that by adopting above-mentioned module the processing of data of weather forecast is identical with the realization mechanism of above-mentioned correlation technique embodiment, can with reference to the record of above-mentioned correlation technique embodiment, not repeat them here in detail.
The processing unit of the data of weather forecast of present embodiment can be realized to current data of weather forecast source acquisition request data of weather forecast by adopting above-mentioned module; When successfully getting access to data of weather forecast from current data of weather forecast source, with the data of weather forecast that gets access to as the data of weather forecast that offers the user; When successfully not getting access to data of weather forecast from current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by available data of weather forecast source.Adopt the technical scheme of present embodiment, when current data-source device breaks down can't successfully obtain data of weather forecast from it the time, can switch to available data of weather forecast source and provide data of weather forecast for the user, the weather application that guarantees the user can get access to data of weather forecast, improves the reliability of weather application.
Embodiment five
The structural representation of the processing unit of the data of weather forecast that Fig. 5 provides for the embodiment of the invention five.As shown in Figure 5, the processing unit of the data of weather forecast of present embodiment further can also comprise following technical scheme on above-mentioned basis embodiment illustrated in fig. 4.
Request module 10 in the processing unit of the data of weather forecast of present embodiment comprises: detecting unit 101, the first determining unit 102 and the second determining unit 103.
Detecting unit 101 is used for to current data of weather forecast source acquisition request data of weather forecast, and detects when request number of times reaches preset times and do not get access to data of weather forecast from current data of weather forecast source yet; The first determining unit 102 is connected with detecting unit 101, be used for obtaining when request number of times reaches preset times and do not get access to data of weather forecast from current data of weather forecast source yet when detecting unit 101 detects, definitely do not get access to data of weather forecast from current data of weather forecast source; The second determining unit 103 also is connected with detecting unit 101, be used for obtaining when request number of times does not reach preset times and namely gets access to data of weather forecast from current data of weather forecast source when detecting unit 101 detects, definitely get access to data of weather forecast from current data of weather forecast source.
This moment particularly, acquisition module 11 is connected with the second determining unit 103, be used for when the second determining unit 103 is definite when getting access to data of weather forecast from current data of weather forecast source, with the data of weather forecast that gets access to as the data of weather forecast that offers the user.Handover module 12 is connected with the first determining unit 102, is used for determining not get access to data of weather forecast from current data of weather forecast source when the first determining unit 102; The time, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by available data of weather forecast source.
Further alternatively, also comprise in the request module 10 in the processing unit of the data of weather forecast of present embodiment: matching unit 104.This matching unit 104 is connected with the second determining unit 103, be used for determining after current data of weather forecast source gets access to data of weather forecast in the second determining unit 103, acquisition module 11 with the data of weather forecast that gets access to as before the data of weather forecast that offers the user, obtain the verification data of weather forecast, judgement and definite verification data of weather forecast and current weather forecast data are complementary.
Further alternatively, the 104 concrete verification data of weather forecast that are used for receiving user's input of the matching unit in the processing unit of the data of weather forecast of present embodiment; Perhaps obtain described verification data of weather forecast from default alternative data of weather forecast source.
Further alternatively, matching unit 104 in the processing unit of the data of weather forecast of present embodiment also is used for determining after current data of weather forecast source gets access to data of weather forecast in the second determining unit 103, acquisition module 11 with the data of weather forecast that gets access to as before the data of weather forecast that offers the user, in at least one data of weather forecast source in the alternative data of weather forecast source of judging and determining to preset, the number in the data of weather forecast source that the data of weather forecast that the data of weather forecast that provides and current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and current data of weather forecast source is not complementary.
Further alternatively, also comprise parsing module 13 in the processing unit of the data of weather forecast of present embodiment.Parsing module 13 is connected with handover module 12, be used for after handover module 12 is determined to obtain data of weather forecast by available data of weather forecast source, alternative data of weather forecast is converted to can supports the form of resolving, this data of weather forecast that can support the form of resolving is namely as the data of weather forecast that offers the user.
Further alternatively, the form of data of weather forecast can comprise JSON form or XML form in the processing unit of the data of weather forecast of present embodiment.
The processing unit of the data of weather forecast of present embodiment realizes that by adopting above-mentioned module the processing of data of weather forecast is identical with the realization mechanism of above-mentioned correlation technique embodiment, can with reference to the record of above-mentioned correlation technique embodiment, not repeat them here in detail.
In the processing unit of the data of weather forecast of present embodiment, above-mentioned all optional technical schemes can adopt combinable mode combination in any to form optional embodiment of the present invention, give unnecessary details no longer one by one at this.
The processing unit of the data of weather forecast that present embodiment provides, by adopting above-mentioned module can realize in the time can't obtaining data of weather forecast from current data-source device, can switch to available data of weather forecast source and provide data of weather forecast for weather application, guarantee that weather application can get access to data of weather forecast, improve the reliability of weather application.And by adopting the above-mentioned module can be by obtaining the verification data of weather forecast; When detection and definite verification data of weather forecast and current weather forecast data are complementary, definite current data of weather forecast source can be used again, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability of weather application.Further, can also and determine at least one data of weather forecast source by detection by adopting above-mentioned module, the number in the data of weather forecast source that the data of weather forecast that the data of weather forecast that provides and current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and current data of weather forecast source is not complementary, definite current data of weather forecast source can be used again, availability and the accuracy of data of weather forecast have further been strengthened, can guarantee effectively that weather application can get access to comparatively accurately data of weather forecast, further strengthen the reliability that improves weather application.And by adopting above-mentioned module after switching to available data of weather forecast source, obtain alternative data of weather forecast from available data of weather forecast source; And alternative data of weather forecast is converted to supports the form of resolving, can change the form of data of weather forecast, produce with the error code of avoiding format error, further improved the reliability that data of weather forecast obtains, strengthened the availability of weather application.
The embodiment of the invention can also provide a kind of portable terminal.Can be provided with on the portable terminal of present embodiment as above is the processing unit of embodiment four or five described data of weather forecast, in detail can be with reference to above-mentioned Fig. 4 or record embodiment illustrated in fig. 5, and the correlation technique that can adopt the described embodiment of above-mentioned Fig. 1-Fig. 3 is realized the application of the processing unit of this data of weather forecast, can with reference to the record of above-mentioned related embodiment, not repeat them here in detail.
Those skilled in the art should understand that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware implementation example, complete implement software example or in conjunction with the form of the embodiment of software and hardware aspect.And the present invention can adopt the form of the computer program of implementing in one or more computer-usable storage medium (including but not limited to magnetic disc store and optical memory etc.) that wherein include computer usable program code.
The present invention is that reference is described according to flow chart and/or the block diagram of method, equipment (system) and the computer program of the embodiment of the invention.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or the block diagram and/or square frame and flow chart and/or the block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device producing a machine, so that the instruction of carrying out by the processor of computer or other programmable data processing device produces the device of the function that is used for being implemented in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, so that the instruction that is stored in this computer-readable memory produces the manufacture that comprises command device, this command device is implemented in the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
These computer program instructions also can be loaded on computer or other programmable data processing device, so that carry out the sequence of operations step producing computer implemented processing at computer or other programmable devices, thereby be provided for being implemented in the step of the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame in the instruction that computer or other programmable devices are carried out.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (15)

1. the processing method of a data of weather forecast is characterized in that, may further comprise the steps:
To current data of weather forecast source acquisition request data of weather forecast;
When successfully getting access to data of weather forecast from described current data of weather forecast source, with the described data of weather forecast that gets access to as the data of weather forecast that offers the user;
When successfully not getting access to data of weather forecast from described current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by described available data of weather forecast source.
2. the method for claim 1 is characterized in that, to current data of weather forecast source acquisition request data of weather forecast, in the following way:
To current data of weather forecast source acquisition request data of weather forecast, and detect when request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet;
When request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet, determine not get access to data of weather forecast from described current data of weather forecast source;
When request number of times does not reach preset times and namely gets access to data of weather forecast from described current data of weather forecast source, determine to get access to data of weather forecast from described current data of weather forecast source.
3. method as claimed in claim 2, it is characterized in that, determine that as before the data of weather forecast that offers the user, described method also comprises with the described data of weather forecast that gets access to after described current data of weather forecast source gets access to data of weather forecast:
Obtain the verification data of weather forecast;
Judgement also determines that described verification data of weather forecast and current described data of weather forecast are complementary.
4. method as claimed in claim 3 is characterized in that, obtains the verification data of weather forecast, comprising:
Receive the described verification data of weather forecast of user's input; Perhaps
Obtain described verification data of weather forecast from described default alternative data of weather forecast source.
5. method as claimed in claim 2, it is characterized in that, determine that as before the data of weather forecast that offers the user, described method also comprises with the described data of weather forecast that gets access to after described current data of weather forecast source gets access to data of weather forecast:
Judge and determine at least one data of weather forecast source in the described default alternative data of weather forecast source, the number in data of weather forecast source that data of weather forecast that the data of weather forecast that provides and described current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and described current data of weather forecast source is not complementary.
6. such as the arbitrary described method of claim 1-5, it is characterized in that obtained after the data of weather forecast by described available data of weather forecast source, described method also comprises:
Described data of weather forecast is converted to supports the form of resolving.
7. such as the arbitrary described method of claim 1-5, it is characterized in that the form of described data of weather forecast comprises JSON form or XML form.
8. the processing unit of a data of weather forecast is characterized in that, comprising:
Request module is used for to current data of weather forecast source acquisition request data of weather forecast;
Acquisition module is used for when the described request module successfully gets access to data of weather forecast from described current data of weather forecast source, with the described data of weather forecast that gets access to as the data of weather forecast that offers the user;
Handover module, be used for when the described request module does not successfully get access to data of weather forecast from described current data of weather forecast source, obtain at least one the available data of weather forecast source in the default alternative data of weather forecast source, and obtain data of weather forecast as the data of weather forecast that offers the user by described available data of weather forecast source.
9. device as claimed in claim 8 is characterized in that, the described request module comprises:
Detecting unit is used for to described current data of weather forecast source acquisition request data of weather forecast, and detects when request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet;
The first determining unit, be used for obtaining when request number of times reaches preset times and do not get access to data of weather forecast from described current data of weather forecast source yet when detecting unit detects, definitely do not get access to data of weather forecast from described current data of weather forecast source;
The second determining unit is used for obtaining when request number of times does not reach preset times and namely gets access to data of weather forecast from described current data of weather forecast source when detecting unit detects, and definitely gets access to data of weather forecast from described current data of weather forecast source.
10. device as claimed in claim 9 is characterized in that, the described request module also comprises:
Matching unit, be used for determining after described current data of weather forecast source gets access to data of weather forecast in described the second determining unit, described acquisition module with the described data of weather forecast that gets access to as before the data of weather forecast that offers the user, obtain the verification data of weather forecast, judgement also determines that described verification data of weather forecast and current described data of weather forecast are complementary.
11. device as claimed in claim 10 is characterized in that, described matching unit, the concrete described verification data of weather forecast that is used for receiving user's input; Perhaps obtain described verification data of weather forecast from described default alternative data of weather forecast source.
12. device as claimed in claim 9, it is characterized in that, described matching unit, also be used for determining after described current data of weather forecast source gets access to data of weather forecast in described the second determining unit, described acquisition module with the described data of weather forecast that gets access to as before the data of weather forecast that offers the user, judge and determine at least one data of weather forecast source in the described default alternative data of weather forecast source, the number in the data of weather forecast source that the data of weather forecast that the data of weather forecast that provides and described current data of weather forecast source provide is complementary, the number in the data of weather forecast source that the data of weather forecast that provides greater than the data of weather forecast that provides and described current data of weather forecast source is not complementary.
13. such as the arbitrary described device of claim 8-12, it is characterized in that described device also comprises parsing module;
Described parsing module is used for after obtaining data of weather forecast by described available data of weather forecast source, described alternative data of weather forecast is converted to can supports the form of resolving.
14., it is characterized in that the form of described data of weather forecast comprises JSON form or XML form such as the arbitrary described device of claim 8-12.
15. a portable terminal is characterized in that, is provided with the as above processing unit of the arbitrary described data of weather forecast of claim 8-14 on the described portable terminal.
CN201210505910.6A 2012-11-30 2012-11-30 Processing method and device and mobile terminal for weather forecast data Active CN102970651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210505910.6A CN102970651B (en) 2012-11-30 2012-11-30 Processing method and device and mobile terminal for weather forecast data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210505910.6A CN102970651B (en) 2012-11-30 2012-11-30 Processing method and device and mobile terminal for weather forecast data

Publications (2)

Publication Number Publication Date
CN102970651A true CN102970651A (en) 2013-03-13
CN102970651B CN102970651B (en) 2015-07-15

Family

ID=47800456

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210505910.6A Active CN102970651B (en) 2012-11-30 2012-11-30 Processing method and device and mobile terminal for weather forecast data

Country Status (1)

Country Link
CN (1) CN102970651B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268357A (en) * 2013-06-05 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for providing air quality data
CN104966200A (en) * 2014-07-29 2015-10-07 腾讯科技(深圳)有限公司 Method and apparatus for sending life product information based on meteorological indexes

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100559606B1 (en) * 2002-12-23 2006-03-10 엘지전자 주식회사 Method for processing the weather information of mobile phone
CN101093468A (en) * 2006-06-19 2007-12-26 上海新纳广告传媒有限公司 Method for automatic timed updating data of weather forecast at terminal
CN101340461A (en) * 2008-08-08 2009-01-07 凯立德欣技术(深圳)有限公司 Method for obtaining weather forecast information of designated region
CN102546767A (en) * 2011-12-22 2012-07-04 深圳市赛格导航科技股份有限公司 Cloud-based real-time map weather forecast system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100559606B1 (en) * 2002-12-23 2006-03-10 엘지전자 주식회사 Method for processing the weather information of mobile phone
CN101093468A (en) * 2006-06-19 2007-12-26 上海新纳广告传媒有限公司 Method for automatic timed updating data of weather forecast at terminal
CN101340461A (en) * 2008-08-08 2009-01-07 凯立德欣技术(深圳)有限公司 Method for obtaining weather forecast information of designated region
CN102546767A (en) * 2011-12-22 2012-07-04 深圳市赛格导航科技股份有限公司 Cloud-based real-time map weather forecast system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103268357A (en) * 2013-06-05 2013-08-28 百度在线网络技术(北京)有限公司 Method and device for providing air quality data
CN104966200A (en) * 2014-07-29 2015-10-07 腾讯科技(深圳)有限公司 Method and apparatus for sending life product information based on meteorological indexes

Also Published As

Publication number Publication date
CN102970651B (en) 2015-07-15

Similar Documents

Publication Publication Date Title
US9903727B2 (en) Method and navigation device for providing geo-fence services, and computer-readable medium storing program for executing the same
KR102161100B1 (en) Information Providing Method associated with Position And Electronic Device supporting the same
CN105740291B (en) Map interface display method and device
CN104536978A (en) Voice data identifying method and device
CN105740151B (en) A kind of mobile terminal UI controls check processing method and system
KR20150009996A (en) Method and device for displaying pushed information
CN104459032A (en) Automobile-based air monitoring method and automobile-based air monitoring device
CN104540220A (en) Intelligent terminal positioning method and system
CN106370194A (en) Method and apparatus for acquiring electric vehicle driving route, and electric vehicle
CN104572430A (en) Method, device and system for testing terminal application interface
CN107491286A (en) Pronunciation inputting method, device, mobile terminal and the storage medium of mobile terminal
CN105792158B (en) A kind of method and device of information transmission in cell
CN105526944B (en) Information cuing method and device
CN108932515A (en) It is a kind of to detect the method and apparatus for carrying out topological node position correction based on closed loop
CN103077110A (en) Test method and device
CN104077211A (en) Test method and test system for mobile terminal software
CN111862468A (en) Shared vehicle processing method, device, equipment and computer readable storage medium
CN106846881A (en) Shared method for vehicles, apparatus and system
CN105807302A (en) Intelligent terminal and GPS module control method and device thereof
CN109147371B (en) Driving route determining method and device and computer equipment
JP2018055638A (en) Determination device
CN102970651A (en) Processing method and device and mobile terminal for weather forecast data
CN103391362A (en) Application classifying method based on power consumption and mobile terminal
CN104184768A (en) Method of transmitting data of Internet of things, device and system
CN103823828A (en) Map scale setting method, map scale setting device and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100085 Beijing city Haidian District Qinghe Street No. 68 Huarun colorful city shopping center two floor 13

Applicant after: Xiaomi Technology Co., Ltd.

Address before: 100102, No. 50, block B, building No. 12, winding stone world building, Wangjing West Road, Beijing, Chaoyang District

Applicant before: Beijing Xiaomi Technology Co., Ltd.

C14 Grant of patent or utility model
GR01 Patent grant