Summary of the invention
The object of the present invention is to provide a kind of method and system of mobile terminal based on location, point-to-point position that realize, can obtain the positional information of mobile terminal B by the method mobile terminal A, also can obtain the positional information of mobile terminal A with time shift terminal B.
The embodiment of the present invention is achieved in that a kind of method of mobile terminal based on location, point-to-point position that realize, and comprising:
Step a: define Location Request between mobile terminal, reply control command;
Step b: the first mobile terminal sends Location Request to the second mobile terminal, the second mobile terminal, by resolving described Location Request, is determined Location Request type;
Step c: the second mobile terminal, according to Location Request type, calls after GPS module is obtained positional information information is fed back to the first mobile terminal, completes location, point-to-point position.
Wherein, before described step a, also comprise: the first mobile terminal sends location authorization requests to the second mobile terminal.
Wherein, described in step b, Location Request type comprises: single location, Kinematic Positioning or zone location.
Wherein, the command format of Location Request described in step b comprises, the knowledge of positioning command leader, and described positioning command leader knowledge is made up of character string.
Wherein, described in step b, Location Request command format also comprises: bag is returned in Location Request bag and/or location.
Wherein, described Location Request bag command format comprises: request serial number, request type and request additional data.
Wherein, described location return bag command format comprise: return to sequence number, return type and return to additional data.
The present invention also provides one to realize mobile terminal based on point-to-point location positioning system, comprise support short message service, and can support to obtain the first mobile terminal and second mobile terminal of self location information function, also comprise mutual control module, be used for realizing between the first mobile terminal and the second mobile terminal control command mutual, to obtain positional information.
Wherein, the first mobile terminal and the second mobile terminal that self location information function is obtained in described support comprise GPS module, for obtaining location information of mobile terminal.
The embodiment of the present invention compared with prior art, beneficial effect is: adopt the method for the invention, compared with prior art, the obtaining without by operator's platform of terminal room positional information, mobile terminal with GPS module and SMS business function all can be realized arbitrarily, has wide range of applications.
Embodiment
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.
One realizes mobile terminal based on point-to-point location positioning system, comprise support short message service, and can support to obtain the first mobile terminal and second mobile terminal of self location information function, also comprise mutual control module, be used for realizing between the first mobile terminal and the second mobile terminal control command mutual, to obtain positional information.
Wherein, the first mobile terminal and the second mobile terminal that self location information function is obtained in described support comprise GPS module, for obtaining location information of mobile terminal.
Mobile terminal of the present invention comprises the following steps based on point-to-point location positioning method:
The first step, determines service implementation method
Location Request between definition mobile terminal, reply and the control command of abnormality processing, adopting SMS is agreement supporting body, realizes between mobile terminal and mutually searching location, and position data is taken from the integrated GPS module of mobile terminal.
Second step, formulates control protocol between mobile terminal
The point-to-point position-based service business of wireless terminal agreement
Three kinds of application of the point-to-point position-based service business of this agreement support terminal, are respectively single location, Kinematic Positioning and zone location and for coordinating other required assistance application of such business, as authorized location.
Single location: refer to that certain terminal sends out Location Request to another terminal, the terminal that is positioned, obtains GPS position data by GPS module, feeds back to active request terminal.
Kinematic Positioning request: refer to that certain terminal sends out Location Request to another terminal, require to be positioned terminal at the appointed time in section by appointed interval, obtain GPS position data by GPS module, feed back to active request terminal.
Area positioning requests: refer to that certain terminal sends out Location Request to another terminal, the requirement terminal that is positioned at the appointed time detects Passive Positioning terminal by appointed interval in section and whether enters or leave appointed area, as change, obtain GPS position data by GPS module, feed back to active request terminal.
The point-to-point position-based service business of terminal control protocol form
Positioning command leader is known |
Location Request bag |
Bag is returned in location |
Positioning command leader is known: identifying this SMS is positioning command packet, may comprise Location Request bag or location and return to bag.
Location Request bag: the entity content that comprises Location Request order.
Bag is returned in location: comprise positioning result feedback packet entity content.
Three main bags by "; " number make specificator, Location Request bag, bag is returned in location can be optional.
Example:
Bag is returned in Location Request bag and location to be had simultaneously:
Positioning command leader is known; Location Request bag; Bag is returned in location;
Only have Location Request bag:
Positioning command leader is known; Location Request bag;
Only have location to return to bag:
Positioning command leader is known; ; Bag is returned in location;
Positioning command head sign format
Formed by character string, as: GPSSMS
Location Request packet format
Request serial number |
Request type |
Additional data |
Request serial number: by numeric type string representation, increase progressively, as: " 123 " representative digit 123.
Request type: represent request command type, represent (case-insensitive) by 26 English alphabets, be defined as follows:
Letter |
Represented meaning |
S |
Single location |
D |
Kinematic Positioning |
A |
Zone location |
E |
Stop Kinematic Positioning |
B |
Stop area location |
M |
Authorization requests |
Other |
Retain |
Additional data: according to request type difference, additional data difference, with reference to following table
No. ID: mark Kinematic Positioning or zone location, represent (case-insensitive) by 26 English alphabets, as: " A "
Initial time: represent the location time started, form hhmm, as: 0930 represents 09:30
End time: represent the location end time, form hhmm, as: 2230 represent 22:30
Positioning time interval: represent the bit interval time decided at the higher level but not officially announced time period, form mm as: 30 represent 30 minutes
Enter and leave mark: be expressed as into people region or leave region, " E " represents to enter, " X " represent to leave.
Region longitude and latitude represents
In request bag and additional data, field is distinguished and is adopted ", "
For example:
123,A,A,0930,2230,30,E,2233.1234,N,11433.1234,E,1233.1234,N,10133.1234,E
Packet format is returned in location
Return to sequence number |
Return type |
Additional data |
Return to sequence number: by numeric type string representation, be request serial number+1.
Return type: represent returning of request command type, represent (case-insensitive) by 26 English alphabets, be defined as follows:
Letter |
Represented meaning |
S |
Single location |
D |
Kinematic Positioning |
A |
Zone location |
E |
Stop Kinematic Positioning |
B |
Stop area location |
M |
Authorization requests |
Other |
Retain |
Additional data: according to request type difference, additional data difference, with reference to following table
Setup failed result, if ask unsuccessfully, to fill out " F "
Positional information represents
Whether achievement of Status mark location
In request bag and additional data, field is distinguished and is adopted ", "
For example:
123,A,A,0930,2230,E,2233.1234,N,11433.1234,E,1233.1234,N,10133.1234,E
Example:
Single Location Request:
Terminal A:
GPSSMS;001,S;
Terminal B setup failed is replied:
GPSSMS;;002,S,F;
Terminal B locates successfully and returns results:
GPSSMS;;002,S,113030,A,2233.1234,N,11433.1234,E;
Terminal B locates unsuccessfully and returns results:
GPSSMS;;002,S,113030,V,,,,;
Kinematic Positioning:
Terminal A:
GPSSMS;001,D,A,0930,1130,01;
Terminal B setup failed is replied:
GPSSMS;;002,D,A,F;
Terminal B locates successfully and returns results:
GPSSMS;;002,D,A,113030,A,2233.1234,N,11433.1234,E;
Terminal B locates unsuccessfully and returns results:
GPSSMS;;002,D,A,113030,V,,,,;
Zone location:
Terminal A:
GPSSMS;001,A,A,0930,1130,01,E,
2233.1234,N,11433.1234,E,1233.1234,N,10133.1234,E;
Terminal B setup failed is replied:
GPSSMS;;002,A,A,F;
Terminal B locates successfully and returns results:
GPSSMS;;002,A,A,113030,A,2233.1234,N,11433.1234,E;
Terminal B locates unsuccessfully and returns results:
GPSSMS;;002,A,A,113030,V,,,,;
Single Location Request and return data bag
GPSSMS;001,S;002,S,113030,A,2233.1234,N,11433.1234,E;
Fig. 1 is unidirectional single location, and certain terminal is obtained another terminal GPS positional information
(1) terminal A initiates location authorization requests to terminal B.
(2) terminal B checks terminal password that A sends out, and as responded the Location Request of follow-up terminal A, sends out confirmation response message to terminal A.
(3) terminal A is to terminal B bill time Location Request
(4) terminal B obtains GPS positional information, feeds back to terminal A
Fig. 2 is two-way single location, and two terminals are obtained the other side GPS positional information by the present invention simultaneously
(1) terminal A initiates location authorization requests to terminal B.
(2) terminal B confirms terminal password that A sends out, as responded the Location Request of follow-up terminal A, sends out confirmation response message to terminal A, locates authorization requests to terminal A initiation simultaneously.
(3) terminal A sends out Location Request to terminal B, sends out simultaneously and checks terminal password that B sends out, as coupling is also sent out license confirmation information to terminal B.
(4)~(5) are that two terminals are fed back GPS positional information to the other side respectively
The two-way Kinematic Positioning of Fig. 3, two terminals send to the other side by agreement interval by own GPS positional information by the present invention in designated time section, and flow process and two-way single location are basic identical.
The two-way zone location of Fig. 4
(1) terminal A initiates location authorization requests to terminal B.
(2) terminal B confirms terminal password that A sends out, as responded the Location Request of follow-up terminal A, sends out confirmation response message to terminal A, locates authorization requests to terminal A initiation simultaneously.
(3) terminal A initiated area Location Request, checks terminal licencing key that B sends out, and after confirmation, to terminal, B sends out confirmation, simultaneously initiated area Location Request.
(4) terminal B is to terminal A initiated area Location Request.
(5) terminal A is to terminal A feedback GPS positional information.
(6) terminal B is to terminal A feedback GPS positional information.
(7) terminal A sends out stop area Location Request, feeds back GPS positional information simultaneously.
(8) terminal B sends out stop area Location Request, feeds back GPS positional information simultaneously.
(9) terminal B sends out stop area location response information.
(10) terminal A sends out stop area location response information.
Below in conjunction with accompanying drawing 5, method of the present invention is described in further detail:
The realization of business of the present invention adopts C/S model, and Location Request terminal is client, and requested terminal is server end, and server end responds according to each client-requested, and differentiation mode is terminal IMSI number.A terminal can be used as another terminal server, also can be used as the client of terminal simultaneously, realizes the function of mutually obtaining positional information.
S01: authorize location
Location licencing key adopts oral, mail, and the variety of ways such as note are informed requesting terminal, and requested terminal also arranges same password, and the password of active request and passive request arranges man-machine interface and can realize by UI; Requested terminal is received after positioning authentication request, checks in positioning authentication request data package and carries password, and the qualified confirmation of returning, requested terminal can be revised effective time.
S02: single location
Terminal can send single Location Request packet by UI, and requested terminal determines whether to start that GPS module is obtained data and by consensus standard feedback position information according to the authorization number of storage and the term of validity.
S03: Kinematic Positioning
Kinematic Positioning is on basis, single location, time period and interval, location are increased, its realization is to check after authorization code and the term of validity, starts GPS module obtain data and by consensus standard feedback position information, multiple bearing need to be carried out to serializing by time point according to the time period with interval, location.
S04: zone location
Zone location has increased the concept that region is detected on Kinematic Positioning basis, requested terminal can be detected time, entering or leaving a certain specific region, this region can be described by the rectangular area in the mark upper left corner and the lower right corner, after obtaining again GPS position data, judge it is to enter or left this region according to request, be encapsulated as afterwards protocol specifies data bag.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications 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.