Summary of the invention
The object of the present invention is to provide a kind of method of acquiring weather forecast by mobile communication terminal, be intended to solve mobile communication terminal and obtain the problem of weather forecast by USSD.
The present invention is achieved in that a kind of method of acquiring weather forecast by mobile communication terminal, and described method comprises:
A, mobile communication terminal send USSD weather report request message to mobile operator server, in described USSD weather report request message, carry the target area code that user need to inquire about;
B, described mobile communication terminal receive the USSD weather forecast response message of described mobile operator server feedback, carry the weather forecast of described target area in described USSD weather forecast response message.
More specifically, wherein step a specifically comprises:
The target area that a1, described mobile communication terminal are selected from weather forecast query menu according to user, generates described USSD weather report request message, in described USSD weather report request message, carries the target area code that user need to inquire about;
The USSD of generation is sent to described mobile operator server by a2, described mobile communication terminal.
More specifically, described USSD weather report request message comprises the service code of mark weather forecast business, after mobile operator server receives USSD weather report request message, it is resolved, judge by the service code in this message whether this message is weather forecast query message, and, judge the target area of inquiry by target area code.
More specifically, wherein between step a and step b, also comprise:
Described mobile operator server receives described USSD weather report request message, inquires about its database, obtains the weather forecast of target area, and the weather forecast of described target area is fed back to described mobile communication terminal.
More specifically, specifically comprise:
Described mobile operator server receives described USSD weather report request message, inquire about its database, obtain the data of weather forecast of described target area, pre-the weather of described target area datagram is arrived to described mobile communication terminal by Release Complete message feedback.
More specifically, described Release Complete message comprises the character that identifies weather forecast.
More specifically, in described Release Complete message, carry described data of weather forecast by other optional information fields in described Release Complete message.
More specifically, wherein after step b, also comprise:
C, described mobile communication terminal are resolved the USSD weather forecast response message of described mobile operator server feedback, therefrom parse weather forecast, and described weather forecast is shown to user.
More specifically, described weather forecast be shown to user specifically comprise described in step c wherein:
Described weather forecast is shown to user by the user interface of described mobile communication terminal with menu mode.
More specifically, described mobile communication terminal is mobile phone.
The present invention overcomes the deficiencies in the prior art, the technical scheme providing is: mobile communication terminal sends USSD weather report request message to mobile operator, mobile operator feeds back USSD weather forecast response message, and mobile communication terminal parses weather forecast information from USSD weather forecast response message.Technical scheme provided by the invention is compared the mode of existing acquiring weather forecast by mobile communication terminal, realizes more simple and fast, and user can each regional weather forecast of real-time query, and does not need to expend flow.
Embodiment
Technical scheme provided by the invention is: mobile communication terminal sends USSD weather report request message to mobile operator, mobile operator feeds back USSD weather forecast response message, and mobile communication terminal parses weather forecast information from USSD weather forecast response message.
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
When specific implementation technical scheme provided by the invention, in the USSD weather report request message that mobile communication terminal generates, need to represent that this message is weather report request message by service code, this service code can be determined by mobile operator.In addition,, because the weather forecast of user's inquiry may relate to different regions, also need the coded representation query aim region by other.The form of weather report request message is as " * #SC*n characters# ", the wherein corresponding service code that represents weather report request of SC, the corresponding code that represents query aim region of n characters, can be determined according to certain rule by mobile operator, taking facilitate user to remember and use as principle, as postcode, area code etc.
The USSD weather report request message generating as, mobile communication terminal be " * #55*086021# ", and wherein, " 55 " for representing the service code of weather report request, " 086021 " represents that the target area of inquiring about is " Chinese Shanghai ".
Use for the convenience of the user, can in mobile communication terminal, set up " weather forecast query " menu, as shown in Figure 1.In the time that user need to inquire about the weather forecast in somewhere, choose this " weather forecast query " menu, in drop-down list corresponding to " country " option therein, choose the objective area " Shanghai " of choosing inquiry in drop-down list corresponding to the target country " China " of inquiry, " area " option therein, then confirm.
After user confirms, according to user, the selection result in this menu generates USSD weather report request message " * #55*086021# " to mobile communication terminal automatically, and this transmission of messages is arrived to mobile operator server.Mobile operator server receives USSD weather report request message " * #55*086021# " afterwards, it is resolved, judge that by the service code in this message " 55 " this message is weather forecast query message, the target area that judges inquiry by other service codes " 086021 " is " Chinese Shanghai ", mobile operator server is inquired about its database, obtains the weather forecast in Chinese Shanghai area.
When mobile operator server feeds back weather forecast response message to mobile communication terminal, can adopt Release Complete(to discharge) message, as the response to USSD weather report request.For making this response message be different from other USSD and being convenient to mobile communication terminal identifying processing, can add therein the character of some mark weather forecast, as * W*T, specifically can be consulted to determine by operator and terminal equipment manufacturer.The form of Weather information is exemplified as:
Shanghai,25℃,sunny,30%,west?2;
Demarcate city (Shanghai) with comma, temperature (25C DEG C), weather (sunny), humidity (30%), wind direction and wind-force (west 2).Certainly, also can, according to the ability of information that mobile operator server provides, add more Weather information, as air pressure, ultraviolet index etc.
According to 3GPP(3rd Generation Partnership Project, third generation partner program) agreement, Release Complete message is made up of 4 parts:
1, Protocol discriminator agreement difference;
2, Transaction identifier behavior identifier;
3, Message Type type of message, if this part is xx101010, is expressed as Release Complete message;
4, other optional information fields.
Other optional information fields wherein comprise Cause and Facility information element, in Facility, the word string of weather forecast directly can be added as ussd-string, are about to " * W*T Shanghai; 25 DEG C; sunny, 30%, west 2 " and mail to mobile communication terminal as message body.
Mobile communication terminal receives after Release Complete message, and message body is resolved, and if beginning in ussd-string is * W*T, what can confirm to return is that weather forecast " Shanghai, 25 DEG C, sunny, 30%, west 2 " is latitude and longitude coordinates.
Concerning domestic consumer, this content is very not directly perceived, the weather forecast of returning can be shown to user by more attractive in appearance and detailed mode, as shown in " weather forecast " menu of Fig. 2, and can add the picture that some represent weather, makes interface more friendly.
The flow chart of the embodiment of the present invention as shown in Figure 3, specifically comprises following step:
1, user starts the weather forecast query function of mobile communication terminal, selects to need the target area of inquiry;
2 mobile communication terminals generate USSD weather report request message according to user's selection;
3, the USSD weather report request message of generation is sent to mobile operator server by mobile communication terminal;
4, mobile operator server receives this USSD weather report request message, inquires about its database, obtains the weather forecast of target area;
5, mobile operator server arrives mobile communication terminal by the weather forecast of obtaining by Release Complete message feedback;
6, mobile communication terminal parses weather forecast from Release Complete message, shows by the user interface of mobile communication terminal.
The method advantage of obtaining weather forecast by USSD provided by the invention is more quick and easy, and without any need for GPRS data traffic, has saved user's communication cost.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.