Summary of the invention
The object of the present invention is to provide a kind of intelligent terminal localization method, solve prior art terminal positioning precision poor, can only single-endedly locate,
Object of the present invention is achieved by the following technical programs:
An intelligent terminal localization method, described intelligent terminal has embedded OS, can call each hardware module with api function, sets up data connect by gsm module, can send note, is provided with GPS and is connected fast gps satellite with A-GPS hardware module;
Intelligent terminal as one's own side comprises the other side's number input module, acquisition request location information module to be positioned, initiatively to side to be positioned, sends one's own side position information module, request feedback module; Described the other side's number input module Using API Function EditText creates an input frame to input side's to be positioned number, adds control associated with subscriber lists, makes one's own side user can select existing contact person; Described request is obtained location information module to be positioned, calls sendTextMessage function and with note form, sends discernible instruction to side to be positioned; Described active sends one's own side position information module to side to be positioned, first call gsm module and set up data connection, then call GPS module and A-GPS module, intrinsic call off-line map software kit, after GPS connects, obtain the latitude and longitude information being obtained by GPS location, then latitude and longitude information obtained to address information with mating in off-line map, and in text message mode from trend preset number transmission note, finally close gsm module data and connect, close GPS module and A-GPS module; Described request feedback module reads the discernible instruction of user's note, and by feedback result, i.e. the other side's positional information or shown by the information of addressee refuses;
As side's intelligent terminal to be positioned, comprise and show and to receive request module, show and receive that positional information module, selectivity accept Location Request module, blacklist module; Request module is received in described demonstration, reads the short message content that side's intelligent terminal to be positioned is received, detects discernible instruction, informs that user receives request, and sender number is informed to user with advice method; Positional information module is received in described demonstration, when having user initiatively to send positional information to side's intelligent terminal to be positioned, shows the positional information and the other user's telephone number that receive; Described selectivity is accepted Location Request module, selects one of following working method: 1) establishing this number is after this acquiescence receive status, 2) allow the once request of this number, 3) refuse the request of this number, 4) this number is made as to blacklist; Described blacklist module is a storage area of preserving telephone number, while receiving request, first number and blacklist database is matched, if the match is successful, any instruction of this number will directly be left in the basket, and user is optional shifts out blacklist by certain number;
As one's own side's intelligent terminal, comprise route display module as side's intelligent terminal to be positioned, described route display module is received the other side's longitude and latitude positional information, call off-line map, invoke user interface function directionsDisplay draws one's own side to the other side's path according to one's own side's longitude and latitude positional information and the other side's longitude and latitude positional information on electronic chart.
Object of the present invention can also further realize by following technical measures:
Aforementioned intelligent method of locating terminal, in 15 seconds, GPS connects unsuccessfully, in text message mode, to preset number, sends the positional information arriving according to architecture, notify the other side this time locating information be to be obtained by base station mode, and notify the other side positioning accuracy information.
Compared with prior art, the invention has the beneficial effects as follows: navigation system of the present invention is carried out exercises by software backstage, simplified the operation that user needs, save system resource, it is more convenient to use; Intelligent terminal of the present invention can, as positioning end, can, as the end that is positioned, than existing single end positioning method, have more versatility again; Between terminal, communication means, based on normal short message, is saved the operation cost of using.Break away from the dependence to browser in conventional method, for user has saved data traffic, strengthened the flying power of mobile device.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
Be illustrated in figure 1 intelligent terminal function interface figure, interface is mainly comprised of input frame, display box and the button that can realize difference in functionality.
The present invention to the requirement of terminal hardware configuration is:
1. embedded OS: as android, ios, windowsphone, windows ce etc.The api function of each hardware module of software transfer is provided, the environment of running software is provided.
2. display screen: show map and the short message that comprises desired location.
3. there is GSM network function: 1. by gsm module, set up data and connect, coordinate A-GPS module to realize and connect fast gps satellite; 2. in the situation that connecting less than gps satellite, according to operator base station, position and notify user positioning precision; 3. complete the function that sends note.
4. GP configuring S, A-GPS module: can communicate by letter with gps satellite and calculate user exact position, precision one in 5 meters.
5. button operation: this module makes user can send the discernible note of the design.
In the specific implementation, each module of this localization method can be completed by the button or the input and output frame that possess corresponding function.Intelligent terminal, when as one's own side, needs to set up as lower module (terminal system be take android as example, and off-line map be take Google Maps as example):
1. set up the other side's number input module.Utilize the api function EditText that intelligent terminal operating system provides to create an input frame in order to input side's to be positioned number; Add control associated with subscriber lists, make the optional existing contact person of user.
2. set up acquisition request the other side positional information module.This module is in fact an indirectly SMS transmission module, by sendTextMessage, to side to be positioned, with note form, send the discernible instruction of the design as QQDW (request location), thereby make the software on machine to be positioned can carry out a series of positioning actions, avoided the lasting UNICOM state of user mobile phone data traffic.
3. set up initiatively and send own position information module to the other side.After this module is triggered, a series of action is carried out on backstage.First open gsm module data connections (uses-permissionandroid:name=" android.permission.INTERNET " /), and then open GPS and A-GPS module (Settings.Secure.setLocationProviderEnabled (getContentResolver (), LocationManager.GPS_PROVIDER, true); ), follow intrinsic call off-line map software kit, after GPS connects, just start to obtain in software transfer mode the latitude and longitude information being navigated to by GPS, get after latitude and longitude information, recycling latitude and longitude information is mated and is obtained address information from off-line map, and from trend preset number, sends note in text message mode.If in 15 seconds, GPS connects unsuccessful (user is positioned in indoor or other situation) in this process, in text message mode, to preset number, send the positional information arriving according to architecture, and notify the other side this time locating information be to be obtained by base station mode, and positioning accuracy information.Finally close gsm module data and connect, GPS (Settings.Secure.setLocationProviderEnabled (getContentResolver (), LocationManager.GPS_PROVIDER, false)) and A-GPS.
4. set up request feedback module.This module will read discernible instruction in user's note (<uses-permissionandroid:name=" android.permission.READ_SMS "/>), and feedback result shows in software, i.e. the other side's positional information or unaccepted information.
During as side to be positioned, need to set up as lower module:
1. set up demonstration and receive request module.Read the short message content (<uses-permissionandroid:name=" android.permission.READ_SMS "/>) that user mobile phone is received, if discernible instruction detected, with advice method (NotificationManager), inform that user receives request, and sender number is informed to user with software advice method.
2. set up demonstration and receive positional information module.When having user initiatively to send positional information to this user, this module is responsible for directly carrying out the demonstration of positional information and above-mentioned subscriber directory number.
3. set up selectivity and accept Location Request module.This module gives user and selects the right whether accepting request.Divide particularly four kinds: 1) establishing this number is after this acquiescence receive status; 2) allow the once request of this number; 3) refuse the request of this number; 4) this number is made as to blacklist (utilizing case statement to process to realize to the different key message of importing into).
4. set up blacklist module.Blacklist module is a storage area (storage) of preserving telephone number.While receiving request, first number and blacklist database are matched, if the match is successful, any instruction of this number will directly be left in the basket, and user is optional shifts out blacklist by certain number.
As location side and Fang Junxu to be positioned, set up route display module:
This module utilize that mobile phone receives to location latitude and longitude information, after triggering this module, call off-line map software (<scriptcharset=" utf-8 " type=" text/javascript " sro=' http://ditu.google.cn/maps file=api & am p; V=2 & amp; Key=ABQIAAAA8isncdaDTmdPzP31-PpKtBRjq0E0d07Uti1UxHh75vPM kzVFhhTF63QjSTUWM9vWVd3bm0e2vIqGmg ' ></script>), utilize one's own side's locating information and the other side's azimuth information of getting is drawn one's own side to the other side's path (the user interface function directionsDisplay that utilizes Google Maps to provide) on electronic chart.
Fig. 2 is software workflow figure, as shown in the figure:
In step S2-1, one's own side inputs the telephone number of contact person's gsm module to be positioned.
In step S2-2, one's own side selects acquisition request the other side positional information, sends information process and is realized by this design itself.
In step S2-3, if both sides connect for the first time, software backstage is accepted list by the telephone number of receiving requesting party in acquiescence and is mated with blacklist, then carries out corresponding actions.If be acquiescence receive status, direct restoring to normal position information, if blacklist state, direct refusal.This step is by skips steps S2-4.
In step S2-4, it is to ask for the first time location that the other side detects this number, according to the different demands of actual conditions, selects 1. to establish this number after this for giving tacit consent to receive status; 2. allow the once request of this number; 3. the request of this number of refusal; 4. this number is made as to blacklist.
In step S2-5, the other side is according to user's selection, and decision is home position information, or refusal Location Request.
In step S2-6, one's own side selects initiatively to the other side, to send the positional information at own place.
In step S2-7, the other side receives one's own side's positional information that one's own side sends, and can further select according to different situations.
In step S2-8, the other side makes a choice and 1. only sees note address text message, or 2. select to spread out the map software, shows that the other side is to one's own side's path.
Fig. 3 is that modules of the present invention calls key diagram to terminal hardware, and the module that Enters Number is called numbering directory module; Acquisition request the other side's positional information module is called transmission SMS module; The positional information that sends one's own side to the other side is called GPS, A-GPS, off-line map and sends SMS module; Request feedback module calls terminal screen device context (Device Context) data structure and in specific region, shows information to complete; The option mod calling mobile phone memory module that whether accepts request, deposits the other side's number having made a choice in memory, when receiving request next time directly with in memory, have number and mate, then carry out corresponding operating; Receive and ask and receive that positional information module inquiry telephone book module is to complete numbers match.
The present invention proposes a kind of navigation system and method based on intelligent terminal.By software backstage, carry out exercises, identify as described above the instruction comprising in user's note, automatically open GPS and A-GPS module, automatically the latitude and longitude information getting according to GPS module is obtained position text message in electronic chart, located rear automatic transmission locating information, after having located, automatically close GPS and A-GPS module, electric map module etc.The mode on this backstage has been simplified the operation that user needs greatly, saves system resource, and use more convenient.
Software for Design proposed by the invention can be different from existing single end positioning method as the end that is positioned again as positioning end, has more versatility.
Hardware requirement of the present invention is low, is applicable to multiple occasion.As mobile phone, flat board, vehicle GPS, portable personal terminal etc.
Between software proposed by the invention, communication means is based on normal short message, and nowadays most of users have note set meal, and rate are cheap, has so just saved cost.And the function of design meets different occasion needs, as child's old man that goes out location, two people arrange a certain strange place and meet, mutual understanding between friend etc.
In addition to the implementation, the present invention can also have other execution modes, and all employings are equal to the technical scheme of replacement or equivalent transformation formation, all drop in the protection range of requirement of the present invention.