A method for obtaining indoor location based on WiFi positioning
By collecting the coordinates and signal strength data of the access point (AP) in an indoor environment, establishing a spatial model and fitting it, the problem of inaccurate WiFi positioning in indoor environments is solved, and high-precision location determination is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-04-10
AI Technical Summary
Existing WiFi positioning technology has unsatisfactory positioning results and large errors in indoor environments, and requires high-precision instruments and complex calculations, making it difficult to achieve high-precision positioning.
By collecting the coordinates of indoor APs and the surrounding signal strength distribution data, a spatial model is established. RSSI ranging and signal strength fitting are used to determine the actual location of the terminal, reducing reliance on high-precision instruments and lowering computational complexity.
It achieves high-precision positioning based on signal strength and spatial model in multi-AP devices, reducing positioning errors and improving positioning accuracy and efficiency.
Smart Images

Figure CN115580825B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of indoor signal positioning, in particular to a method for obtaining indoor position based on WiFi positioning. BACKGROUND
[0002] In large places such as hospitals, office buildings, large shopping malls, large underground parking lots, etc., the indoor environment is relatively complex, there are many signal sources, and the GPS signal is weak, making it difficult to determine the position information of the mobile terminal or its holder indoors. With the popularization of WiFi chip related hardware devices, there are currently many studies on WiFi positioning algorithms, such as TOA measurement, triangular positioning method, etc. The existing WiFi-based algorithm infers the position of the device, such as the triangular positioning method, which draws a circle with the WiFi coordinate as the center, and the radius of the circle is the distance between the device and the hotspot. The position of the device may be at the overlapping point of multiple circles, and the positioning error is large, and the two-circle model used has a large amount of calculation. The fingerprint algorithm refers to the fact that the mobile phone will scan all the WiFi around it. At this time, all the MAC addresses that can be collected are compared with the data recorded on the device before, and the collected fingerprints are matched. Then it can be considered that the coordinates at this time are the coordinates pointed to by the fingerprint. The amount of data collected needs to be very large, and the server performance and data storage requirements are high, and the positioning result is not ideal. The TOA method based on arrival time and angle requires precise measuring instruments and clock synchronization.
[0003] For example, a "WiFi-based indoor positioning and verification system" disclosed in Chinese patent documents, with publication number CN110366103B, discloses a system that includes at least one RFID reader, which is dispersedly arranged in a positioning area; at least three wireless AP machines, which are dispersedly arranged in the positioning area; a mobile device, which is connected to the at least three wireless AP machines and obtains wireless signal strength; and a positioning server, which collects the wireless signal strength and uses a differential algorithm to position the mobile device. However, this scheme has a large positioning error due to the large number of devices. SUMMARY
[0004] In order to solve the problems of unsatisfactory positioning result, large positioning error and high instrument requirement in the prior art, the present application provides a method for obtaining indoor position based on WiFi positioning, which only needs to collect the coordinates of indoor aps and determine the position by collecting the surrounding signal strength distribution data, thereby providing real-time position support for path planning.
[0005] In order to achieve the above-mentioned purpose, the present application provides the following technical scheme:
[0006] A method for obtaining indoor position based on WiFi positioning, comprising the following steps:
[0007] S1, installing aps and collecting data;
[0008] S2, RSSI ranging;
[0009] S3, obtaining the terminal surrounding wifi signal strength distribution data;
[0010] S4, judging the point closest to the real terminal position. RSSI is the received signal strength indication; ap is a wireless access point, which is a wireless switch for wireless network and is also the core of wireless network. Multiple aps are installed in different positions in the room, the distance and signal strength of nearby aps are collected by the terminal, the spatial model is established according to the signal strength, the spatial model is fitted with ideal data, and the point closest to the real terminal position is determined according to the fitting result. The point closest to the real terminal position can be determined by establishing the intensity signal spatial model near the terminal and fitting the intensity data.
[0011] As preferred, S1 includes grouping mark data, collects the GPS coordinates of each ap and the corresponding MAC address, and establishes an ap information database. Multiple ap devices are installed in each floor of the building, one or more ap devices are installed in each floor, and the ap device grouping mark data in the multi-storey building is established. The aps in each floor are installed at the same height, which further reduces the error. A spatial area located inside the multi-storey building can be established by arranging multiple ap devices, and the terminal range can be tracked conveniently by grouping. The intensity of each place in the spatial area is determined by the signal strength at that place. The position can be determined conveniently.
[0012] As preferred, S2 includes ranging according to signal strength; a relationship function between received signal strength and signal transmission distance is established, and a propagation factor and received signal power are introduced. The RSSI ranging calculation formula is: rssi = txPower + pathloss + rxGain + SystemGain. The relationship between the transmitting power and the receiving power of the wireless signal can be simulated by the antenna structure: PR = PT / rn, where PR is the receiving power of the wireless signal, PT is the transmitting power of the wireless signal, r is the distance between the transmitting and receiving units, n is the propagation factor, and the value depends on the environment of wireless signal propagation. The propagation factor mainly depends on the interference such as attenuation, reflection, multipath effect, etc. of the wireless signal in the air. If the interference is small, the smaller the value of the propagation factor n, the farther the signal propagation distance, and the closer the propagation curve of the wireless signal to the theoretical curve, and the more accurate the RSSI-based ranging. The distance between the terminal and the ap device can be accurately measured.
[0013] As preferred, S3 includes obtaining S31, the spatial coordinates of the ap points with the strongest peripheral wifi signal; S32, establishing a hypothetical area according to the spatial coordinates. Each terminal can receive wireless signals from multiple ap devices in the periphery, and the spatial coordinates of multiple ap points with the highest signal strength are selected, and a spatial model is established according to the spatial coordinates of the ap points, the spatial model is further divided and the signal strength is calculated, and the ideal value is fitted to determine the point closest to the real location of the terminal. It can reduce the use of high-precision instruments while accurately positioning, improve positioning accuracy through multiple point judgment, not only make the positioning accurate, but also get more detailed spatial position.
[0014] As preferred, S31 includes scanning all available wifi point signals in the periphery and selecting multiple signal points with the strongest signal, and obtaining a table of signal strength and corresponding aps. After scanning all available wifi points in the periphery of the terminal, the highest strength is selected, and the highest strength is often close to the terminal, and a table of signal strength and corresponding aps is established, so as to obtain the signal strength data near the terminal.
[0015] As preferred, S32 includes determining the longitude and latitude variation range according to the spatial coordinates, obtaining a spatial area, dividing the spatial area along the longitude and latitude, and obtaining an array of multiple hypothetical position points. According to the spatial coordinates of the ap points, the longitude and latitude variation range (minX, minY) and (maxX, maxY) are obtained, a spatial area is obtained, the spatial area is extended along the direction of the terminal to set a distance, so that the ap devices are gathered on the same side of the terminal. The spatial area can be established, and a longitude and latitude coordinate system is established in the spatial area, and the coordinate system is divided, and multiple array hypothetical position points are obtained after division. The hypothetical position points are arranged adjacent to each other in the spatial area. Thus, the possible position of the terminal is obtained, and the density of the hypothetical position points can change the accuracy of the terminal positioning, further improving the accuracy and freedom of the terminal positioning.
[0016] As preferred, S4 includes S41, obtaining a hypothetical signal strength distribution map; S42, finding the point closest to the real mobile phone position according to the fitting degree of the hypothetical virtual point signal map and the real RSSI signal map. The signal strength of each hypothetical position point is calculated, and the calculated signal strength and the ideal signal strength are compared to determine the position of the terminal. It can reduce the influence of errors and determine the position by comparing the signal strength.
[0017] As preferred, S41 includes obtaining the distance between each assumed position point and the signal point with the strongest signal, and respectively calculating the corresponding RSSI value to obtain the assumed signal strength distribution map. The coordinate points are traversed, the points (z1, z2, z3, z4,...) are taken, the distance between the coordinate points and the signal points is obtained, the corresponding RSSI is calculated, and thus the assumed signal strength distribution map of each coordinate point is obtained. The number of assumed signal strength distribution maps is the same as the number of coordinate points. The signal strength distribution map at each coordinate point can be obtained.
[0018] As preferred, S42 includes calculating the fitting degree according to the RSSI signal of the ideal assumed position and the assumed signal strength distribution map, traversing the multiple assumed position points, and taking the position with the smallest fitting value as the point closest to the real mobile phone position. The RSSI signal map at the coordinate point under ideal conditions is determined according to the device information of the ap, the fitting degree is calculated according to the equal scaling relationship between the RSSI signal map at the coordinate point under ideal conditions and the assumed signal strength distribution map, double rad = RSSI data sum in the assumed position map / RSSI data sum in the real signal map; fitting value = (ap1 mobile phone signal strength-ap1 simulated signal strength*rad) absolute value + (ap2 mobile phone signal strength-ap2 simulated signal strength*rad) absolute value + (ap3 mobile phone signal strength-ap3 simulated signal strength*rad) absolute value + (ap4 mobile phone signal strength-ap4 simulated signal strength*rad) absolute value + (ap5 mobile phone signal strength-ap5 simulated signal strength*rad) absolute value; the coordinate points are traversed, and the position with the smallest fitting value is taken as the point closest to the real mobile phone position. Thus, high-accuracy positioning is realized.
[0019] The present application has the following advantages:
[0020] (1) Reduce the interference caused by wifi signal fluctuation. Triangular positioning requires stable wifi signal values, but in real scenarios, signal fluctuation is relatively large. When calculating the position by wave floating, the dependence on the accuracy of a single wifi value can be eliminated. The algorithm is filtered and smoothed in the later stage, which can prevent position jitter caused by signal fluctuation and be close to the real use scenario; (2) A signal strength and position space model can be established under the action of multiple ap devices. The most reliable coordinate point is determined by fitting the signal strength in the space model with the ideal value, and the terminal position is determined. The positioning accuracy can be changed by changing the coordinate point division multiple, reducing the error caused by signal strength, signal fluctuation, and few signal sources, and improving the positioning accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only exemplary, and other drawings can be obtained by the provided drawings without creative labor for those skilled in the art.
[0022] Figure 1 is a schematic diagram of RSSI and distance curve when n is constant and A is changed in the present application.
[0023] Figure 2 is a schematic diagram of RSSI and distance curve when A is constant and n is changed in the present application.
[0024] Figure 3 is a mobile phone surrounding WiFi signal strength diagram.
[0025] Figure 4 is an ap layout and mobile phone position display diagram.
[0026] Figure 5 is a 100*100 part imaginary point signal strength distribution diagram.
[0027] Figure 6 is a schematic diagram of the method steps of the present application. DETAILED DESCRIPTION
[0028] The embodiments of the present application will be described below by specific specific embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of the present application.
[0029] As shown in Figure 6 , in a preferred embodiment, the present application discloses a method for obtaining indoor location based on WiFi positioning, comprising the following steps:
[0030] S1, install ap, collect data; group mark data, collect the GPS coordinates of each ap and the corresponding mac address, and establish ap information database; ap device uses uniform signal to prevent the inconsistency of transmission power from causing large error in RSSI value and spatial distance mutual conversion; if ap device does not use uniform model, then a deviation value needs to be added after RSSI ranging to adjust to reduce error; install one or more aps on each floor of the multi-storey building, and the height of each ap is the same to reduce error, if the height of each ap is not the same, then a second deviation value needs to be added after RSSI ranging to adjust to reduce error.
[0031] In use, after arranging multiple aps in a multi-storey building, the GPS coordinates and MAC addresses of each ap are detected and stored respectively to establish an ap information database.
[0032] S2, RSSI ranging; ranging according to signal strength; establishing a relationship function of received signal strength and signal transmission distance, introducing a propagation factor and the power of received signal; ranging according to signal strength, RSSI ranging calculation formula: rssi = txPower + pathloss + rxGain + SystemGain, rxGain can be simulated by antenna structure. RSSI ranging principle:
[0033] The relationship between the transmission power and the receiving power of the wireless signal can be represented by formula (1), PR is the receiving power of the wireless signal, PT is the transmission power of the wireless signal, r is the distance between the transceiver units, n is the propagation factor, and the numerical value depends on the environment of the wireless signal propagation.
[0034] PR = PT / rn (1);
[0035] Taking the logarithm of both sides of formula (1) can obtain formula (2),
[0036] 10·nlgr = 10lgPT / PR (2);
[0037] The transmission power of the node is known, and the sending power is substituted into formula (2) to obtain formula (3),
[0038] 10lgPR = A-10·nlgr (3);
[0039] The left half of formula (3) 10lgPR is the expression of the received signal power converted to dBm, which can be directly written as formula (4), in formula (4) A can be regarded as the received signal power when the signal is transmitted 1m away.
[0040] PR(dBm) = A-10·nlgr (4);
[0041] From formula (4), the values of the constants A and n determine the relationship between the received signal strength and the signal transmission distance, and the influence of the two constants on the signal transmission distance is analyzed. First, assuming that n is constant and A changes, then the relationship curve is shown as in Figure 1 From the Figure 1As shown, the signal propagation factor n is a constant value, and the relationship between RSSI and propagation distance at different initial transmission signal powers. It can be seen that the signal attenuation of the wireless signal in the propagation process is quite severe in the near distance, and the signal is slowly linearly attenuated in the far distance. When the transmission signal power increases, the increased propagation distance is approximately the ratio of the increase in transmission signal power and the slope of the curve in the gentle stage. If A is constant, the relationship between RSSI and signal propagation distance at different n is as shown in Figure 2 When n takes a smaller value, the signal attenuation in the propagation process is smaller, and the signal can propagate a long distance, from Figure 2 It can be seen that the good propagation factor n characteristics, increasing the transmission signal power can increase the signal propagation distance. The propagation factor mainly depends on the attenuation, reflection, multipath effect and other interference of the wireless signal in the air. If the interference is small, the smaller the value of the propagation factor n, the farther the signal propagation distance, the closer the propagation curve of the wireless signal to the theoretical curve, and the more accurate the RSSI-based ranging.
[0042] S3, acquiring the terminal surrounding wifi signal strength distribution data; S31, acquiring the spatial coordinates of the strongest ap point of the surrounding wifi signal; scanning all available wifi point signals around the terminal and selecting the strongest multiple signal points to obtain a table of signal strength and corresponding ap; after scanning all available wifi points around the terminal, select the top few, the strongest are often close to the terminal, and establish a table of signal strength and corresponding ap, thereby obtaining the signal strength data near the terminal.
[0043] In use, the mobile phone scans all available wifi point signals around it, and the Android terminal can obtain the mobile phone WiFi signal strength and corresponding mac address. Android terminal api: wifiManager.getScanResults(), WeChat applet api: wx.onGetWifiList(function callback)), take the top 5 signal points to obtain a table of signal strength and corresponding ap.
[0044] S32, according to the spatial coordinates to establish a hypothetical region; according to the spatial coordinates to determine the longitude and latitude variation range, obtain the space region, the space region is divided along the longitude and latitude, get array multiple hypothetical position points; according to the spatial coordinates of ap point, take longitude latitude variation range (minX, minY) and (maxX, maxY), a space region can be obtained, the space region is extended along the direction of the terminal direction to set the distance, so that the ap equipment is gathered in the same side of the terminal, the space region can also be established, the longitude and latitude coordinate system is established in the space region, and the coordinate system is divided, and multiple array hypothetical position points are obtained after the division, the hypothetical position points are arranged adjacent in the space region. Thus the possible position of the terminal is obtained, and the accuracy of the terminal positioning can be changed according to the density of the hypothetical position points.
[0045] In use, such as Figure 3 , the spatial coordinates of the five ap points are obtained, the longitude latitude variation range (minX, minY) and (maxX, maxY) are taken, a rectangular space region can be obtained, and the region is enlarged by 80 meters in each direction (considering the ap hotspot gathered on one side of the mobile phone), the coordinate system is divided along the longitude and latitude by 100, and 100*100 hypothetical mobile phone position points are obtained, as shown in Figure 4 .
[0046] S4, judging the point closest to the real terminal position; S41, obtaining the hypothetical signal strength distribution diagram; the distance between each hypothetical position point and the multiple signal points with the strongest signal is obtained, and the corresponding RSSI value is calculated to obtain the hypothetical signal strength distribution diagram; S42, finding the point closest to the real terminal position according to the fitting degree of the virtual point signal diagram and the real RSSI signal diagram; the fitting degree is calculated according to the RSSI signal of the ideal hypothetical position and the hypothetical signal strength distribution diagram, and the multiple hypothetical position points are traversed, and the position with the smallest fitting value is taken as the point closest to the real terminal position.
[0047] In use, the coordinate points are traversed, the points (z1, z2, z3, z4…) are taken, the distances between the coordinate points and the above-mentioned five aps are obtained, the corresponding RSSI values are calculated, PR (dBm) = A-10·nlgr, and the 100*100 hypothetical signal strength distribution diagrams are obtained, as shown in Figure 5 , the fitting degree is compared between the virtual point signal diagram and the real RSSI signal diagram, the closer the fluctuation of the graph is, the more accurate the real position of the mobile phone is, and the calculation method is: the RSSI signal of the ideal hypothetical position and the real RSSI signal diagram exist in the ratio scaling relationship, and the fitting degree is calculated.
[0048] double rad = RSSI data sum in hypothetical position map / RSSI data sum in real signal map;
[0049] fit value = (ap1 mobile signal strength - ap1 analog signal strength * rad) absolute value + (ap2 mobile signal strength - ap2 analog signal strength * rad) absolute value + (ap3 mobile signal strength - ap3 analog signal strength * rad) absolute value + (ap4 mobile signal strength - ap4 analog signal strength * rad) absolute value + (ap5 mobile signal strength - ap5 analog signal strength * rad) absolute value.
[0050] Traverse 100*100 points, take the position of the minimum fit value as the point closest to the real mobile phone position.
[0051] Although the present application has been described in detail with general description and specific embodiments above, some modifications or improvements can be made on the basis of the present application, which is obvious to those skilled in the art. Therefore, these modifications or improvements made on the basis of not deviating from the spirit of the present application, all belong to the scope of the present application claimed.
Claims
1. A method for obtaining an indoor position based on WiFi positioning, characterized in that, Comprising the following steps: S1, installing ap, collecting data; S2, RSSI ranging; S3, obtaining terminal surrounding wifi signal strength distribution data; S31, obtaining the spatial coordinates of the strongest ap points in the surrounding area; S32, establishing a hypothetical area according to the spatial coordinates, determining the longitude and latitude variation range according to the spatial coordinates, obtaining the space area, dividing the space area along the longitude and latitude, and obtaining an array of multiple hypothetical position points; S4, judging the point closest to the real terminal position; S41, obtaining the distance between each hypothetical position point and the strongest signal point, and calculating the corresponding RSSI value to obtain the hypothetical signal strength distribution map; S42, finding the point closest to the real terminal position according to the fitting degree of the virtual point signal map and the real RSSI signal map; comprising calculating the fitting degree according to the RSSI signal of the ideal hypothetical position and the hypothetical signal strength distribution map, traversing multiple hypothetical position points, and taking the position with the smallest fitting value as the point closest to the real terminal position.
2. The method for obtaining indoor location based on WiFi positioning according to claim 1, characterized in that, S1 includes grouping mark data, collecting the GPS coordinates of each ap and the corresponding mac address, and establishing an ap information database.
3. The method for obtaining indoor location based on WiFi positioning according to claim 1 or 2, characterized in that, S2 includes signal strength ranging; a relationship function between received signal strength and signal transmission distance is established, and a propagation factor and received signal power are introduced.
4. The method for obtaining indoor location based on WiFi positioning according to claim 1, characterized in that, S31 includes scanning all available wifi point signals in the surrounding area and selecting the strongest multiple signal points to obtain a table of signal strength and corresponding ap.
5. The method of claim 1, wherein, In S32: according to the spatial coordinates of the ap points, taking the longitude and latitude variation range (minX, minY) and (maxX, maxY), obtaining the space area, setting a distance along the direction of the terminal in the space area, establishing a longitude and latitude coordinate system in the space area, and dividing according to the coordinate system, multiple array hypothetical position points are obtained after division, and the hypothetical position points are arranged adjacent to each other in the space area.
6. The method for obtaining indoor location based on WiFi positioning according to claim 3, characterized in that, The relationship function between the received signal strength PR and the signal transmission distance r is: received signal strength PR is equal to A-10・nlgr, A is the received signal power when the signal transmission is 1m far, and n is the propagation factor.
7. The method of claim 1, wherein, One or more aps are installed on each floor of the multi-storey building, and the height of each ap is the same.
Citation Information
Patent Citations
WiFi-based indoor positioning and verification system
CN110366103B
Indoor positioning method based on region segmentation and curve fitting
CN103379441A