In the era of mobile Internet, mobile phones have become the standard equipment of everyone's life. Various apps are installed in these mobile phones, which provide various services and completely change our lives. Everyone should have used positioning services. For example, many people install mobile phone positioning software for children or the elderly to prevent the elderly and children from getting lost. This will be applied to positioning technology. This technology provides auxiliary support for many application services.
Some people will hire hackers to use "location" technology to track and locate relevant people, violating other people's privacy! So what is the principle of this technology? How to use this technology to quickly locate other people's location? Today we will use the content of this article to give you a detailed explanation of "the principle and implementation of mobile phone positioning"!
1. Common positioning technology
There are 6 types of large-scale positioning technologies currently in use, which are divided into two categories
Satellite positioning: including GPS, AGPS, Glonass, Beidou.
Ground-assisted positioning: including base station positioning and WiFi-assisted positioning.
2. Common positioning technology principles
Common satellite positioning systems include GPS, Beidou, Galileo, and Glonass. Although the services provided by these systems are somewhat different, the positioning principles behind them are the same. Now take the most widely used GPS as an example to introduce satellite positioning.
GPS (Global Positioning System) is a global positioning system, which is a satellite navigation and positioning system established by the United States. With this system, users can achieve all-weather, continuous, real-time three-dimensional navigation and positioning and speed measurement around the world; in addition, using this system, users can also perform high-precision time transfer and high-precision precision positioning.
1.1 GPS system composition
The GPS system includes three parts: space part - GPS satellite constellation; ground control part - ground monitoring part; user equipment part - GPS signal receiver.
1.1.1 GPS working satellites and their constellations
21 working satellites and 3 in-orbit spare satellites form the GPS satellite constellation. The 24 satellites are at a height of 20200km from the ground, and their operating period is 11 hours and 58 minutes (sidereal time is 12 hours). They are evenly distributed in 6 orbital planes, with an orbital inclination of 55 degrees and a distance of 60 degrees between each orbital plane. The difference between the satellites in the plane is 90 degrees. When the satellite passes through the zenith, the visible time of the satellite is 5 hours. At any place on the earth's surface at any time, at an altitude angle of more than 15 degrees, an average of 6 satellites can be observed at the same time, and up to 9 satellites can be observed at the same time. In order to understand the three-dimensional coordinates of the calculation station, four GPS satellites must be observed, which are called positioning constellations.
1.1.2 Ground monitoring system
For navigation and positioning, the GPS satellite is a dynamically known point. The position of the star is calculated based on the ephemeris of the satellite launch - the parameters describing the motion of the satellite and its orbit. The ephemeris broadcast by each GPS satellite is provided by the ground monitoring system. Whether the various equipment on the satellite is working normally, and whether the satellite has been running along the predetermined orbit, must be monitored and controlled by the ground equipment. Another important function of the ground monitoring system is to keep the time of each satellite, find out the clock difference, and then send it to the satellite from the ground injection station, and then send the satellite to the user equipment through the navigation message.
The ground monitoring system of the GPS working satellite includes a main control station, three injection stations and five monitoring stations. The role of the master control station is to calculate the satellite ephemeris and the correction parameters of the satellite clock based on the observation data of the GPS by each monitoring station, and inject these data into the satellite through the injection station; Control, issue instructions to the satellite, when the working satellite fails, dispatch a spare satellite to replace the failed working satellite; in addition, the main control station also has the function of a monitoring station; the main task of the monitoring station is to provide satellite observation for the main control station Data; the task of the injection station is to inject the navigation message sent by the master control station into the memory of the corresponding satellite.
1.1.3 GPS signal receiver
It can capture the signals of the satellites to be measured selected according to a certain satellite altitude cut-off angle, track the operation of these satellites, transform, amplify and process the received GPS signals, so as to measure the GPS signal from the satellite to the receiver antenna It can interpret the navigation message sent by the GPS satellite, and calculate the three-dimensional position of the station in real time, and even the three-dimensional velocity and time.
1.2 GPS positioning principle
The basic principle of the GPS navigation system is to measure the distance between the known satellite and the user's receiver, and then integrate the data of multiple satellites to know the specific position of the receiver. To achieve this purpose, the position of the satellite can be found in the satellite ephemeris according to the time recorded by the on-board clock. The distance from the user to the satellite is obtained by recording the time taken by the satellite signal to propagate to the user, and then multiplying it by the speed of light (due to the interference of the atmospheric ionosphere, this distance is not the real distance between the user and the satellite, but Pseudorange).
When the GPS satellite is working normally, it will continuously transmit navigation messages with pseudo-random codes (referred to as pseudo-codes) composed of 1 and 0 binary symbols. Navigation message includes satellite ephemeris, working status, clock correction, ionospheric delay correction, atmospheric refraction correction and other information. The role of the satellite part of the GPS navigation system is to continuously transmit navigation messages. However, since the clock used by the user's receiver and the satellite's on-board clock cannot always be synchronized, in addition to the user's three-dimensional coordinates x, y, z, a variable t, which is the time difference between the satellite and the receiver, must be introduced as an unknown, and then use 4 equations to solve these 4 unknowns. So if you want to know the location of the receiver, you must be able to receive signals from at least 4 satellites.
Solving x, y, z and t from the above four equations can be used for timing and positioning. The GPS positioning method does not require a sim card and does not need to be connected to the network. As long as you are outdoors, you can basically locate accurately anytime, anywhere. Other types of satellite positioning methods are similar to GPS and will not be described here.
Base station positioning, also known as LBS, Location Based Service (location-based service).
2.1 Related concepts
Because signals in the same frequency range will interfere with each other, in order to prevent adjacent base stations from interfering with each other, adjacent base stations will select different channels (signals in different frequency ranges) to communicate with mobile devices. The above figure is a schematic diagram of a cellular mobile base station, and any two adjacent base stations have different communication frequency bands. Base stations do not exist in isolation, and their coverage areas are handed over to each other to form a huge mobile communication network.
After the mobile device is turned on with the SIM card inserted, it will actively search for the surrounding base station information and establish contact with the base station, and in the area where the signal can be searched, the mobile phone can search for more than one base station, but the distance is different. The base station with the closest distance and the strongest signal will be selected as the communication base station. The rest of the base stations are not useless. When your location moves, the signal strength of different base stations will change. If the signal of base station A is not as good as that of base station B, the mobile phone will first communicate with base station B to prevent the connection from being interrupted suddenly. Communication, after the communication method is coordinated, it will switch from A to B. This is why you consume more power on the train than at home when you are on standby for the same day. The mobile phone needs to constantly search and connect to the base station. Every time I take the train, I will turn my mobile phone into airplane mode, watch movies and listen to songs, and it can still last for a long time.
In this huge mobile network, according to the cell you are in, the base station you belong to can roughly know your location information, and if you add some estimation algorithms, you can find out your location more accurately.
2.2 Base station positioning principle
The mobile phone measures the downlink pilot signals of different base stations, and obtains the TOA (time of arrival) or TDOA (time difference of arrival) of the downlink pilot signals of different base stations. According to the measurement results and the coordinates of the base stations, the triangular formula estimation algorithm is generally used to calculate location of the mobile phone. The actual location estimation algorithm needs to consider the positioning of multiple base stations (3 or more), so the algorithm is much more complicated. Generally speaking, the more the number of base stations measured by the mobile station, the higher the measurement accuracy and the more obvious the improvement of positioning performance.
The above introduction is somewhat official and not very easy to understand. To put it bluntly, the farther away from the base station, the worse the signal. According to the signal strength received by the mobile phone, the distance from the base station can be roughly estimated. When the mobile phone searches for at least three base station signals at the same time (the current network coverage is very easy) One thing), you can roughly estimate the distance from the base station; the base station is uniquely determined in the mobile network, and its geographical location is also unique, so you can get the distance between the three base stations (three points) and the mobile phone, according to The principle of three-point positioning requires only to draw circles with the base station as the center and the distance as the radius, and the intersection of these circles is the location of the mobile phone. The same is true of the three-point positioning principle of WeChat on the Internet.
When the base station is positioned, the signal is easily interfered, so the inaccuracy of its positioning is inherently determined. The accuracy is about 150 meters, and it is basically impossible to drive and navigate. The positioning condition is that it must be in a location with base station signals, the mobile phone is in the sim card registration state (opening wifi and pulling out the sim card in flight mode will not work), and must receive signals from 3 base stations, no matter whether it is indoors or not. However, the positioning speed is super fast, and it can be positioned once there is a signal. At present, the main purpose is to quickly and roughly understand your position without GPS and wifi. In addition, if you do not have a base station location data packet in your mobile phone, you still need to be connected to the Internet.
When a device is in such a network, the collected data that can identify APs can be sent to the location server, and the server retrieves the geographic location of each AP, and combines the strength of each signal to calculate the location of the device. The geographic location is returned to the user equipment, and its calculation method is similar to that of the base station positioning position, which also uses three-point positioning or multi-point positioning technology.
The location service provider should constantly update and supplement its own database to ensure the accuracy of the data. So the question is, how are these AP location mapping data collected? It can be roughly divided into two types - active collection and user submission.
Active collection:
Google's street view shooting car, didn't expect it? It is a collection device. It collects wireless signals along the way and marks the coordinates located by GPS and sends them back to the server.
User Submission:
When an Android mobile phone user turns on "Use wireless network positioning", it will prompt whether to allow the use of Google's location service. If allowed, the user's location information will be collected by Google. The iPhone will automatically collect the Wi-Fi MAC address, GPS location information, operator base station code, etc., and send them to Apple's server.
Like base station positioning, Wi-Fi positioning has a good effect in places with dense APs. If there are few APs, it is difficult to locate accurately. Generally speaking, the implementation of Wi-Fi positioning method is relatively difficult, and the usability and accuracy are not high. Therefore, it is mainly an auxiliary positioning method.
When it comes to assistance, we're going to talk about A-GPS.
A-GPS, Assisted GPS, assisted global satellite positioning system. As you can tell from the name, this is an enhanced feature of GPS.
AGPS (AssistedGPS: Assisted Global Satellite Positioning System) is a combination of GSM/GPRS and traditional satellite positioning, using the base station to send auxiliary satellite information to reduce the delay time for the GPS chip to obtain satellite signals, and the base station signal can also be borrowed indoors under cover Make up for and reduce the dependence of GPS chips on satellites. AGPS uses the signal of the mobile phone base station, supplemented by connecting to the remote positioning server to download satellite data, and then cooperates with the traditional GPS satellite receiver to make the positioning speed faster. It is a technology that combines network base station information and GPS information to locate mobile stations. It uses both the global satellite positioning system GPS and mobile base stations to solve the problem of GPS coverage. It can be used in 2nd generation G, C networks and 3G networks used in.
The ordinary GPS system is composed of GPS satellites and GPS receivers. Different from ordinary GPS, AGPS also has an auxiliary positioning server in the system. In an AGPS network, a receiver may obtain positioning assistance through communication with an assistance server. Since the tasks between the AGPS receiver and the auxiliary server are mutually divided, AGPS often has faster positioning capabilities and higher efficiency than ordinary GPS systems, and can quickly capture GPS signals. The time will be greatly reduced, generally only a few seconds (the first capture time of a simple GPS receiver may take 2 to 3 minutes), and the accuracy is only a few meters, which is higher than the accuracy of GPS. Utilizing AGPS receivers no longer has to download and decode navigation data from GPS satellites, so there is more time and processing power to track GPS signals, which reduces time to first fix, increases sensitivity, and maximizes availability.
Basic steps of AGPS positioning
The advantage of AGPS is mainly in its positioning accuracy. In open areas such as outdoors, its accuracy can reach about 10 meters in a normal GPS working environment, which can be called a positioning technology with the highest positioning accuracy at present. Another advantage is: the time for capturing GPS signals for the first time generally only takes a few seconds, unlike the first capturing time of GPS which may take 2 to 3 minutes. Although the positioning accuracy of AGPS technology is very high, and the time for capturing GPS signals for the first time is short, this technology also has some shortcomings. First of all, the problem of indoor positioning is still not satisfactorily resolved. In addition, the positioning of AGPS must be transmitted through the network multiple times (up to six one-way transmissions), which is considered to occupy a large amount of air resources for operators, and will generate a lot of traffic for consumers cost. Moreover, AGPS mobile phones have a certain extra burden on power consumption compared with ordinary mobile phones, which indirectly reduces the standby time of mobile phones. In addition, sometimes it is not possible to obtain signals from multiple satellites, usually because of the limitation of the environment where the antenna receiver of your AGPS phone is located. In this case, the AGPS function will not work well.
Knowing the "developer's implementation method" of these positioning methods, the developer may be sweating all over. Is the app "maintaining the base station and WIFI database by itself" as mentioned above?
Answer: Of course no. In actual engineering practice, there are two mainstream approaches:
One of the means: calling the system-level positioning capability
No matter which system (IOS, Android, WP) provides a set of system-level positioning capabilities, such positioning capabilities correspond to a set of system-level APIs. Generally speaking, this API always has the following precision options :
High precision: If GPS satellites can be found, use GPS for positioning, otherwise, use WIFI for positioning. If both WIFI and GPS fail to locate successfully, you can only give the positioning result based on the base station.
Balance power consumption: disable GPS (because it is very power hungry), use WIFI first, and use base station for positioning if WIFI is not available.
Low power consumption (passive positioning): According to the regulations of different systems, the implementation methods are also different, but generally they share the positioning results of other apps, that is, other apps obtain the position with high precision and balanced power consumption, then this position also It is also pushed to the app currently using "low power positioning", that is, the app does not consume additional energy consumption, and the positioning is completed.
However, we have to admit that on IOS and WP systems, because the OS does not open the interface for reading base stations and WIFI, in fact, the positioning ability of the operating system has formed a monopoly, and developers cannot realize independent positioning capabilities. This will also lead to the same positioning error of all apps at the same time on Apple and WP phones.
Method 2: Call the third-party positioning SDK
For Android mobile phone systems that can publicly read base station and WIFI information, map manufacturers have implemented their own positioning SDK. The function of this positioning SDK is to read the original positioning information through the system interface, and then query To the currently scanned base station and WIFI locations, a more accurate positioning result is finally calculated, and returned to the developer through the SDK interface. The advantage of doing this is that it can make the positioning ability of the app independent of the mobile phone system.
Locating the location of other people's mobile phones will involve privacy issues, so the study method is only recommended for locating the whereabouts of the elderly and children to ensure the safety of the elderly and children, and cannot be used for illegal activities!
1. Conventional method
At present, the customization system of most mobile phone brands will have a mobile phone search function. If other brands do not have a mobile phone search function but want to locate the mobile phone, they can only do so by installing a third-party APP. Through the mobile phone positioning function that comes with the third-party APP, you can easily locate the location of other people's mobile phones.
2. Special method
Obtain mobile phone permissions through Trojan horse program implantation to realize positioning
This method has a lot of permissions to obtain the other party's mobile phone, not only can obtain the location, but also call, text messages, and chat records.