Disclosure of Invention
The embodiment of the invention provides a hybrid positioning method, a positioning terminal and a hybrid positioning system, which are used for realizing switching of different positioning modes.
In a first aspect, an embodiment of the present invention provides a hybrid positioning method, which is applied to a positioning terminal and presets an initial positioning mode, and the method includes:
s1: when a starting instruction is received, starting the preset initial positioning mode as the current positioning mode;
s2: positioning the current position by using the current positioning mode to obtain current position information;
s3: determining whether to switch the current positioning mode according to the current position information, generating a switching instruction when determining to switch the current positioning mode, and executing S4;
s4: switching the current positioning mode into the target positioning mode according to the target positioning mode carried by the switching instruction;
s5: and repositioning the current position by using the target positioning mode to obtain current position information, and executing S3 according to the current position information.
Preferably, the current positioning mode includes: a time-to-observe differential positioning mode;
further comprising: presetting a distance threshold;
prior to S3, further comprising: determining three base stations for locating the current position information, determining a position corresponding to each base station, calculating a distance between the current position information and the position of each base station, comparing the calculated minimum distance with the distance threshold, and executing S3 when the comparison result is that the calculated minimum distance is not less than the distance threshold.
Preferably, the current positioning mode includes: a global positioning system positioning mode;
further comprising: presetting a dense threshold;
prior to S3, further comprising: acquiring an electronic map including the current position; calculating the intensity according to the acquired electronic map, comparing the intensity with the intensity threshold value, and executing S3 when the comparison result shows that the intensity is not greater than the intensity threshold value.
Preferably, before the calculating the density according to the acquired electronic map, the method further comprises: setting different weights for different environment information in the electronic map; the environment information includes: at least two of a building, a road, a river, a forest, and an open space;
the calculating the density according to the acquired electronic map comprises the following steps: identifying each target environment information in the electronic map, calculating the area corresponding to each target environment information in the electronic map, adding the products of the area of each target environment information and the weight thereof according to the weight preset for each target environment information, and dividing the products by the total area of the electronic map to obtain a value as the calculation density.
In a second aspect, an embodiment of the present invention further provides a positioning terminal, including: the device comprises a communication module, a processor and at least two positioning modules; wherein,
the communication module is connected with the processor and used for receiving a starting instruction sent by an external control end and sending the starting instruction to the processor;
the processor is connected with each positioning module respectively and used for sending a starting instruction to the positioning module corresponding to the initial positioning mode according to the starting instruction sent by the communication module and the preset initial positioning mode; receiving current position information sent by a positioning module; determining whether to switch the current positioning mode according to the current position information, and sending a closing instruction to the positioning module which is currently positioned and a starting instruction to the positioning module corresponding to the target positioning mode which needs to be switched when determining to switch the current positioning mode;
each positioning module is used for starting a self positioning mode according to a starting instruction sent by the processor, positioning the current position and sending the obtained current position information to the processor; and closing the positioning mode of the processor according to a closing instruction sent by the processor.
Preferably, the current positioning mode includes: when the observable time reaches the differential positioning mode, the processor is further configured to determine three base stations for positioning the current location information, determine a location corresponding to each base station, calculate a distance between the current location information and the location of each base station, compare the calculated minimum distance with a pre-stored distance threshold, and determine to switch the current positioning mode when the comparison result is that the calculated minimum distance is not less than the distance threshold.
Preferably, the current positioning mode includes: in a gps positioning mode, the processor is further configured to obtain an electronic map including the current location; calculating the intensity according to the acquired electronic map, comparing the intensity with a preset intensity threshold value, and determining to switch the current positioning mode when the intensity is not greater than the intensity threshold value as a comparison result.
Preferably, the processor is further configured to set different weights for different environment information in the electronic map; the environment information includes: at least two of a building, a road, a river, a forest, and an open space;
the processor is specifically configured to identify each piece of target environment information in the electronic map, calculate an area corresponding to each piece of target environment information in the electronic map, add products of the area of each piece of target environment information and the weight of each piece of target environment information according to a weight preset for each piece of target environment information, and divide the sum by the total area of the electronic map to obtain a value serving as the calculation density.
Preferably, the communication module is further configured to send the current location information sent by the processor to an external control end, receive a positioning mode switching instruction sent by the external control end, and send the positioning mode switching instruction to the processor;
the processor is further configured to send the current location information sent by the positioning module to the communication module; and when receiving the positioning mode switching instruction sent by the communication module, determining to switch the current positioning mode.
In a third aspect, an embodiment of the present invention further provides a hybrid location system, including: any one of the positioning terminal and the control terminal; wherein,
and the control end is used for sending a starting instruction to the positioning terminal.
The embodiment of the invention provides a hybrid positioning method, a positioning terminal and a hybrid positioning system, which determine whether the current positioning mode needs to be switched or not by utilizing the current position information positioned by the current positioning mode, and realize the switching of the positioning mode when the switching is needed, so that the current position can be positioned by using different positioning modes according to the requirements of users, and further the user experience can be improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a hybrid positioning method, which is applied to a positioning terminal, and the method may include the following steps:
step 101: an initial positioning mode is preset.
Step 102: when a starting instruction is received, starting the preset initial positioning mode as the current positioning mode;
step 103: positioning the current position by using the current positioning mode to obtain current position information;
step 104: determining whether to switch the current positioning mode according to the current position information, generating a switching instruction when determining to switch the current positioning mode, and executing the step 105;
step 105: switching the current positioning mode into the target positioning mode according to the target positioning mode carried by the switching instruction;
step 106: and repositioning the current position by using the target positioning mode to obtain current position information, and executing the step 104 according to the current position information.
Therefore, whether the current positioning mode needs to be switched or not is determined by utilizing the current position information positioned by the current positioning mode, and when the current positioning mode needs to be switched, the switching of the positioning mode is realized, so that different positioning modes can be used for positioning the current position according to the requirements of users, and further the user experience can be improved.
In one embodiment of the present invention, when the current positioning mode is different, the switching condition is also different.
In the current positioning mode, the following are included: when the observable time reaches the differential positioning mode, the method may further include: presetting a distance threshold;
before determining whether to switch the current positioning mode according to the current position information, the method further comprises the following steps: determining three base stations used for positioning the current position information, determining the position corresponding to each base station, calculating the distance between the current position information and the position of each base station, comparing the calculated minimum distance with the distance threshold, and executing the step of determining whether to switch the current positioning mode according to the current position information when the comparison result shows that the calculated minimum distance is not less than the distance threshold.
When the minimum distance between the current position information and the position of each base station is smaller than the distance threshold, it indicates that the accuracy of positioning realized by using the observable time arrival differential positioning mode cannot be realized, and the observable time arrival differential positioning mode is slow in positioning speed, so that the current positioning mode can be switched.
In the current positioning mode, the following are included: when in the gps positioning mode, the method may further include: presetting a dense threshold;
before determining whether to switch the current positioning mode according to the current position information, the method further comprises the following steps: acquiring an electronic map including the current position; and calculating the intensity according to the acquired electronic map, comparing the intensity with the intensity threshold, and determining whether to switch the current positioning mode according to the current position information when the comparison result shows that the intensity is not greater than the intensity threshold.
Because the positioning is carried out by the satellite signal when the positioning mode of the global positioning system is utilized, and in the area with larger concentration degree, the satellite signal can not pass through the roof to set the construction facilities, the positioning with higher precision can not be realized, and therefore, when the concentration degree of the current position is determined to be not more than the set concentration threshold value, the current positioning mode can be determined to be switched.
In one embodiment of the present invention, the density of the current position may be calculated as follows:
before the calculating the density according to the acquired electronic map, the method further comprises the following steps: setting different weights for different environment information in the electronic map; the environment information includes: at least two of a building, a road, a river, a forest, and an open space;
the calculating the density according to the acquired electronic map comprises the following steps: identifying each target environment information in the electronic map, calculating the area corresponding to each target environment information in the electronic map, adding the products of the area of each target environment information and the weight thereof according to the weight preset for each target environment information, and dividing the products by the total area of the electronic map to obtain a value as the calculation density.
The setting of the weight value can be set according to experience, so that the accuracy of calculation is improved.
In an embodiment of the present invention, the switching of the positioning mode may be performed by the positioning terminal itself according to an actual situation, or may be performed by an external control terminal to control the positioning terminal, so as to implement the switching of the positioning mode of the positioning terminal.
Referring to fig. 2, an embodiment of the present invention further provides a positioning terminal, where the positioning terminal may include: a communication module 201, a processor 202, at least two positioning modules 203; wherein,
the communication module 201 is connected to the processor 202, and is configured to receive a start instruction sent by an external control end, and send the start instruction to the processor 202;
the processor 202 is connected to each positioning module 203, and configured to send a start instruction to the positioning module 203 corresponding to the initial positioning mode according to the start instruction sent by the communication module 201 and according to the preset initial positioning mode; receiving current position information sent by a positioning module 203; determining whether to switch the current positioning mode according to the current position information, and when determining to switch the current positioning mode, sending a closing instruction to the positioning module 203 which is currently positioned, and sending a starting instruction to the positioning module 203 corresponding to the target positioning mode which needs to be switched;
each positioning module 203 is configured to start a positioning mode of the positioning module according to a start instruction sent by the processor 202, position a current position, and send obtained current position information to the processor 202; and closing the positioning mode of the processor according to a closing instruction sent by the processor 202.
According to the positioning terminal provided by the embodiment, after the positioning terminal is started, the initial positioning mode is utilized for positioning, whether the current positioning mode needs to be switched is determined according to the current position information positioned by the current positioning mode and the current position information, and when the switching is needed, the positioning mode is switched, so that the current position can be positioned by using different positioning modes according to the user requirements, and further, the user experience can be improved.
In an embodiment of the present invention, the communication module 201 may include: a GSM (Global System for mobile Communication) sub-module, a GPRS (General Packet radio service) sub-module, and/or a short-range wireless Communication module with a main operating frequency of 433MHz or 2.4 GHz.
Wherein, GPRS submodule piece, GSM submodule piece are long distance wireless communication module, and wherein, long distance wireless communication module can include: global System for Mobile Communication (GSM), 3G, 4G. Wherein, the short distance wireless transmission module may include: bluetooth or WiFi modules, etc.
In one embodiment of the present invention, at least two positioning modules in the positioning terminal may include: any two modules of a GPS (Global Positioning System) module, an OTDOA (observable Time difference of Arrival) module, a CELLID (network-based cell center) module, and a fast AP (Access Point) matching module.
In one embodiment of the invention, the current positioning mode comprises: when in the OTDOA positioning mode, the processor 202 is further configured to determine three base stations for positioning the current location information, determine a location corresponding to each base station, calculate a distance between the current location information and the location of each base station, compare the calculated minimum distance with a pre-stored distance threshold, and determine to switch the current positioning mode when the comparison result is that the calculated minimum distance is not less than the distance threshold.
In one embodiment of the invention, the current positioning mode comprises: in the GPS positioning mode, the processor 202 is further configured to obtain an electronic map including the current location; calculating the intensity according to the acquired electronic map, comparing the intensity with a preset intensity threshold value, and determining to switch the current positioning mode when the intensity is not greater than the intensity threshold value as a comparison result.
In an embodiment of the present invention, the processor 202 is further configured to set different weights for different environment information in the electronic map; the environment information includes: at least two of a building, a road, a river, a forest, and an open space;
the processor 202 is specifically configured to identify each piece of target environment information in the electronic map, calculate an area corresponding to each piece of target environment information in the electronic map, add products of the area of each piece of target environment information and the weight thereof according to a weight preset for each piece of target environment information, and divide the products by the total area of the electronic map to obtain a value serving as the calculation density.
In an embodiment of the present invention, the communication module 201 is further configured to send the current location information sent by the processor 202 to an external control end, receive a positioning mode switching instruction sent by the external control end, and send the positioning mode switching instruction to the processor 202;
the processor 202 is further configured to send the current location information sent by the positioning module 203 to the communication module 201; and when receiving the positioning mode switching instruction sent by the communication module 201, determining to switch the current positioning mode.
Referring to fig. 3, an embodiment of the present invention further provides a hybrid positioning system, including: any one of the above-mentioned positioning terminal 20 and control terminal 10; wherein,
the control terminal 10 is configured to send a start instruction to the positioning terminal.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 4, an embodiment of the present invention provides a hybrid positioning method, which may include the following steps:
step 401: the control end sends a starting instruction to a communication module in the positioning terminal, and the communication module sends the starting instruction to the processor.
In this embodiment, the control terminal may send a start instruction to the communication module in the communication mode, where the start instruction is used to control the positioning terminal to start the positioning mode to position the current position of the positioning terminal.
Step 402: the processor receives a starting instruction sent by the communication module, and takes the initial positioning mode as the current positioning mode according to the preset initial positioning mode.
The hybrid positioning of the present embodiment is described in detail below by taking an example in which the positioning module includes a GPS module and an OTDOA module.
In this embodiment, an initial positioning mode needs to be set in advance to ensure that positioning operation can be normally implemented when positioning of the positioning terminal is started. For example, if the initial positioning mode is a GPS positioning mode, the processor may send the start instruction to the GPS module; if the initial positioning mode is the OTDOA positioning mode, the processor may send the start instruction to the OTDOA module.
The present embodiment may be described in detail by taking the initial positioning mode as the GPS positioning mode as an example.
Step 403: the processor sends the starting instruction to the GPS module, and the GPS module starts a self positioning mode according to the starting instruction.
Step 404: the GPS module positions the current position and sends the current position information obtained by positioning to the processor.
The positioning system corresponding to the GPS module is a satellite navigation positioning system established in the United states, and by utilizing the system, users can realize all-weather, continuous and real-time three-dimensional navigation positioning and speed measurement in a global range; in addition, with this system, the user can also perform high-precision time transfer and high-precision positioning.
Step 405: the processor receives the current position information sent by the GPS module, sends the current position information to the communication module, and the communication module feeds the current position information back to the control end.
Step 406: the processor determines whether the GPS positioning mode needs to be switched according to the current position information, and if so, performs step 407, otherwise, continues to perform step 404.
In this embodiment, whether to switch the GPS positioning mode may be determined in two ways:
1. the control end determines: and the control end determines that the GPS positioning mode needs to be switched according to the current position information, and then sends a switching instruction to the communication module, the communication module sends the switching instruction to the processor, and the processor determines that the GPS positioning mode needs to be switched according to the switching instruction.
2. The processor itself determines: referring to fig. 5, the method may include the following steps:
step 501: an electronic map including the current location is obtained.
In this embodiment, in order to determine the environment of the current location, the environment of the current location may be determined by an electronic map corresponding to the current location, and the shape of the electronic map may be a circle, a square, or another irregular shape, and may be set by the control end or the processor.
The present embodiment will be described in detail below by taking the shape of an electronic map as an example.
A radius threshold may be preset, for example, the radius threshold is 1000 meters, and the acquired electronic map may be a circular map with the current location as the center and the radius as the radius threshold.
Step 502: and calculating the density according to the acquired electronic map.
In the present embodiment, the degree of density can be calculated according to the following manner:
firstly, setting different weights for different environment information in an electronic map; the environment information may include: at least two of a building, a road, a river, a forest, and an open space.
The setting of the weight value may be determined according to an empirical value, for example, the following weight value may be set:
the building is 0.5, the highway is 0.2, the river is 0.1, the forest is 0.1, and the open space is 0.1.
And secondly, identifying each target environment information in the electronic map.
In this embodiment, each target environment information may be identified according to colors corresponding to different environments in the electronic map, or corresponding target environment information may be directly identified.
The identification mode can be identified by using the existing identification technology.
And thirdly, calculating the area corresponding to each piece of target environment information in the electronic map.
Finally, the density V is calculated according to the following formula (1).
S is used for representing the total area of the electronic map, Sn is used for representing the area of the nth target environment information, and Gn is used for representing the weight of the nth target environment information.
Step 503: comparing the density degree with a preset density threshold, determining that the current positioning mode needs to be switched when the density degree is not greater than the density threshold as a comparison result, and determining that the current positioning mode does not need to be switched when the density degree is greater than the density threshold as the comparison result.
Step 407: the processor sends a closing instruction to the GPS module, sends a starting instruction to a positioning module (OTDOA module) corresponding to a target positioning mode to be switched, and the OTDOA module starts the positioning mode of the OTDOA module according to the starting instruction.
Step 408: and the OTDOA module positions the current position and sends the current position information obtained by positioning to the processor.
Step 409: the processor receives the current position information sent by the OTDOA module, sends the current position information to the communication module, and the communication module feeds the current position information back to the control end.
Step 410: the processor determines whether switching of the OTDOA positioning mode is required according to the current position information, if so, performs step 411, otherwise, continues to perform step 408.
In this embodiment, whether to switch the OTDOA positioning mode may be determined in two ways:
1. the control end determines: and the control terminal determines that the OTDOA positioning mode needs to be switched according to the current position information, and then sends a switching instruction to the communication module, the communication module sends the switching instruction to the processor, and the processor determines that the OTDOA positioning mode needs to be switched according to the switching instruction.
2. The processor itself determines: referring to fig. 6, the method may include the following steps:
step 601: three base stations for locating the current location information are determined.
Step 602: and determining the corresponding position of each base station.
Step 603: the distance between the current location information and the location of each base station is calculated.
Step 604: comparing the calculated minimum distance with a preset distance threshold, and determining that the OTDOA positioning mode needs to be switched when the comparison result is that the calculated minimum distance is not smaller than the distance threshold; and when the calculated minimum distance is smaller than the distance threshold value as a result of the comparison, determining that the OTDOA positioning mode does not need to be switched.
The OTDOA positioning mode is a technique for performing positioning based on the difference between the propagation times of signals from three base stations and a positioning terminal. The OTDOA module calculates differences in distances from the positioning terminal to the three base stations by measuring TDOAs (time difference Of radio signals) from the positioning terminal to the three base stations, thereby determining current position information.
If the distance between the positioning terminal and the three base stations is longer, the positioning accuracy is lower, so that if the calculated minimum distance is not less than the distance threshold, it is determined that the OTDOA positioning mode needs to be switched.
Step 411: the processor sends a shutdown instruction to the OTDOA module and performs step 403.
In summary, the embodiments of the present invention can at least achieve the following beneficial effects:
1. in the embodiment of the invention, whether the current positioning mode needs to be switched or not is determined by utilizing the current position information positioned by the current positioning mode, and the switching of the positioning mode is realized when the switching is needed, so that different positioning modes can be used for positioning the current position according to the requirements of a user, and further the user experience can be improved.
2. In the embodiment of the invention, when the current positioning mode is the GPS positioning mode, the density can be calculated through the electronic map, so that when the density is not greater than the density threshold, the switching of the GPS positioning mode is determined, the positioning mode with higher precision can be used for realizing the positioning, and the user experience can be improved.
3. In the embodiment of the present invention, when the current positioning mode is the OTDOA positioning mode, whether to switch the OTDOA positioning mode may be determined by calculating a comparison between a minimum distance between the positioning terminal and the three base stations and a distance threshold, and if the minimum distance is not less than the distance threshold, it is determined that the OTDOA positioning mode may be switched, so as to improve user experience.
4. In the embodiment of the invention, whether the current positioning mode is switched can be determined by controlling the positioning terminal through the control terminal, so that a user can be ensured to switch the positioning mode in real time according to the requirement of the user on the positioning precision.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.