Indoor positioning method, electronic equipment and computer readable storage medium

By screening and fitting RSSI values ​​with strong signal strength, combining particle filtering and KWNN algorithm, high-precision indoor positioning is achieved, solving the problems of high cost and poor adaptability in the existing technology, and improving the accuracy and adaptability of positioning.

CN120233302APending Publication Date: 2025-07-01SHENZHEN QIANHAI EVOC ASIA-PACIFIC ELECTRONIC EQUIP TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510383711.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision indoor positioning at a lower cost, and it is difficult to flexibly adapt to changing indoor environments.

Method used

By filtering out signals with RSSI values ​​greater than or equal to the preset threshold, the three RSSI values ​​with the strongest signal strength are further filtered out as target signals for positioning, fit the distance between the beacon and the position to be measured, the coordinates of the beacon are obtained, and the particle filtering algorithm and KWNN algorithm are used to determine the positioning coordinates of the position to be measured in the local map.

Benefits of technology

It improves the accuracy and adaptability of indoor positioning, reduces hardware costs, saves data processing and storage, and makes the positioning results more accurate and stable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120233302A_ABST
    Figure CN120233302A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of indoor positioning, and discloses an indoor positioning method, which comprises the following steps: acquiring a first target RSSI value of which the RSSI value is greater than or equal to a preset threshold value in a signal sent by a beacon; determining at most three of the first target RSSI values as second target RSSI values; fitting the distance between each target beacon corresponding to the second target RSSI value and the to-be-measured position according to the second target RSSI value; obtaining coordinates of each target beacon; when the number of the distances is three, obtaining a corresponding local map according to the coordinates of the beacons; respectively calculating first / second positioning coordinates by adopting a first / second algorithm; and determining the positioning coordinate of the to-be-measured position according to the first / second positioning coordinate. Through the above mode, the positioning accuracy and the applicability of the method are improved, the data processing amount is smaller, and the hardware cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of indoor positioning, and in particular, to an indoor positioning method, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the development of the Internet of Things technology and the wide application of mobile devices, location-based services have been popularized in all aspects of life. Among them, GPS (Global Positioning System) in the outdoor environment is widely used because of its easy implementation. Due to the blocking of satellite signals by buildings or obstacles and the complexity of the indoor environment, the accuracy of GPS is low and it cannot be applied to indoor positioning.

[0003] Currently, the commonly used indoor positioning technologies on the market include the AOA (Angle of Arrive) positioning method based on Bluetooth, the fingerprint database positioning method based on Bluetooth RSSI (Received Signal Strength Indicator), and the triangular positioning method based on Bluetooth RSSI ranging, etc. However, to implement a high-precision Bluetooth AOA positioning system requires more hardware investment (such as a multi-antenna system and a high-performance processor), thus increasing the overall cost of the hardware. When collecting fingerprint database data, if the positioning area is large, more and more complex data needs to be processed and stored. In addition, when there are significant changes in the environment of the positioning area, the fingerprint database data needs to be collected again, and it cannot flexibly adapt to the changing indoor area. For the triangular positioning technology based on Bluetooth RSSI, multipath effects and obvious signal attenuation often occur in complex environments, thus affecting the positioning accuracy. Summary of the Invention

[0004] In view of the above problems, the embodiments of the present application provide an indoor positioning method, an electronic device, and a computer-readable storage medium, which are used to solve the problem in the prior art that it is difficult to achieve high-precision indoor positioning at a low cost and adapt to the changing indoor environment at the same time.

[0005] According to one aspect of the embodiments of the present application, an indoor positioning method is provided. The method includes: obtaining the RSSI value of the signal emitted by a beacon, and determining a first target RSSI value in the RSSI values that is greater than or equal to a preset threshold; when the number of the first target RSSI values > 3, determining the 3 largest numerical values among the first target RSSI values as second target RSSI values, and when the number of the first target RSSI values ≤ 3, determining the first target RSSI values as the second target RSSI values; fitting, according to the second target RSSI values, the distance between each target beacon corresponding to the second target RSSI values and the position to be measured; obtaining the coordinates of each of the target beacons; when the number of the distances is 3, determining the target map area where the coordinates of the target beacons are located in a preset map as a local map, where the preset map includes a plurality of map areas; in the local map, using a first algorithm to determine a first positioning coordinate of the position to be measured according to the distances and the coordinates of the target beacons, and using a second algorithm to determine a second positioning coordinate of the position to be measured according to the distances and the coordinates of the target beacons; determining a positioning coordinate of the position to be measured according to the first positioning coordinate and the second positioning coordinate.

[0006] In an optional manner, the method further includes: respectively obtaining the sampled RSSI value of the signal emitted by a beacon within a preset distance from a sampling position, and the sampled distance between the sampling position and the beacon within the preset distance, where the distance between every two adjacent beacons is less than or equal to the preset distance; determining, among the sampled RSSI values, the sampled RSSI values that satisfy the 3σ principle as target sampled RSSI values; determining a target fitting formula according to the target sampled RSSI values, the sampled distances, and a preset fitting formula; the step of fitting, according to the second target RSSI values, the distance between each target beacon corresponding to the second target RSSI values and the position to be measured further includes: fitting, according to the target fitting formula and the second target RSSI values, the distance between each of the target beacons corresponding to the second target RSSI values and the position to be measured.

[0007] In an optional manner, the step of determining a positioning coordinate of the position to be measured according to the first positioning coordinate and the second positioning coordinate further includes: when the method is not executed for the first time, using a third algorithm to select one of the first positioning coordinate and the second positioning coordinate as a third positioning coordinate; performing filtering processing on the third positioning coordinate to obtain a positioning coordinate of the position to be measured.

[0008] In an alternative manner, when the method is not executed for the first time, screening one of the first positioning coordinate and the second positioning coordinate as the third positioning coordinate by using a third algorithm further includes: when the method is not executed for the first time, calculating the Euclidean distance between the first positioning coordinate and the positioning coordinate of the position to be measured obtained in the previous execution of the method to obtain a first Euclidean distance, and calculating the Euclidean distance between the second positioning coordinate and the positioning coordinate of the position to be measured obtained in the previous execution of the method to obtain a second Euclidean distance; comparing the numerical magnitudes of the first Euclidean distance and the second Euclidean distance; determining the first positioning coordinate or the second positioning coordinate corresponding to the smaller one of the first Euclidean distance and the second Euclidean distance as the third positioning coordinate.

[0009] In an alternative manner, determining the positioning coordinate of the position to be measured according to the first positioning coordinate and the second positioning coordinate further includes: when the method is executed for the first time, performing filtering processing on the first positioning coordinate to obtain the positioning coordinate of the position to be measured.

[0010] In an alternative manner, after obtaining the coordinates of each target beacon, the method further includes: when the number of the distances is 1 or 2, using the second algorithm to determine the second positioning coordinate of the position to be measured according to the distances and the coordinates of the target beacon; performing filtering processing on the second positioning coordinate to obtain the positioning coordinate of the position to be measured.

[0011] In an alternative manner, the multiple map regions of the preset map are stored in the form of a blacklist and a whitelist; the step of further determining the first positioning coordinate of the to-be-measured position according to the distance and the coordinates of the target beacon by using a first algorithm in the local map includes: randomly scattering f particles in the local map; determining whether there are unqualified particles that fall into the blacklist among the scattered particles, if there are unqualified particles that fall into the blacklist among the scattered particles, discard the unqualified particles, and randomly scatter new particles with the same number as the unqualified particles in the local map again, and repeat this step until there are no unqualified particles that fall into the blacklist among the scattered particles, so as to obtain f qualified particles that all fall into the whitelist; assigning the same weight to each of the qualified particles; making motion predictions for each of the f qualified particles within a preset maximum motion range to obtain the current coordinates of each qualified particle after motion, updating the weight of each qualified particle to the current weight according to the coordinates of the target beacon, the current coordinates of each qualified particle after motion, and the distance, performing f repeated samplings on the f qualified particles, and the number of particles for each repeated sampling is 1, repeating steps 2 to 4 for the f particles drawn, and determining the first positioning coordinate according to the current coordinates of the f particles and the current weights of the f particles obtained in the last execution of this step.

[0012] In an alternative manner, the step of further determining the second positioning coordinate of the to-be-measured position according to the distance and the coordinates of the target beacon by using the second algorithm includes: determining the weight of each target beacon according to the distance; determining the second positioning coordinate of the to-be-measured position according to the coordinates of the target beacon and the weight of the target beacon.

[0013] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the above indoor positioning method.

[0014] According to still another aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above indoor positioning method is implemented.

[0015] According to the indoor positioning method, electronic device, and computer-readable storage medium provided by the embodiments of the present application, during actual positioning, by pre-screening the first target RSSI values whose RSSI values are greater than or equal to a preset threshold, and further screening out the 3 RSSI values representing the strongest signal strength as the second target RSSI values for positioning, the positioning accuracy is initially improved. In addition, this method only needs to obtain the local map of the map area where the beacon corresponding to the screened RSSI value is located, without additionally obtaining the feature data of all beacons in the positioning area. When the positioning area changes, modifying the map data corresponding to the local map is smaller in terms of data processing volume and storage volume compared to the feature data of the newly added beacons. On the basis of improving the positioning accuracy, it has stronger adaptability, lower hardware requirements, and saves hardware costs. Finally, this method can obtain the final target positioning coordinates according to two sets of positioning coordinates obtained by two algorithms, namely the first algorithm and the second algorithm, improving the accuracy and stability of the positioning result.

[0016] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the embodiments of the present application more obvious and understandable, the following specifically gives the specific implementation manners of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings are only used to illustrate the embodiments and are not considered to be a limitation of the present application. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0018] Figure 1 Shows a schematic diagram of a Bluetooth-based AOA positioning technology in the related art;

[0019] Figure 2 Shows a schematic flowchart of the indoor positioning method provided by the embodiments of the present application;

[0020] Figure 3 Shows a schematic flowchart of the indoor positioning method provided by another embodiment of the present application;

[0021] Figure 4 Shows a schematic sub-step flowchart of the indoor positioning method provided by the embodiments of the present application;

[0022] Figure 5 Shows a schematic sub-flowchart of the indoor positioning method provided by the embodiments of the present application;

[0023] Figure 6 Shows a schematic sub-flowchart of the indoor positioning method provided by the embodiments of the present application;

[0024] Figure 7Shows a schematic diagram of a sub - process of the indoor positioning method provided by an embodiment of the present application;

[0025] Figure 8 Shows a flowchart of the indoor positioning method provided by another embodiment of the present application;

[0026] Figure 9 Shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0027] Hereinafter, the exemplary embodiments of the present application will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein.

[0028] With the development of society, people spend most of their time in indoor environments in daily life. And with the development of underground spaces, there are more and more places such as underground shopping malls, parking lots, and subways. In order to improve the accuracy of indoor positioning, currently, indoor positioning is mainly achieved through technologies such as Bluetooth - based AOA positioning technology, Bluetooth RSSI - based fingerprint database positioning technology, and Bluetooth RSSI - based ranging triangulation positioning technology.

[0029] As Figure 1 shown, the Bluetooth - based AOA positioning technology is a technology that uses the angle of signal arrival for positioning. It mainly uses multiple receivers to determine the direction of signal arrival, thereby achieving precise positioning. The transmitting device (such as a Bluetooth tag MS) emits a signal, and the receiving device (such as a Bluetooth base station) receives the signal through multiple antennas (BS1, BS2). According to the time difference and phase difference of the signal arriving at each antenna, the arrival angle of the signal can be calculated, and then the specific position of the tag can be determined using the triangulation algorithm. However, Bluetooth AOA positioning measures the angle based on the phase of the signal. In a non - line - of - sight environment, the signal reaches the base station in a reflected manner. When there are many obstacles in the indoor environment, the signal may be reflected multiple times, so that when it finally reaches the base station, the angle measured by the base station has a serious deviation from the real angle, affecting the positioning result. In addition, to implement a high - precision Bluetooth AOA positioning system or perform high - frequency signal analysis and processing through Bluetooth technology, more hardware costs (such as batteries with high battery life, multi - antenna systems, and high - performance processors) need to be invested, thus increasing the overall cost.

[0030] For indoor positioning based on Bluetooth RSSI fingerprint database, it is necessary to pre-collect data in the positioning area. Then, the b RSSI matrices corresponding to a beacons at each test point in this area are used as the feature data of each test point. After the feature data of all points are collected, a positioning fingerprint database is formed. During actual positioning, by comparing the actually measured RSSI with the fingerprint database, the nearest test point is found to achieve indoor positioning. However, when pre-collecting feature data, this method has a large workload, and when storing a relatively large amount of fingerprint databases, it has high requirements for hardware. When there is a new positioning area, it is necessary to additionally collect RSSI feature data in the new positioning area. When the environment of some positioning areas changes greatly, it is also necessary to re-collect the fingerprint database data of this positioning area. This method is difficult to flexibly apply to various changing indoor environments, and its application scenarios are relatively limited.

[0031] For the triangulation positioning technology based on RSSI ranging, it is necessary to obtain the RSSI value of the transmitting node (such as a tag), and the receiving node (such as a base station) calculates the loss of the signal during propagation according to the received RSSI value. Then, according to the signal propagation attenuation model, the signal loss is converted into a distance. Then, the positioning coordinates are calculated using the least squares method based on the distances between the tag and multiple base stations. However, in a complex environment, obstacles such as buildings and furniture indoors may cause obvious attenuation and multipath effects of the signal, making it difficult to calculate the real distance through the RSSI value, thus affecting the positioning accuracy. Moreover, due to the unstable signal propagation path, the RSSI value at the same position to be measured fluctuates greatly, and the positioning coordinates will have obvious jumps, affecting the reliability of the positioning result.

[0032] Based on this, in order to achieve high-precision indoor positioning at a relatively low cost and make the positioning method flexibly applicable to various indoor scenarios, the embodiments of this application provide an indoor positioning method. During actual positioning, by pre-screening the first target RSSI values whose RSSI values are greater than or equal to a preset threshold, and further screening out the 3 RSSI values representing the strongest signal intensity as the second target RSSI values for positioning, the positioning accuracy is initially improved. In addition, this method only needs to obtain the local map of the map area where the beacons corresponding to the screened RSSI values are located, without additionally obtaining the feature data of all beacons in the positioning area. When the area for positioning changes, modifying the map data corresponding to the local map is smaller in terms of data processing volume and storage compared to the feature data of the new beacons. On the basis of improving the positioning accuracy, it has stronger adaptability, lower requirements for hardware, and saves hardware costs. Finally, this method can obtain the final target positioning coordinates based on the two sets of positioning coordinates obtained by two algorithms, namely the first algorithm and the second algorithm, improving the accuracy and stability of the positioning result.

[0033] Figure 2The flowchart of the indoor positioning method provided by the embodiments of the present application is shown. This method is applied to electronic devices, such as terminal devices like mobile phones and tablets, and can also be Internet of Things devices such as smart watches, monitoring and detection devices, and positioning cards. It can also be devices in the field of industrial automation, such as robots and transportation devices integrated with Bluetooth signal receivers. As Figure 2 shown, the method includes the following steps.

[0034] Step S110: Obtain the RSSI value of the signal emitted by the beacon, and determine the first target RSSI value that is greater than or equal to the preset threshold in the RSSI values.

[0035] Specifically, first, deploy a number of beacons in the indoor area to be located (such as shopping malls, office buildings, indoor parking lots, etc.) and record the accurate position or coordinates of each beacon to provide accurate information for subsequent distance calculation and position estimation. When deploying beacons, the number and layout of beacons can be reasonably selected according to the requirements of the area size, coverage range, and positioning accuracy. The number of beacons can be appropriately increased in places with a larger area or higher positioning accuracy requirements.

[0036] The beacon can be a Bluetooth beacon, a frequency modulation wireless beacon, etc., which is used to identify the position or provide key information by emitting a specific radio signal. Before deploying the beacon, it is necessary to configure its position information (such as the coordinates of the beacon) for each beacon. These information can be stored in a database, a configuration file, or a hash table. These configuration information can include: the Media Access Control Address (MAC address) of the beacon, the coordinates of the beacon in space, and other relevant information (such as beacon type, signal strength, etc.). When the electronic device receives the signal emitted by the beacon, it will receive the MAC address of the beacon that emits the signal, and then match the received MAC address of the beacon with the pre-configured beacon information to obtain the coordinates of the beacon.

[0037] In the case where the beacons are deployed in advance, make a preliminary scan at multiple positions in the target area through the electronic device to obtain the RSSI value of the signal emitted by the beacon in the target area and the distribution of the RSSI value, and determine the preset threshold according to the distribution of the RSSI value.

[0038] The target area can be all or part of the indoor area to be located. In one implementation, the indoor area to be located is a five-story building. The target area can be all areas of one, two, or all five floors of the five-story building, or a partial area of one of the floors. The present application does not limit this.

[0039] To improve the benchmark of the preset threshold, it is usually necessary to perform positioning tests at multiple locations in the target area to obtain a sufficient number of RSSI values, so as to obtain the approximate distribution of the RSSI values of the signals in the target area, and determine the preset threshold according to this distribution.

[0040] In one implementation, first obtain the RSSI value of the signal received in the target area. The RSSI value is negative, and the smaller the absolute value of the RSSI value, the stronger the signal. Determine the opposite number of the value at the 60% - 80% position from small to large of the range of the absolute values of the obtained RSSI values of the signals as the preset threshold. For example, a total of 10 signals sent by beacons are collected in the target area, and the value range of the RSSI values of these 10 signals is [-90, -40]. Then take the opposite number -80 of the value 80 at the 80% position from small to large of the range [40, 90] as the preset threshold. When the calculation result of the preset threshold is a decimal, round this decimal to the nearest integer as the preset threshold.

[0041] In one implementation, when performing actual positioning, the electronic device receives a total of m signals sent by m beacons at the position to be measured, and screens out the RSSI values of m' signals whose RSSI values are greater than or equal to the preset threshold among the RSSI values of these m signals as the first target RSSI values.

[0042] Since the signal sent by the beacon will attenuate during propagation, the larger the RSSI value of the signal, the closer the distance between the beacon sending the signal and the position to be measured. In addition, generally, the RSSI signal values measured in a multipath environment interference environment are relatively weak, and using such RSSI values for distance fitting calculation has a large error. Therefore, preliminary screening of the received signals through the preset threshold can ensure that stronger RSSI values are used for subsequent positioning, thereby improving the positioning accuracy. Moreover, by collecting the beacon signal distribution in the target area multiple times, it can be avoided that the beacons corresponding to the signals collected once do not include all the optimal beacons. In this way, it can be ensured that the signals used for subsequent positioning are sent by non-multipath beacons that are closest to the position to be measured.

[0043] Step S120: When the number of the first target RSSI values > 3, determine the 3 with the largest numerical values among the first target RSSI values as the second target RSSI values. When the number of the first target RSSI values ≤ 3, determine the first target RSSI values as the second target RSSI values.

[0044] In some embodiments, if the number of m' RSSI values greater than or equal to a preset threshold screened out in S110 exceeds 3 (i.e., m' > 3), then the m' RSSI values are further screened, and the 3 RSSI values with the largest numerical values among the m' RSSI values are determined as the second target RSSI values, and the second target RSSI values are used for positioning in the subsequent positioning process.

[0045] In some embodiments, if the number of m' RSSI values greater than or equal to a preset threshold screened out in step S110 is less than or equal to 3 (i.e., m' ≤ 3), then these m' RSSI values are directly taken as the second target RSSI values for feeding into the subsequent positioning process for positioning.

[0046] In some embodiments, when performing actual positioning, the process of preprocessing the RSSI values through steps S110 - S120 includes: sending the RSSI values of m signals received at the position to be measured into a double-ended queue. If the length of the double-ended queue is greater than 3 (i.e., when m > 3), then the RSSI value at the head of the queue is dequeued to ensure that the queue records at most 3 RSSI values of the signals received at the position to be measured, limiting the amount of data stored in the queue and keeping the length of the queue not exceeding 3, so that the latest 3 RSSI values can be obtained when needed. Then, the RSSI values of the signals received within the target area are obtained, and the opposite of the value at the 60% - 80% position from small to large of the absolute value range of the obtained RSSI values of the signals is determined as the preset threshold. When the calculation result of the preset threshold is a decimal, the decimal is rounded to the nearest integer as the preset threshold. Subsequently, all the RSSI values in the double-ended queue are traversed, and the sizes of these RSSI values are compared with the preset threshold. Specifically, when a certain RSSI value is less than the preset threshold, the MAC address of the beacon corresponding to the RSSI value less than the preset threshold in the hash table where the RSSI value less than the preset threshold is located is deleted. When a certain RSSI value is greater than or equal to the preset threshold, the first target RSSI value greater than or equal to the preset threshold in the hash table is updated to the latest value. Finally, all the RSSI values in the finally updated hash table are taken into the same array, and then the RSSI values in the array are sorted according to the sizes of the RSSI values in the array, and the m' (m' ≤ 3) RSSI values with the largest RSSI values are selected as the second target RSSI values.

[0047] Due to certain hardware limitations, for example, the positioning cards currently available on the market can scan the signals emitted by at most 3 beacons each time. Moreover, when the number of RSSI values exceeds 3, it will affect the accuracy of subsequent positioning algorithms and increase unnecessary data calculation amounts. Therefore, by further screening the obtained RSSI values to ensure that the number of the second target RSSI values finally used for positioning does not exceed 3, it can ensure that the signals used for subsequent positioning are the signals emitted by the non-multipath and closest beacon to the position to be measured, making the positioning more accurate and applicable to most electronic devices, thereby improving the applicability of this method.

[0048] Furthermore, since the RSSI value of the signal emitted by a beacon is mainly related to the transmission power of the beacon and the receiving ability of the electronic device, and moreover, the preset threshold value used for preprocessing the RSSI value determined according to the distribution of the RSSI values usually only needs to take the classical value of the signal RSSI values in some areas as a reference. Therefore, even if the area where positioning is required changes greatly, the preset threshold value of this method can still continue to be applicable.

[0049] Step S130: Fit the distance between each target beacon corresponding to the second target RSSI value and the position to be measured according to the second target RSSI value.

[0050] Before actual positioning, it is also necessary to pre-determine the fitting relationship between the RSSI value of the signal and the distance. As Figure 3 shown, Figure 3 shows a schematic flowchart of an indoor positioning method provided by another embodiment of the present application. The indoor positioning method provided by the embodiment of the present application further includes the following steps.

[0051] Step S210: Respectively obtain the sampled RSSI values of the signals emitted by the beacons within a preset distance from the sampling position, and the sampled distance d between the sampling position and the beacons within the preset distance k , where the distance between each adjacent two beacons is less than or equal to the preset distance.

[0052] In some embodiments, the RSSI values are collected at different sampling positions, or the RSSI values of the signals emitted by the beacons within different preset distances are collected at the same sampling position.

[0053] In some embodiments, in the offline phase, it is first necessary to collect the signals emitted by beacons within a preset distance from the sampling position at the sampling position, and use the RSSI value of the collected signals as the sampling RSSI value. Among them, the preset distance can be 10 m, and the distance between every two adjacent beacons can be 5 - 8 m, so as to ensure that at least one beacon within the range of the preset distance from the sampling position can be received at the sampling position. In addition, the sampling position can be a selected known position or any non-selected position within the area to be located. The sampling distance d k is the actual distance between the beacon collected within the preset distance from the sampling position and the sampling position. The sampling distance d k can be directly calculated through the coordinates of the sampling position and the beacon position, or can be measured manually. For example, when the sampling position is a selected known point, that is, the coordinates of the sampling position are known, the sampling distance d between the sampling position and the beacon can be directly calculated according to the coordinates of the sampling position and the coordinates of the beacon within the preset distance k . When the coordinates of the sampling position are unknown, the position of the beacon can be obtained according to the coordinates of the beacon, and then the sampling distance d between the position where the beacon is located and the sampling position can be measured manually k .

[0054] Step S220: Determine the sampling RSSI value that satisfies the 3σ principle in the sampling RSSI values as the target sampling RSSI value

[0055] It should be understood that the 3σ principle indicates that for a set of data with a normal distribution, almost all data will fall within 3 standard deviations (σ) of the mean (μ) of this set of data, that is, the values of the data are almost all concentrated in the interval (μ - 3σ, μ + 3σ), and the possibility of exceeding this interval range is only less than 0.3%. In addition, it should also be understood that for a set of data with a non-normal distribution, there is also a corresponding "3σ" principle that can be adapted. For example, Chebyshev's inequality shows that even if the data does not follow a normal distribution, for example, for a unimodal distribution (i.e., a distribution with only one peak), at least 95% of the data will fall within the range of the mean ± 3 times the standard deviation. Under certain specific conditions, the probability that the data falls within the range of the mean ± 3 times the standard deviation may be higher, even close to 98%. Therefore, the 3σ principle can be used to detect outliers in a set of data

[0056] In some embodiments, the average value μ and variance σ of the collected sampled RSSI values are calculated. The average value μ can reflect the typical signal strength at the preset distance, while the variance σ can reflect the fluctuation of the signal strength. According to the calculated average value and variance, a sampling interval (μ - 3σ, μ + 3σ) is set to identify outliers. When there is a sampled RSSI value that does not fall into this sampling interval, the sampled RSSI value is considered an outlier and the outlier is discarded. Finally, the sampled RSSI values that conform to the 3σ principle (i.e., fall into the sampling interval) are selected as the target sampled RSSI values. In actual measurement, the sampled RSSI values can be collected at multiple positions and time periods to reduce the influence of environmental interference, which is not elaborated in this application.

[0057] Step S230: Determine the target fitting formula according to the target sampled RSSI value, the sampling distance, and the preset fitting formula.

[0058] In some embodiments, the fitting relationship between the distance between the position to be measured in the ideal state and the detected beacon and the RSSI value of the signal emitted by the beacon can be represented by the following preset fitting formula (Formula 1):

[0059]

[0060] Therefore, when actually performing positioning, the fitting relationship between the distance between the position to be measured and the detected beacon and the RSSI value of the signal emitted by the beacon can be represented by the following Formula 2:

[0061]

[0062] Where d is the distance between the position to be measured and the beacon calculated according to the preset fitting formula in the ideal state, is the distance between the sampling position and the beacon within the range of the preset distance from the sampling position scanned at the sampling position when actually executing this method, and the units are all meters. RSSI is the signal strength received at the position to be measured in the ideal state, and RSSI k is the target sampled RSSI value, and the unit is dBm. A represents the RSSI value at a distance d of 1 meter, which usually needs to be obtained through experimental measurement. In the ideal free space, the value of A depends on factors such as the transmission power of the beacon and the antenna gain of the received signal. n is the path loss exponent, which reflects the attenuation degree of the signal during propagation. Both A and n are fitting parameters, and the numerical values of A and n can be initially set in the preset fitting formula.

[0063] In some embodiments, the least squares method can be used to calculate the target fitting formula.

[0064] Specifically, according to all the target sampled RSSI values and the initially set A and n, calculate the distance fitted for each target sampled RSSI value according to Formula 2. Then calculate the distance fitted according to Formula 2. And the variance from the actually measured sampled distance d k is calculated, and this variance is used as the loss function L for the distance - RSSI value curve fitting, that is L can be expressed as a binary function of A and n, L = J(A, n). The loss function L represents the error between the fitted distance calculated according to Formula 2 and the actual distance. To minimize the error L value, it is necessary to calculate A and n such that and hold. In some embodiments, the gradient descent method is used to calculate the optimal values of A and n, and thus the optimal fitting parameters can be obtained.

[0065] Taking the optimal values of A and n in Formula 2 can determine the target fitting formula for actual positioning.

[0066] Step S130 includes: fitting the distance between each target beacon corresponding to the second - target RSSI value and the position to be measured according to the target fitting formula and the second - target RSSI value.

[0067] During actual positioning, there may be one or more finally - selected second - target RSSI values. It is necessary to substitute the finally - selected second - target RSSI values into the target fitting formula respectively, and fit the distance between each target beacon corresponding to the one or more second - target RSSI values and the position to be measured according to this target fitting formula.

[0068] According to the method provided by the embodiments of the present application, by pre - sampling signals in the area to be positioned, calculating the optimal values of the fitting parameters and the target fitting formula, the obtained RSSI values can be converted into distances more accurately, and the calculation process by the least - squares method is simpler than establishing a signal attenuation model.

[0069] Step S140: Obtain the coordinates of each target beacon.

[0070] In some embodiments, when an electronic device (such as a positioning card) scans a beacon at the position to be measured, it will also receive the MAC address of the beacon. Since the MAC address of each beacon has been bound to the coordinates of the beacon during the deployment of the beacon. Therefore, obtaining the MAC address of the scanned beacon can obtain the coordinates of the beacon.

[0071] Step S150: When the number of distances is 3, determine the target map area where the coordinates of the target beacon in the preset map are located as the local map, where the preset map includes multiple map areas.

[0072] In some embodiments, when actually implementing this method, it is also necessary to pre-store the map of the area to be located as a preset map in advance. The preset map can be in SVG format or pixel map. The preset map includes multiple map areas, and at least one coordinate of a beacon located in each area is bound to each map area. These map areas are stored in the form of a blacklist or a whitelist. Usually, the vertices' coordinates of a polygon in a two-dimensional coordinate system are used to define each black / white list to divide the preset map into areas.

[0073] In some embodiments, at least one coordinate of a beacon located in the black / white list is bound to each map area of the preset map. After determining the coordinate of the beacon corresponding to the second target RSSI value, the black / white list to which the beacon belongs can be queried, and the target map area where the beacon is located can be determined according to the black / white list.

[0074] After determining the target map area, the part of the preset map where the target map area is located is loaded from the cache, and this part of the preset map is determined as the local map.

[0075] For existing positioning technologies, the positioning results are usually presented to users in the form of a map, that is, in existing positioning technologies, it is necessary to pre-set the map of the area to be located in advance. When the area to be located changes greatly, such as adding a part of the area to be located, the indoor positioning method provided by the embodiments of this application only needs to update the map of the added area and bind the beacon coordinates of the added area to continue to apply the subsequent positioning steps, without the need to additionally divide grid points for the added area and collect the characteristic data of the RSSI value of each grid point like the fingerprint library positioning method. On the basis of improving the positioning accuracy by preprocessing the RSSI value of the signal and calculating the target fitting formula, this method greatly saves the data storage amount and calculation amount, has lower requirements for hardware, reduces the hardware cost, and in addition, greatly improves the applicability of this method, making this method applicable to more variable indoor scenarios.

[0076] Step S160: In the local map, use the first algorithm to determine the first positioning coordinate of the position to be measured according to the distance and the coordinate of the target beacon, and use the second algorithm to determine the second positioning coordinate of the position to be measured according to the distance and the coordinate of the target beacon.

[0077] In some embodiments, the first algorithm is a particle filter algorithm. The particle filter algorithm is a non-linear filtering algorithm based on the Monte Carlo method, which approximates the probability distribution through random sampling. When positioning an electronic device, the particle filter can be used to estimate the position and orientation of the electronic device in the map. Each particle represents a possible state, and gradually approaches the true state through prediction and update steps. The particle filter algorithm allows the selection of more than 3 coordinates and RSSI values for calculation. However, when the number of selected RSSI values exceeds 3, the problem of particle filter divergence is likely to occur, resulting in a decrease in the accuracy of the coordinates fitted by the particle filter. Therefore, when the number of the second target RSSI values / distances is 3, the particle filter algorithm is used to calculate the coordinates. On the basis of ensuring that the selected signals are the strongest 3 signals detected during positioning as much as possible, the calculation result of the algorithm can be made more accurate, further improving the positioning accuracy.

[0078] As Figure 4 shown, Figure 4 FIG. shows a schematic diagram of a sub-step process of the indoor positioning method provided by the embodiment of the present application. The step of using the first algorithm in the local map to determine the first positioning coordinates of the position to be measured according to the distance and the coordinates of the target beacon in step S160 further includes the following steps.

[0079] Step S161: Randomly scatter f particles in the local map.

[0080] Step S162: Determine whether there are unqualified particles that fall into the blacklist among the scattered particles. If there are unqualified particles that fall into the blacklist among the scattered particles, discard the unqualified particles, and randomly scatter new particles with the same number as the unqualified particles in the local map again. Repeat this step until there are no unqualified particles that fall into the blacklist among the scattered particles, so as to obtain f qualified particles that all fall into the white list.

[0081] Step S163: Assign the same weight to each qualified particle.

[0082] Step S164: Perform motion prediction on each of the f qualified particles within the preset maximum motion range to obtain the current coordinates of each qualified particle after motion. Update the weight of each qualified particle to the current weight according to the coordinates of the target beacon, the current coordinates of each qualified particle after motion, and the distance. Perform f repeated samplings on the f qualified particles, and the number of particles for each repeated sampling is 1. Repeat this step 2 to 4 times for the f particles extracted, and determine the first positioning coordinates according to the current coordinates and the current weights of the f particles obtained from the last execution of this step.

[0083] For the particle filter algorithm under local map constraints, first, particle initialization is required. At the initial moment, a set of random particles are generated to approximately represent the initial state distribution of the system. Therefore, f uniformly distributed particles need to be randomly scattered in the local map.

[0084] In the initialization stage of the particle filter, after f particles are scattered, the particle filter algorithm will determine whether each of the f particles falls into the blacklist. If there are g unqualified particles among the scattered particles that fall into the blacklist, the particle filter algorithm will discard these g unqualified particles and randomly generate g new particles again, that is, randomly scatter g new particles again. This process will be repeated until there are no unqualified particles that fall into the blacklist among the scattered particles, and these f particles that fall into the whitelist will be used as qualified particles. Among them, the blacklist usually represents areas where positioning is prohibited (such as walls, obstacles, or areas where users are prohibited from entering), and the whitelist usually represents areas where positioning is allowed (such as corridors, halls, etc., areas where users can enter).

[0085] The above process can ensure that the particles (i.e., possible estimated positions to be measured) only appear in areas where positioning is allowed, such as halls, and will not appear in areas where positioning is not allowed, such as walls or other obstacles, ensuring that the distribution of particles used in the subsequent steps of the particle filter algorithm conforms to the preset rules and constraints, improving the accuracy and effectiveness of the particle filter algorithm.

[0086] Subsequently, the same weight w is assigned to each qualified particle, and the initial calculation formula for the weight w is w = 1 / f.

[0087] After particle initialization, particle motion update is performed. That is, motion prediction is made for each qualified particle to update the current coordinates of each qualified particle after motion. Specifically, each qualified particle is made to perform anthropomorphic random motion, where the distance moved by each particle during random motion does not exceed the preset maximum distance d min , that is, the preset maximum motion range of the particle is (-d min , d min ), and the calculation formula for d min is: d min = average RSSI acquisition time * 1.5 m / s.

[0088] Then particle weight update is performed. The current coordinates of each particle after anthropomorphic random motion are obtained, and based on the coordinates of the target beacon and the current coordinates of each particle after anthropomorphic random motion, the Euclidean distance d beacon between the target beacon and each particle is calculated, and the weight of each particle is updated to where d i is the distance d i fitted from the i-th RSSI value among the 3 target sampled RSSI values.

[0089] After updating the weight of each particle, normalize the particle weights. The normalization formula is such that the sum of the weights of all particles is 1, where w i is the current weight of the i-th particle among f particles.

[0090] Furthermore, perform particle resampling. According to the updated weights above, randomly draw f particles.

[0091] In one implementation, randomly drawing particles can be achieved by generating random numbers. Specifically, for each particle with normalized weight, calculate the cumulative weight c i of each particle, that is, the cumulative weight c i of the i-th particle is equal to the sum of the normalized weights of the first i particles. Then generate a random number r from the interval [0, 1]. For each random number r, find the smallest i such that c i ≥ r, and then draw the i-th particle. By generating the random number r and comparing it with the cumulative weight c i , probability sampling can be performed based on the weights of the particles. The higher the weight of a particle, the greater the probability of being selected. Particles with low weights may also be selected, but the probability is relatively small. This method ensures that the drawing of particles is random. At the same time, the probability of each particle being drawn also conforms to the weight distribution of the particles.

[0092] Repeat the above random drawing process f times so that the number of drawn particles is the same as the number of initially scattered particles.

[0093] Repeat the above steps from particle motion update to particle resampling 2 to 4 times to update the particle weights multiple times.

[0094] Finally, according to the current coordinates (x i , y i ) of each particle among the f particles drawn in the last particle resampling step and the current weight w i of each particle, calculate the first positioning coordinate. The first positioning coordinate is calculated by the following formula 3.

[0095]

[0096] As Figure 5 shown, Figure 5 shows a schematic diagram of a sub-process of the indoor positioning method provided by the embodiment of the present application. In step S160, the second algorithm is used to determine the second positioning coordinate of the position to be measured according to the distance and the coordinates of the target beacon, and the following steps are further included.

[0097] Step S165: Determine the weight of each target beacon according to the distance.

[0098] Step S166: Determine the second positioning coordinates of the position to be measured according to the coordinates of the target beacon and the weight of the target beacon.

[0099] In some embodiments, the second algorithm is the KWNN (K-Weighted Nearest Node) algorithm. In this embodiment, in the KWNN algorithm, it is necessary to calculate the distance d fitted according to the i-th RSSI value in the target sampled RSSI values i Calculate the weight of the i-th target beacon Then, according to the coordinates (x i , y i ) of the i-th beacon multiplied by the weight and added to calculate the second positioning coordinates (x, y). The second positioning coordinates are calculated by the following formula 4, where k is the number of distances d fitted according to the target fitting formula.

[0100]

[0101] Step S170: Determine the positioning coordinates of the position to be measured according to the first positioning coordinates and the second positioning coordinates.

[0102] As Figure 6 shown, Figure 6 shows a schematic diagram of a sub-process of the indoor positioning method provided by the embodiment of the present application. Step S170 further includes the following steps.

[0103] Step S171: When the method is executed for non-first time, use the third algorithm to select one of the first positioning coordinates and the second positioning coordinates as the third positioning coordinates.

[0104] Step S172: Perform filtering processing on the third positioning coordinates to obtain the positioning coordinates of the position to be measured.

[0105] As Figure 7 shown, Figure 7 shows a schematic diagram of a sub-process of the indoor positioning method provided by the embodiment of the present application. Step S171 further includes the following steps.

[0106] Step S1711: When the method is executed for non-first time, calculate the Euclidean distance between the first positioning coordinates and the positioning coordinates of the position to be measured obtained by the previous execution of the method to obtain the first Euclidean distance, and calculate the Euclidean distance between the second positioning coordinates and the positioning coordinates of the position to be measured obtained by the previous execution of the method to obtain the second Euclidean distance.

[0107] Step S1712: Compare the numerical magnitudes of the first Euclidean distance and the second Euclidean distance.

[0108] Step S1713: Determine the third positioning coordinate as the first positioning coordinate or the second positioning coordinate corresponding to the smaller one of the first Euclidean distance and the second Euclidean distance in terms of numerical value.

[0109] In some embodiments, the third algorithm is a greedy algorithm. A greedy algorithm is an algorithm that makes the optimal (i.e., most favorable) choice at each step of the selection, hoping to obtain a globally optimal solution ultimately.

[0110] In the embodiments of the present application, since two sets of coordinates are obtained according to the particle filter algorithm and the KWNN algorithm simultaneously, it is necessary to select the better one from these two sets of coordinates, that is, the more accurate third positioning coordinate.

[0111] When this method is executed not for the first time, calculate the first Euclidean distance between the first positioning coordinate (X PF , Y PF ) obtained by executing this method this time and the final positioning coordinate (X KF , Y KF ) obtained by executing this method last time and calculate the second Euclidean distance between the second positioning coordinate (X KWNN , Y KWNN ) obtained by executing this method this time and the final positioning coordinate (X KF , Y KF ) obtained by executing this method last time

[0112]

[0113] Subsequently, compare the magnitudes of the first Euclidean distance d PF and the second Euclidean distance d KWNN , and select the first positioning coordinate or the second positioning coordinate corresponding to the smaller Euclidean distance in terms of numerical value between d PF and d KWNN as the third positioning coordinate.

[0114] The greedy algorithm of this method selects a more accurate positioning coordinate by comparing the first / second Euclidean distances. The Euclidean distance between the position to be measured during this positioning and the final positioning position obtained by executing this method last time can intuitively reflect the straight-line distance between the two positions in space. In this method, the smaller the Euclidean distance, the closer the straight-line distance between the two positions. For example, if the numerical value of the first Euclidean distance is smaller, it means that the first positioning coordinate obtained by this positioning has a smaller error and less jitter compared with the previous positioning result, and is more likely to be the true coordinate of the current position to be measured. In addition, the calculation formula of the Euclidean distance is simple, easy to implement and calculate, further saving the hardware cost.

[0115] For the indoor positioning method provided by this application, when the number of distances is 3, the first algorithm and the second algorithm are simultaneously used for positioning, and the greedy algorithm is used to further select more accurate positioning coordinates, effectively improving the positioning accuracy.

[0116] In some embodiments, since the third positioning coordinate selected according to the greedy algorithm may have jumps, the third positioning coordinate needs to be filtered to make the positioning result smooth. Specifically, step S172 can use Kalman filtering to filter the third positioning coordinate. The core idea of Kalman filtering is to optimally estimate the system state recursively by combining the dynamic model and the observation model of the system.

[0117] To make the positioning coordinates conform to the human motion trajectory, a human motion model can be set. In the Kalman filtering algorithm, the human motion model can be written in the form of the following matrix multiplication:

[0118]

[0119] Denote this matrix equation as:

[0120] X k+1 =FX k +BU k +W k

[0121] where, X k+1 is the state vector at time k + 1, F is the state transition matrix, X k is the state vector at time k, B is the control input matrix, U k is the external control input, W k is the process noise, assumed to be Gaussian white noise with covariance matrix Q.

[0122] Mapping the state to the observation space, the following formula 5 is obtained:

[0123] Z k =HX k +V k (Formula 5)

[0124] where Z k is the observation vector, H is the observation matrix, V k is the observation noise, assumed to be Gaussian white noise with covariance matrix R. For this model, only the position is measured, and the observation matrix H can be expressed as:

[0125]

[0126] Before each update, first predict the state at the current moment based on the state estimate and the state transition equation at the previous moment to obtain the predicted state:

[0127]

[0128] and the predicted state covariance:

[0129]

[0130] When a new measurement is obtained, use this measurement to update the Kalman gain of the predicted state estimate:

[0131]

[0132] Then update the state estimate:

[0133]

[0134] And update the state covariance:

[0135]

[0136] By performing Kalman filtering on the first positioning coordinate or the second positioning coordinate, the historical coordinate trajectory can be made to conform to anthropomorphic motion, avoiding coordinate jumps, so that the coordinate trajectory is smooth and reasonable.

[0137] Step S170 further includes the step of: when the method is executed for the first time, filtering the first positioning coordinate to obtain the positioning coordinate of the position to be measured.

[0138] When the method is executed for the first time, since the final positioning coordinate obtained from the previous execution of the method is missing, the first Euclidean distance or the second Euclidean distance cannot be calculated. At this time, directly perform Kalman filtering on the first positioning coordinate obtained by the particle filter algorithm as in step S172, and use the filtered result as the finally output positioning coordinate.

[0139] As Figure 8 shown, Figure 8 shows a flowchart of an indoor positioning method provided by another embodiment of the present application. Since the number of preprocessed RSSI values may be only one or two, if the particle filter algorithm is used, the error is relatively large. Therefore, in the method provided by the embodiment of the present application, after step S140: obtaining the coordinates of each target beacon, the method further includes the following steps.

[0140] Step S180: When the number of distances is one or two, use the second algorithm to determine the second positioning coordinate of the position to be measured according to the distances and the coordinates of the target beacons.

[0141] Step S190: Filter the second positioning coordinate to obtain the positioning coordinate of the position to be measured.

[0142] When only one or two signals are received in the indoor positioning method provided by the embodiment of the present application, that is, when the number of distances d fitted according to the second target RSSI value is only one or two, the particle filter algorithm cannot be applied. Therefore, the second algorithm (such as the KWNN algorithm) is directly used for positioning. The specific calculation method refers to the above steps S165 - S166 and will not be elaborated here.

[0143] This method overcomes the problem that it is difficult to position through the first algorithm (such as the particle filter algorithm) when fewer beacon signals are received, enabling the electronic device to perform relatively accurate positioning regardless of whether the number of beacon signals received is large or small, making this method applicable to more positioning situations and improving the applicability of this method.

[0144] In the indoor positioning method provided by the embodiment of the present application, during actual positioning, the first target RSSI values with RSSI values greater than or equal to the preset threshold are pre-screened, and further, the 3 RSSI values representing the strongest signal intensity are selected as the second target RSSI values for positioning to initially improve the positioning accuracy. In addition, this method only needs to obtain the local map of the map area where the beacons corresponding to the screened RSSI values are located, without the need to additionally obtain the feature data of all beacons in the positioning area. When the positioning area changes, modifying the preset map with respect to the feature data of the newly added beacons requires less data processing and storage. On the basis of improving the positioning accuracy, it has stronger adaptability, lower hardware requirements, and saves hardware costs. Finally, this method can obtain the final target positioning coordinates based on the two sets of positioning coordinates obtained by the first algorithm and the second algorithm, improving the accuracy and stability of the positioning result.

[0145] As Figure 9 shown, the embodiment of the present application provides an electronic device 300, which may include: a processor 301 and a memory 302.

[0146] Among them, the memory 302 is used to store a computer program 303. The memory 302 may include a high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory. The computer program 303 may include computer-executable instructions.

[0147] The processor 301 is used to execute the computer program 303 to implement the above indoor positioning method embodiment.

[0148] The processor 301 may be a central processing unit (CPU), or a specific application integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the control device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.

[0149] The embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the embodiments of the above indoor positioning method are implemented.

[0150] In several embodiments provided in the present application, if any function is implemented in the form of a software functional module / unit and sold or used as an independent product, it may be stored in the computer-readable storage medium. Based on such an understanding, part or all of the technical solutions of the present application may be embodied in the form of a software product. The computer-readable storage medium includes several instructions for causing a computer device (which may be an electronic device such as a personal computer, a server, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: various media that can store computer program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.

[0151] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems may also be used in conjunction with the teachings based herein. The structure required to construct such a system will be apparent from the above description. In addition, the embodiments of the present application are not directed to any particular programming language. It should be understood that the content of the present application described herein can be implemented using various programming languages, and the description of the specific language above is for the purpose of disclosing the best mode of the present application.

[0152] It should be noted that the above embodiments are illustrative of the present application rather than restrictive of the present application, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a claim listing several devices, several units or modules of these devices may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

[0153] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. An indoor positioning method, characterized in that: The method comprises: Obtaining RSSI values ​​of signals emitted by the beacon, and determining a first target RSSI value among the RSSI values ​​that is greater than or equal to a preset threshold; When the number of the first target RSSI values ​​is greater than 3, the three largest values ​​among the first target RSSI values ​​are determined as second target RSSI values; when the number of the first target RSSI values ​​is less than or equal to 3, the first target RSSI value is determined to be the second target RSSI value; Fitting the distance between each target beacon corresponding to the second target RSSI value and the position to be measured according to the second target RSSI value; Obtaining the coordinates of each of the target beacons; When the number of the distances is 3, determining the target map area where the coordinates of the target beacon in the preset map are located as the local map, wherein the preset map includes a plurality of map areas; In the local map, a first algorithm is used to determine the first positioning coordinates of the position to be measured according to the distance and the coordinates of the target beacon, and a second algorithm is used to determine the second positioning coordinates of the position to be measured according to the distance and the coordinates of the target beacon; The positioning coordinates of the position to be measured are determined according to the first positioning coordinates and the second positioning coordinates.

2. The method according to claim 1, characterized in that The method further comprises: Respectively obtain the sampled RSSI values ​​of the signals emitted by the beacons within a preset distance from the sampling position, and the sampling distance between the sampling position and the beacons within the preset distance, wherein the distance between each two adjacent beacons is less than or equal to the preset distance; Determine, among the sampled RSSI values, a sampled RSSI value that satisfies the 3σ principle as a target sampled RSSI value; Determine a target fitting formula according to the target sampled RSSI value, the sampling distance and a preset fitting formula; The step of fitting the distance between each target beacon corresponding to the second target RSSI value and the position to be measured according to the second target RSSI value further includes: The distance between each of the target beacons and the position to be measured corresponding to the second target RSSI value is fitted according to the target fitting formula and the second target RSSI value.

3. The method according to claim 1 or 2, characterized in that: The determining the positioning coordinates of the position to be measured according to the first positioning coordinates and the second positioning coordinates further includes: When the method is not performed for the first time, a third algorithm is used to select one of the first positioning coordinates and the second positioning coordinates as a third positioning coordinate; The third positioning coordinates are filtered to obtain the positioning coordinates of the position to be measured.

4. The method according to claim 3, characterized in that: When the method is not performed for the first time, selecting one of the first positioning coordinates and the second positioning coordinates as the third positioning coordinates by using a third algorithm further includes: When the method is not executed for the first time, the Euclidean distance between the first positioning coordinate and the positioning coordinate of the position to be measured obtained by the last execution of the method is calculated to obtain a first Euclidean distance, and the Euclidean distance between the second positioning coordinate and the positioning coordinate of the position to be measured obtained by the last execution of the method is calculated to obtain a second Euclidean distance; Comparing the numerical values ​​of the first Euclidean distance and the second Euclidean distance; The first positioning coordinate or the second positioning coordinate corresponding to the first Euclidean distance or the second Euclidean distance with a smaller value between the first Euclidean distance and the second Euclidean distance is determined as the third positioning coordinate.

5. The method according to claim 1 or 2, characterized in that: The determining the positioning coordinates of the position to be measured according to the first positioning coordinates and the second positioning coordinates further includes: When the method is executed for the first time, the first positioning coordinates are filtered to obtain the positioning coordinates of the position to be measured.

6. The method according to claim 1, characterized in that After acquiring the coordinates of each of the target beacons, the method further includes: When the number of the distances is 1 or 2, using the second algorithm to determine the second positioning coordinates of the position to be measured according to the distance and the coordinates of the target beacon; The second positioning coordinates are filtered to obtain the positioning coordinates of the position to be measured.

7. The method according to claim 1, characterized in that The plurality of map areas of the preset map are stored in the form of a blacklist and a whitelist; The step of using a first algorithm in the local map to determine the first positioning coordinates of the position to be measured according to the distance and the coordinates of the target beacon further includes: Randomly scatter f particles in the local map; Determine whether there are unqualified particles in the blacklist among the scattered particles. If there are unqualified particles in the blacklist among the scattered particles, discard the unqualified particles, and randomly scatter new particles with the same number as the unqualified particles in the local map again. Repeat this step until there are no unqualified particles in the blacklist among the scattered particles, so as to obtain f qualified particles that all fall into the whitelist. Assigning an equal weight to each of the qualified particles; Motion prediction is performed for each of the f qualified particles within a preset maximum motion range to obtain the current coordinates of each qualified particle after movement, the weight of each qualified particle is updated to the current weight according to the coordinates of the target beacon, the current coordinates of each qualified particle after movement, and the distance, the f qualified particles are repeatedly sampled f times, and the number of particles in each repeated sampling is 1, this step is repeatedly performed 2 to 4 times for the f particles extracted, and the first positioning coordinates are determined according to the current coordinates of the f particles obtained by the last execution of this step and the current weights of the f particles.

8. The method according to claim 6, characterized in that The step of using the second algorithm to determine the second positioning coordinates of the position to be measured according to the distance and the coordinates of the target beacon further includes: Determining a weight of each of the target beacons according to the distance; The second positioning coordinates of the position to be measured are determined according to the coordinates of the target beacon and the weight of the target beacon.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the indoor positioning method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the indoor positioning method according to any one of claims 1 to 8 is implemented.