Positioning method based on weight factor and WKNN
By adopting a positioning method based on weight factor and WKNN in Bluetooth positioning scenarios, using grid structure and signal data of multiple positioning initial reference points, the problem of low positioning coordinate accuracy in existing Bluetooth positioning technology is solved, and the Higher positioning accuracy and stability.
Patent Information
- Application Number
- CN202411560972.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-04
AI Technical Summary
In the existing Bluetooth positioning technology, the RSSI value is susceptible to environmental obstacles, multipath effect and signal interference, resulting in low accuracy of positioning coordinates.
Using a positioning method based on weight factor and WKNN, a Bluetooth signal network covering the entire site is established by dividing the preset site into a grid structure and setting the initial reference point of positioning at each grid node. Using multiple positioning initial reference points and signal strength data of Bluetooth positioning beacons, the actual coordinates of the to-position point are calculated to improve positioning accuracy.
By integrating the signal strength data of multiple reference points, and calculating the position of the to-position point using the weighted average method, the accuracy and stability of Bluetooth positioning are significantly improved and the impact of environmental noise on the positioning results is reduced.
Smart Images

Figure CN119450357A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Bluetooth positioning technology, and in particular to a positioning method based on weight factors and WKNN. Background Art
[0002] Positioning technology is widely used in aerospace, communication and navigation and other fields. Positioning technology is mainly divided into outdoor positioning and indoor positioning. In the field of indoor positioning technology, due to the relatively weak penetration of satellites, outdoor positioning and navigation systems such as GPS cannot achieve accurate positioning indoors, so a series of indoor positioning technologies have emerged, such as Bluetooth positioning, WIFI positioning, UWB positioning, ZigBee positioning, infrared positioning, RFID positioning, etc. Bluetooth positioning is widely used in the field of indoor positioning because of its advantages of low power consumption and easy integration.
[0003] At present, Bluetooth positioning technology mainly uses the signal strength indication (RSSI) method, which measures the RSSI values of multiple Bluetooth beacons received by the point to be located, and uses the signal attenuation model or the pre-established RSSI fingerprint database to estimate the specific location of the point to be located. However, the RSSI value is easily affected by obstacles, multipath effects and signal interference in the environment, and due to the limitation that the RSSI value is nonlinearly related to the distance, the calculated coordinates of the point to be located have a large deviation from the actual coordinates.
[0004] Therefore, how to improve the accuracy of the coordinates of the points to be located using Bluetooth positioning has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a positioning method, system, electronic device and storage medium based on weight factors and WKNN, which can improve the accuracy of the coordinates of the points to be located in Bluetooth positioning measurement.
[0006] In a first aspect, the present application provides a positioning method based on weight factors and WKNN, the method comprising: dividing the preset site into a grid structure, and setting an initial positioning reference point at the node of each grid; setting multiple Bluetooth positioning beacons in the preset site, the Bluetooth positioning beacons being used to send Bluetooth signals to multiple initial positioning reference points and points to be positioned; obtaining a first coordinate corresponding to each of the initial positioning reference points, and obtaining multiple first received signal strength indication values received by each of the initial positioning reference points; obtaining multiple second received signal strength indication values received by the point to be positioned; and obtaining the actual coordinates corresponding to the point to be positioned based on multiple first coordinates, multiple first received signal strength indication values, and multiple second received signal strength indication values.
[0007] By adopting the above technical solution, by dividing the preset site into a grid structure and setting the initial positioning reference point at the node of each grid, it is ensured that the initial positioning reference point is evenly distributed in the entire preset site, so that the signal acquisition coverage is comprehensive. By setting multiple Bluetooth positioning beacons in the preset site, the Bluetooth positioning beacons are used to send Bluetooth signals to multiple initial positioning reference points and points to be positioned, thereby establishing a Bluetooth signal network covering the entire site. By obtaining the first coordinates corresponding to each initial positioning reference point and obtaining the multiple first received signal strength indication values received by each initial positioning reference point, a detailed fingerprint database is formed. By obtaining the multiple second received signal strength indication values received by the point to be positioned, real-time signal strength data of the point to be positioned is provided. By obtaining the actual coordinates corresponding to the point to be positioned based on multiple first coordinates, multiple first received signal strength indication values and multiple second received signal strength indication values, high-precision indoor positioning is achieved to improve the accuracy of the coordinates of the point to be positioned by Bluetooth positioning measurement.
[0008] Optionally, obtaining the actual coordinates corresponding to the point to be located based on multiple first coordinates, multiple first received signal strength indication values, and multiple second received signal strength indication values specifically includes: determining a preset number of actual positioning reference points from multiple initial positioning reference points based on multiple first coordinates, multiple first received signal strength indication values, and multiple second received signal strength indication values; determining the second coordinates corresponding to each of the actual positioning reference points; and obtaining the actual coordinates based on multiple second coordinates.
[0009] By adopting the above technical solution, a preset number of actual positioning reference points are determined from multiple initial positioning reference points based on multiple first coordinates, multiple first received signal strength indicator values, and multiple second received signal strength indicator values, thereby screening out reference points with signal strengths closest to the point to be positioned. By determining the second coordinates corresponding to each actual positioning reference point, accurate benchmark data is provided for subsequent positioning calculations. By obtaining the actual coordinates based on multiple second coordinates, high-precision positioning of the point to be positioned is achieved. By integrating the coordinate information of multiple actual reference points and using the weighted average method, the position of the point to be positioned can be accurately calculated.
[0010] Optionally, the determining a preset number of actual positioning reference points from a plurality of the initial positioning reference points based on a plurality of the first coordinates, a plurality of the first received signal strength indication values, and a plurality of the second received signal strength indication values specifically includes: determining a weight factor corresponding to each of the initial positioning reference points based on each of the first received signal strength indication values; calculating a first Euclidean distance between the point to be located and each of the initial positioning reference points based on the plurality of the weight factors, a plurality of the second received signal strength indication values, and a plurality of the first received signal strength indication values; sorting each of the first Euclidean distances to obtain a sorting result; and determining a preset number of actual positioning reference points from the plurality of the initial positioning reference points based on the sorting result.
[0011] By adopting the above technical solution, the weight factor corresponding to each initial positioning reference point is determined based on each first received signal strength indicator value, so that the signal strength of each reference point and its contribution to the positioning result can be accurately reflected. By calculating the first Euclidean distance between the point to be positioned and each initial positioning reference point based on multiple weight factors, multiple second received signal strength indicator values and multiple first received signal strength indicator values, the similarity between the point to be positioned and each reference point can be quantified. By sorting each first Euclidean distance, a sorting result is obtained, so that the reference point closest to the point to be positioned can be effectively screened out. By determining a preset number of actual positioning reference points from multiple initial positioning reference points based on the sorting result, the most useful reference points can be screened out, the calculation complexity is reduced, and the positioning efficiency and accuracy are improved.
[0012] Optionally, obtaining the actual coordinates based on multiple second coordinates specifically includes: determining the second Euclidean distance between each of the actual reference points for positioning and the point to be positioned; obtaining a weight parameter corresponding to each of the actual reference points for positioning based on each of the second Euclidean distances; and obtaining the actual coordinates based on multiple second coordinates and multiple weight parameters.
[0013] By adopting the above technical solution, by determining the second Euclidean distance between each actual reference point to be positioned and the point to be positioned, the signal strength difference between the point to be positioned and each actual reference point can be accurately measured. By obtaining the weight parameters corresponding to each actual reference point based on each second Euclidean distance, the influence of each reference point in the final positioning calculation can be reasonably allocated. The introduction of weight parameters ensures that reference points closer to the point to be positioned obtain greater weights, further improving the accuracy and reliability of the positioning calculation. By obtaining the actual coordinates based on multiple second coordinates and multiple weight parameters, high-precision positioning of the point to be positioned is achieved. The coordinates of each reference point and its corresponding weight parameters are combined, and the actual coordinates of the point to be positioned are calculated by weighted averaging. The influence of the single reference point error is effectively reduced, the accuracy and stability of the positioning results are enhanced, and the reliability of the system in various environments is ensured.
[0014] Optionally, determining the weight factor corresponding to each of the initial positioning reference points based on each of the first received signal strength indication values specifically includes: calculating the weight factor corresponding to each of the initial positioning reference points by using the following formula: in, is the weight factor between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, is the first received signal strength indicator value between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, and N is the number of the positioning initial reference points.
[0015] Optionally, obtaining the weight parameter corresponding to each of the actual positioning reference points based on each of the second Euclidean distances specifically includes: calculating the weight parameter corresponding to each of the actual positioning reference points by using the following formula: Wherein, k is the number of actual reference points for positioning, w j is the weight parameter corresponding to the jth actual reference point, d j is the second Euclidean distance between the jth actual positioning reference point and the point to be positioned.
[0016] Optionally, obtaining the actual coordinate based on the plurality of second coordinates and the plurality of weight parameters specifically includes: calculating the actual coordinate by the following formula: Wherein, k is the number of actual reference points for positioning, (X, Y) is the actual coordinate, and w j is the weight parameter corresponding to the jth actual positioning reference point, (x j ,y j ) is the second coordinate corresponding to the jth actual positioning reference point.
[0017] In a second aspect of the present application, a positioning system based on weight factors and WKNN is provided, the system comprising: a processing module and an acquisition module; the processing module is used to divide the preset site into a grid structure and set an initial positioning reference point at the node of each grid; the processing module is also used to set multiple Bluetooth positioning beacons in the preset site, and the Bluetooth positioning beacons are used to send Bluetooth signals to multiple initial positioning reference points and points to be positioned; the acquisition module is used to obtain the first coordinates corresponding to each of the initial positioning reference points, and obtain the multiple first received signal strength indication values received by each of the initial positioning reference points; the acquisition module is also used to obtain the multiple second received signal strength indication values received by the point to be positioned; the processing module is also used to obtain the actual coordinates corresponding to the point to be positioned based on the multiple first coordinates, the multiple first received signal strength indication values and the multiple second received signal strength indication values.
[0018] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any method as described in the first aspect of the present application.
[0019] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the method as described in any one of the first aspects of the present application.
[0020] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. By dividing the preset site into a grid structure and setting the initial positioning reference point at the node of each grid, it is ensured that the initial positioning reference points are evenly distributed throughout the preset site, so that the signal collection coverage is comprehensive. By setting multiple Bluetooth positioning beacons in the preset site, the Bluetooth positioning beacons are used to send Bluetooth signals to multiple initial positioning reference points and points to be positioned, thereby establishing a Bluetooth signal network covering the entire site. By obtaining the first coordinates corresponding to each initial positioning reference point and obtaining the multiple first received signal strength indication values received by each initial positioning reference point, a detailed fingerprint database is formed. By obtaining the multiple second received signal strength indication values received by the point to be positioned, real-time signal strength data of the point to be positioned is provided. By obtaining the actual coordinates corresponding to the point to be positioned based on multiple first coordinates, multiple first received signal strength indication values and multiple second received signal strength indication values, high-precision indoor positioning is achieved to improve the accuracy of the coordinates of the point to be positioned measured by Bluetooth positioning.
[0021] 2. By determining a preset number of actual positioning reference points from multiple initial positioning reference points based on multiple first coordinates, multiple first received signal strength indicator values, and multiple second received signal strength indicator values, the reference point with the closest signal strength to the point to be positioned is screened out. By determining the second coordinates corresponding to each actual positioning reference point, accurate benchmark data is provided for subsequent positioning calculations. By obtaining the actual coordinates based on multiple second coordinates, high-precision positioning of the point to be positioned is achieved. By integrating the coordinate information of multiple actual reference points and using the weighted average method, the position of the point to be positioned can be accurately calculated.
[0022] 3. By determining the weight factor corresponding to each initial positioning reference point based on each first received signal strength indicator value, the signal strength of each reference point and its contribution to the positioning result can be accurately reflected. By calculating the first Euclidean distance between the point to be positioned and each initial positioning reference point based on multiple weight factors, multiple second received signal strength indicator values and multiple first received signal strength indicator values, the similarity between the point to be positioned and each reference point can be quantified. By sorting each first Euclidean distance to obtain a sorting result, the reference point closest to the point to be positioned can be effectively screened out. By determining a preset number of actual positioning reference points from multiple initial positioning reference points based on the sorting result, the most useful reference points can be screened out, the calculation complexity can be reduced, and the positioning efficiency and accuracy can be improved.
[0023] 4. By determining the second Euclidean distance between each actual reference point and the point to be located, the signal strength difference between the point to be located and each actual reference point can be accurately measured. By obtaining the weight parameters corresponding to each actual reference point based on each second Euclidean distance, the influence of each reference point in the final positioning calculation can be reasonably allocated. The introduction of weight parameters ensures that reference points closer to the point to be located obtain greater weights, further improving the accuracy and reliability of the positioning calculation. By obtaining the actual coordinates based on multiple second coordinates and multiple weight parameters, high-precision positioning of the point to be located is achieved. The coordinates of each reference point and its corresponding weight parameters are combined to calculate the actual coordinates of the point to be located by weighted averaging. The influence of a single reference point error is effectively reduced, the accuracy and stability of the positioning results are enhanced, and the reliability of the system in various environments is ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is one of the flow charts of a positioning method based on weight factor and WKNN provided in an embodiment of the present application; Figure 2 This is a schematic diagram of a scene of a Bluetooth positioning beacon, an initial positioning reference point, and a point to be positioned provided in an embodiment of the present application. Figure 3 This is the second flow chart of a positioning method based on weight factor and WKNN provided in an embodiment of the present application; Figure 4 This is a flowchart of a positioning method based on weight factors and WKNN provided in an embodiment of the present application; Figure 5 This is a fourth flow chart of a positioning method based on weight factors and WKNN provided in an embodiment of the present application; Figure 6 is a structural diagram of a positioning system based on weight factors and WKNN provided in an embodiment of the present application; Figure 7 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0025] Explanation of the reference numerals: 1. Processing module; 2. Acquisition module; 700. Electronic device; 701. Processor; 702. Communication bus; 703. User interface; 704. Network interface; 705. Memory. DETAILED DESCRIPTION
[0026] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0027] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0028] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0029] This application provides a positioning method based on weight factor and WKNN, referring to Figure 1 , which shows one of the flow diagrams of a positioning method based on weight factors and WKNN provided in an embodiment of the present application. The method includes steps S1-S5, which are as follows: Step S1: Divide the preset site into a grid structure, and set an initial positioning reference point at each grid node.
[0030] In the present invention, step S1 is to divide the preset site into a grid structure and set an initial positioning reference point at each node of the grid. The implementation of this step is of great significance to the accuracy and efficiency of the entire positioning system.
[0031] First, the preset site is divided into a grid structure. The purpose of this is to systematically cover the entire positioning area and ensure that the Bluetooth signal can be evenly distributed and collected throughout the site. By dividing the site into regular grids, the information of each grid node can be easily managed and recorded, thus providing an accurate data basis for subsequent positioning calculations.
[0032] In the specific implementation process, the size and shape of the grid must first be determined. Generally, a square or rectangular grid is used. According to the actual size of the site, it is divided into several small grid units. The size of each unit can be set according to the specific conditions of the site and the positioning accuracy requirements. For example, if the site is large and high-precision positioning is required, a smaller grid unit can be used.
[0033] Set the initial positioning reference point at each grid node. The initial positioning reference point is set to effectively collect the received signal strength indication (RSSI) value at the grid node. These reference points will be used as data collection points in the offline phase. At each initial positioning reference point, record its corresponding first coordinate, that is, the precise position of the reference point in the preset site. In order to ensure the accuracy of the coordinate data of the reference point, it is necessary to use high-precision measurement tools to measure and calibrate it.
[0034] By setting the initial positioning reference points in the preset venue, a reference point network covering the entire venue can be formed. These reference points will be used to receive signals from Bluetooth positioning beacons and record their received signal strength indicator values. These data will be used to calculate the actual coordinates of the points to be positioned in subsequent steps.
[0035] Step S2: multiple Bluetooth positioning beacons are set in a preset venue, and the Bluetooth positioning beacons are used to send Bluetooth signals to multiple initial positioning reference points and points to be positioned.
[0036] In order to facilitate the understanding of the subsequent solutions, you can refer to Figure 2 , which shows a schematic diagram of a scene of a Bluetooth positioning beacon, an initial positioning reference point, and a point to be positioned provided in an embodiment of the present application.
[0037] In the present invention, step S2 is to set up multiple Bluetooth positioning beacons in a preset site to send Bluetooth signals to multiple positioning initial reference points and points to be positioned. The implementation of this step is crucial to building a stable and efficient Bluetooth positioning system.
[0038] First of all, in the Bluetooth indoor positioning system, the positioning beacon is the key device for sending Bluetooth signals. By setting up multiple Bluetooth positioning beacons, it is possible to ensure that the Bluetooth signal is evenly distributed throughout the preset venue, forming a stable signal coverage network. In this way, each initial positioning reference point and the point to be positioned can receive the received signal strength indication values of multiple beacons, thereby providing the necessary data for precise positioning.
[0039] During the specific implementation process, in the preset site, the positions of Bluetooth positioning beacons are reasonably arranged according to the division of the grid structure and the distribution of reference points. First, determine the number and layout density of Bluetooth positioning beacons to ensure that the beacons can cover every corner of the entire preset site and avoid signal blind spots. Generally, the layout density of beacons depends on the size of the site and the required positioning accuracy. In order to ensure the uniform distribution of signals, the method of equidistant layout can be adopted to evenly distribute beacons in each area of the site.
[0040] Each Bluetooth positioning beacon needs to be installed in a fixed position, and try to avoid large metal objects or other obstacles that may interfere with the Bluetooth signal. After installation, test the signal coverage of each beacon to ensure that the signal strength is stable enough and covers all the initial reference points and possible areas to be located. If the signal is weak in a certain area, you can increase the number of beacons or adjust the location of the beacon.
[0041] Step S3: Acquire the first coordinates corresponding to each initial positioning reference point, and acquire multiple first received signal strength indicator values received by each initial positioning reference point.
[0042] In the present invention, the purpose of step S3 is to obtain the first coordinates corresponding to each initial positioning reference point and to obtain a plurality of first received signal strength indicator values received by each initial positioning reference point. This step is of great significance for building an accurate positioning system database.
[0043] First of all, the first coordinate of the initial reference point is an important benchmark data in the positioning algorithm. By obtaining these coordinates, the system can ensure that it has an accurate reference when calculating the position of the point to be positioned. The acquisition of multiple received signal strength indicator values is to build a fingerprint database. Through these received signal strength indicator values, signal collection in the offline stage can be realized, providing a data basis for online positioning.
[0044] In the specific implementation process, first, after the preset site is divided into a grid structure and the initial reference points are set, each reference point is accurately measured and its actual coordinates in the site are recorded. Use high-precision measurement tools (such as laser rangefinders, total stations, etc.) to ensure that the coordinates of each reference point are accurate and correct, and these coordinates will be stored as the first coordinates in the system database.
[0045] Then, at each initial positioning reference point, turn on the Bluetooth device to receive the signals sent by multiple Bluetooth positioning beacons. In the preset venue, multiple Bluetooth positioning beacons will continuously send Bluetooth signals, and the Bluetooth device at the initial positioning reference point will receive these signals and record their signal strength. In order to ensure the reliability of the data, each reference point needs to collect the received signal strength indicator value multiple times at different times and locations, and calculate its average value as the first received signal strength indicator value corresponding to the reference point.
[0046] These first coordinates and first received signal strength indicator values will be stored in the database of the positioning system to form a fingerprint database. When storing data, it is necessary to ensure that the format and structure of the data are consistent to facilitate subsequent data retrieval and calculation.
[0047] Step S4: Acquire multiple second received signal strength indicator values received by the point to be located.
[0048] In the present invention, the purpose of step S4 is to obtain multiple second received signal strength indicator values received by the point to be located. This step is crucial for achieving real-time positioning and improving positioning accuracy.
[0049] During the specific implementation process, when the positioning system is running, the point to be located (for example, the Bluetooth device carried by the user) will receive signals sent by multiple Bluetooth positioning beacons in the preset venue. In order to ensure the stability and accuracy of signal reception, the device at the point to be located needs to have a highly sensitive Bluetooth receiving module. Turn on the Bluetooth function of the device at the point to be located so that it can receive signals sent by all surrounding Bluetooth positioning beacons.
[0050] The device at the point to be located will record the received signal strength indicator value of each received signal in real time. Since the point to be located may move or the environment may change, causing the signal strength to fluctuate, it is necessary to collect the received signal strength indicator values multiple times and calculate their average value to obtain more stable and reliable data. In order to improve the real-time performance of the data, a shorter sampling interval can be set to ensure that the device can update the received signal strength indicator value in time.
[0051] In actual operation, the device to be located can obtain the received signal strength indicator values of all nearby Bluetooth beacons through the Bluetooth scanning function. Each beacon will be identified by a unique MAC address, and the device will record the MAC address of each beacon and the corresponding received signal strength indicator value. The collected received signal strength indicator values can be transmitted to the positioning server for processing via a wireless network or other communication methods.
[0052] Step S5: based on the multiple first coordinates, the multiple first received signal strength indicator values and the multiple second received signal strength indicator values, obtain the actual coordinates corresponding to the point to be located.
[0053] In the present invention, the purpose of step S5 is to obtain the actual coordinates corresponding to the point to be located based on the multiple first coordinates, the multiple first received signal strength indicator values and the multiple second received signal strength indicator values. This step is a key part of achieving high-precision positioning, and the position of the point to be located can be accurately determined through comprehensive calculation.
[0054] In one possible implementation, refer to Figure 3 , which shows a second flow chart of a positioning method based on weight factors and WKNN provided in an embodiment of the present application. Step S5 specifically includes steps S51-S53: Step S51: determining a preset number of actual positioning reference points from a plurality of initial positioning reference points based on a plurality of first coordinates, a plurality of first received signal strength indicator values, and a plurality of second received signal strength indicator values.
[0055] Specifically, since Bluetooth signals are susceptible to interference and attenuation in indoor environments, directly using all initial positioning reference points may introduce errors. By selecting a preset number of reference points that are closest to the received signal strength indicator value received by the point to be positioned, the impact of environmental noise and interference on positioning accuracy can be effectively reduced, thereby improving positioning accuracy and stability.
[0056] In one possible implementation, refer to Figure 4 , which shows a third flow chart of a positioning method based on weight factors and WKNN provided in an embodiment of the present application. Step S51 specifically includes steps S511-S514: Step S511: Determine a weight factor corresponding to each initial positioning reference point based on each first received signal strength indicator value.
[0057] In a possible implementation, step S511 specifically includes the following steps: The weight factor corresponding to each initial reference point is calculated using the following formula: in, is the weight factor between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, is the first received signal strength indicator value between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, and N is the number of positioning initial reference points.
[0058] Specifically, first, in the positioning system, the received signal strength indicator values received by each initial positioning reference point may be different, and these differences are affected by various factors such as environmental factors, distance, obstacles, etc. In order to better utilize this information when calculating the position of the point to be positioned, a weight factor needs to be assigned to each initial positioning reference point. The larger the weight factor, the greater the contribution of the received signal strength indicator value of the reference point to the positioning result, thereby improving the accuracy of positioning.
[0059] In the formula The purpose is to reasonably allocate weights so that the influence of the signal strength of each initial reference point on the positioning result can be properly reflected. First, the received signal strength indicator value reflects the strength of the signal received by the reference point. Generally speaking, the greater the signal strength, the closer the distance between the reference point and the beacon, and the higher the positioning accuracy. Therefore, using the square of the received signal strength indicator value to calculate the weight can better reflect the contribution of strong signals.
[0060] Use square processing (i.e. ) can amplify the difference in signal strength, making the weight of strong signals more prominent and the weight of weak signals relatively reduced. This design can improve the robustness and accuracy of positioning calculations, because strong signals usually mean more reliable distance estimates. It is the sum of the squares of the RSSI values of all reference points, and is used to normalize the RSSI square value of each reference point to ensure that the sum of all weight factors is 1. This can avoid imbalances caused by differences in the absolute size of the RSSI values themselves, and ensure that the weight factors of all reference points are within a comparable range.
[0061] Step S512: Calculate a first Euclidean distance between the point to be located and each positioning initial reference point based on multiple weight factors, multiple second received signal strength indicator values, and multiple first received signal strength indicator values.
[0062] In the present invention, the purpose of step S512 is to calculate the first Euclidean distance between the point to be located and each initial reference point for positioning based on multiple weight factors, multiple second received signal strength indication values, and multiple first received signal strength indication values. This step is crucial for determining the position of the point to be located. Calculating the first Euclidean distance is an effective method to measure the difference in signal strength between the point to be located and the reference point. By calculating the Euclidean distance between the second received signal strength indication value received by the point to be located and the first received signal strength indication value received by each reference point, the reference point closest to the point to be located can be found, thereby improving the accuracy of positioning. The use of weight factors can further adjust the contribution of each signal strength indication value to the distance calculation and enhance the accuracy of positioning.
[0063] First, the first received signal strength indicator value and the corresponding weight factor of each initial reference point are obtained from the fingerprint database, and multiple second received signal strength indicator values received in real time by the point to be located are obtained. Then, the first Euclidean distance between the point to be located and each reference point is calculated. Specifically, for each reference point, the weighted RSSI difference between the point to be located and each Bluetooth beacon signal received by the reference point is calculated, and the formula is as follows: Among them, d i is the first Euclidean distance between the point to be positioned and the i-th positioning initial reference point, M is the number of Bluetooth positioning beacons, is the weight factor between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, RTP u is the second received signal strength indicator value between the point to be located and the u-th Bluetooth positioning beacon, It is the first received signal strength indicator value between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon.
[0064] Through the above calculation, the weighted Euclidean distance between the point to be located and each reference point can be obtained. Weighted processing makes the influence of signal strength on the positioning result more significant, and improves the accuracy of positioning. Finally, through this weighted distance calculation method, the reference point closest to the RSSI value of the point to be located can be found, and these reference points will play an important role in the subsequent positioning calculation. Weighted processing effectively utilizes the weight factor, enhances the influence of signal strength, and reduces the influence of environmental noise and interference on the positioning result.
[0065] Step S513: sorting the first Euclidean distances to obtain a sorting result.
[0066] Specifically, after calculating the first Euclidean distance between the point to be located and each initial reference point for positioning, it is necessary to find the reference points that are closest to the point to be located among these reference points. This is because the closer the reference point, the more similar its RSSI value is to the RSSI value of the point to be located, and the greater the impact on the final positioning result. Therefore, by sorting the first Euclidean distance, the reference points that contribute the most to the positioning result can be effectively screened out.
[0067] During the sorting process, common sorting algorithms such as quick sort and merge sort can be used to ensure the accuracy and efficiency of the sorting results. In order to facilitate the processing of subsequent steps, the reference point information corresponding to each distance value needs to be recorded at the same time. In other words, the sorting results include not only the sorted distance values, but also the corresponding reference point identifiers, so that these reference points can be accurately located in subsequent steps.
[0068] Step S514: Based on the sorting result, a preset number of actual positioning reference points are determined from the multiple initial positioning reference points.
[0069] Specifically, in step S513, the first Euclidean distances between the point to be located and each initial reference point for location are sorted in ascending order. Next, a preset number of actual reference points for location are selected from the sorting results. Assuming the preset number is k, the first k reference points with the smallest distance are selected as actual reference points for location.
[0070] In the selection process, it is necessary to ensure that the selected reference point information is complete, including the reference point identification, first coordinates, first received signal strength indicator value and corresponding weight factor. This information will be used in subsequent steps to further calculate the actual coordinates of the point to be located.
[0071] Step S52: Determine the second coordinates corresponding to each positioning actual reference point.
[0072] Specifically, a preset number of actual positioning reference points have been selected in step S514. Next, the coordinate information of these actual positioning reference points needs to be extracted from the fingerprint database. Each actual positioning reference point has corresponding coordinates in the fingerprint database, which are pre-measured and stored when the system is initialized, and are called second coordinates.
[0073] Step S53: Based on the multiple second coordinates, obtain the actual coordinates.
[0074] Specifically, in the previous steps, a preset number of actual reference points for positioning have been selected and their second coordinates have been determined. The coordinates of each reference point and its corresponding weight factor have different contributions to the positioning result. By combining the coordinates and weights of these reference points, the actual coordinates of the points to be positioned can be calculated more accurately. This can reduce the impact of a single reference point error and improve the overall positioning accuracy.
[0075] In one possible implementation, refer to Figure 5 , which shows a fourth flow chart of a positioning method based on weight factors and WKNN provided in an embodiment of the present application. Step S53 specifically includes steps S531-S533: Step S531: Determine the second Euclidean distance between each actual reference point to be positioned and the point to be positioned.
[0076] Specifically, in the previous steps, the first Euclidean distance between the point to be located and each initial reference point for positioning has been calculated. Therefore, in this step, it is necessary to screen out the second Euclidean distance between each actual reference point for positioning and the point to be located from multiple first Euclidean distances.
[0077] Step S532: Based on each second Euclidean distance, a weight parameter corresponding to each actual positioning reference point is obtained.
[0078] In a possible implementation, step S532 specifically includes the following steps: The weight parameters corresponding to each actual positioning reference point are calculated using the following formula: Among them, k is the number of actual reference points for positioning, w j is the weight parameter corresponding to the jth positioning actual reference point, d j It is the second Euclidean distance between the jth positioning actual reference point and the point to be positioned.
[0079] Specifically, during the positioning process, the second Euclidean distance between each actual positioning reference point and the point to be positioned reflects the degree of similarity between them. The smaller the distance, the closer the RSSI value of the reference point is to the RSSI value of the point to be positioned, so the reference point should contribute more to the positioning result. By calculating the weight parameters, the influence of each reference point in the final positioning calculation can be reasonably distributed to ensure the accuracy and stability of the positioning results.
[0080] formula Used to calculate the weight parameters of each actual positioning reference point. This formula is designed to reasonably distribute the influence of each reference point in the final positioning result to ensure the accuracy and stability of positioning.
[0081] Through the second Euclidean distance d j Measures the similarity between the point to be located and each reference point. The smaller the distance, the closer the RSSI value of the reference point is to the RSSI value of the point to be located, so the reference point should contribute more to the final positioning result. In order to quantify this contribution, the calculation method of the weight parameter is adopted. The numerator in the formula is It reflects the inverse of the distance, which means that the smaller the distance, the larger the inverse, and thus the greater the weight. This design allows reference points that are closer to the point to be located to obtain greater weights, ensuring that these important reference points contribute more significantly to the positioning results.
[0082] In order to make the sum of the weights of all reference points equal to 1, the denominator of the formula The reciprocals of all reference points are summed. This normalization process ensures that the relative distribution of weights is reasonable and avoids the imbalance of calculations caused by excessive weights of individual reference points. The normalized weight parameters reflect the relative importance of each reference point relative to other reference points.
[0083] Step S533: obtaining actual coordinates based on the multiple second coordinates and the multiple weight parameters.
[0084] In a possible implementation, step S533 specifically includes the following steps: The actual coordinates are calculated using the following formula: Among them, k is the number of actual reference points for positioning, (X, Y) is the actual coordinate, and w j is the weight parameter corresponding to the jth positioning actual reference point, (x j ,y j ) is the second coordinate corresponding to the jth positioning actual reference point.
[0085] Specifically, in the previous steps, several actual reference points for positioning have been selected, and their second coordinates and corresponding weight parameters have been determined. Each reference point contributes differently to the positioning result, and the weight parameter reflects this difference. By combining the coordinates and weights of these reference points, the actual coordinates of the points to be positioned can be calculated more accurately, thereby improving the positioning accuracy.
[0086] formula Used to calculate the actual coordinates of the point to be located. The purpose of this formula is to combine the position information of each actual reference point through the weighted average method to obtain a more accurate position of the point to be located.
[0087] The position of the point to be located needs to refer to the information of multiple actual positioning reference points, and these reference points contribute differently to the positioning results. jIt reflects the importance of each reference point to the positioning result. The larger the weight, the closer the distance between the reference point and the point to be positioned, the closer its RSSI value is to the RSSI value of the point to be positioned, and the greater the impact on the positioning result. Therefore, by weighting and accumulating the coordinates of each actual positioning reference point according to its weight, the final calculated coordinates (X, Y) of the point to be positioned are more accurate, reflecting the comprehensive information of all actual positioning reference points and reducing positioning errors.
[0088] Reference Figure 6 , which shows a structural schematic diagram of a positioning system based on weight factors and WKNN provided in an embodiment of the present application, the system includes: a processing module 1 and an acquisition module 2; The processing module 1 is used to divide the preset site into a grid structure and set an initial positioning reference point at the node of each grid; the processing module 1 is also used to set a plurality of Bluetooth positioning beacons in the preset site, and the Bluetooth positioning beacons are used to send Bluetooth signals to a plurality of initial positioning reference points and points to be positioned; An acquisition module 2 is used to acquire a first coordinate corresponding to each initial positioning reference point, and acquire a plurality of first received signal strength indicator values received by each initial positioning reference point; The acquisition module 2 is further used to acquire multiple second received signal strength indicator values received by the point to be located; The processing module 1 is further used to obtain the actual coordinates corresponding to the point to be located based on the multiple first coordinates, the multiple first received signal strength indication values and the multiple second received signal strength indication values.
[0089] In a possible implementation, the processing module 1 is further configured to determine a preset number of actual positioning reference points from a plurality of initial positioning reference points based on a plurality of first coordinates, a plurality of first received signal strength indication values, and a plurality of second received signal strength indication values; The processing module 1 is also used to determine the second coordinates corresponding to each positioning actual reference point; The processing module 1 is further used to obtain the actual coordinates based on the multiple second coordinates.
[0090] In a possible implementation manner, the processing module 1 is further configured to determine a weight factor corresponding to each initial positioning reference point based on each first received signal strength indicator value; The processing module 1 is further used to calculate the first Euclidean distance between the point to be located and each initial reference point for positioning based on the multiple weight factors, the multiple second received signal strength indication values and the multiple first received signal strength indication values; The processing module 1 is further used to sort each first Euclidean distance to obtain a sorting result; The processing module 1 is further configured to determine a preset number of actual positioning reference points from the multiple initial positioning reference points based on the sorting result.
[0091] In a possible implementation, the processing module 1 is further used to determine a second Euclidean distance between each actual positioning reference point and the point to be positioned; The processing module 1 is further used to obtain a weight parameter corresponding to each positioning actual reference point based on each second Euclidean distance; The processing module 1 is further used to obtain actual coordinates based on the multiple second coordinates and the multiple weight parameters.
[0092] In a possible implementation manner, the processing module 1 is further configured to calculate a weight factor corresponding to each initial positioning reference point by using the following formula: in, is the weight factor between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, is the first received signal strength indicator value between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, and N is the number of positioning initial reference points.
[0093] In a possible implementation manner, the processing module 1 is further configured to calculate a weight parameter corresponding to each actual positioning reference point by using the following formula: Among them, k is the number of actual reference points for positioning, w j is the weight parameter corresponding to the jth positioning actual reference point, d j It is the second Euclidean distance between the jth positioning actual reference point and the point to be positioned.
[0094] In a possible implementation, the processing module 1 is further configured to calculate the actual coordinates using the following formula: Among them, k is the number of actual reference points for positioning, (X, Y) is the actual coordinate, and w j is the weight parameter corresponding to the jth positioning actual reference point, (x j ,y j ) is the second coordinate corresponding to the jth positioning actual reference point.
[0095] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0096] The present application also discloses an electronic device. Figure 7 , Figure 7 The electronic device 700 may include: at least one processor 701 , at least one network interface 704 , a user interface 703 , a memory 705 , and at least one communication bus 702 .
[0097] The communication bus 702 is used to realize the connection and communication between these components.
[0098] The user interface 703 may include a display screen (Display) and a camera (Camera), and the optional user interface 703 may also include a standard wired interface and a wireless interface.
[0099] The network interface 704 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0100] Among them, the processor 701 may include one or more processing cores. The processor 701 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 705, and calling data stored in the memory 705. Optionally, the processor 701 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 701 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 701, and it can be implemented by a single chip.
[0101] Among them, the memory 705 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 705 includes a non-transitory computer-readable storage medium. The memory 705 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 705 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 705 may optionally be at least one storage device located away from the aforementioned processor 701. Refer to Figure 7 , the memory 705 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module and an application program.
[0102] exist Figure 7In the electronic device 700 shown, the user interface 703 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 701 can be used to call an application stored in the memory 705, and when executed by one or more processors 701, the electronic device 700 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0103] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0104] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0105] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0107] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0108] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0109] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A positioning method based on weight factor and WKNN, characterized in that: The method comprises: Divide the preset site into a grid structure, and set an initial positioning reference point at each grid node; A plurality of Bluetooth positioning beacons are arranged in a preset site, wherein the Bluetooth positioning beacons are used to send Bluetooth signals to the plurality of initial positioning reference points and points to be positioned; Acquire a first coordinate corresponding to each of the initial positioning reference points, and acquire a plurality of first received signal strength indication values received by each of the initial positioning reference points; Acquire multiple second received signal strength indicator values received by the point to be located; Based on the plurality of first coordinates, the plurality of first received signal strength indication values, and the plurality of second received signal strength indication values, the actual coordinates corresponding to the point to be located are obtained.
2. The method according to claim 1, characterized in that The obtaining, based on the plurality of first coordinates, the plurality of first received signal strength indication values, and the plurality of second received signal strength indication values, of the actual coordinates corresponding to the point to be located specifically includes: Determine a preset number of positioning actual reference points from a plurality of the initial positioning reference points based on a plurality of the first coordinates, a plurality of the first received signal strength indication values, and a plurality of the second received signal strength indication values; Determine the second coordinates corresponding to each of the actual positioning reference points; Based on the plurality of second coordinates, the actual coordinate is obtained.
3. The method according to claim 2, characterized in that The determining a preset number of actual positioning reference points from a plurality of initial positioning reference points based on the plurality of first coordinates, the plurality of first received signal strength indication values, and the plurality of second received signal strength indication values specifically includes: Determine, based on each of the first received signal strength indication values, a weight factor corresponding to each of the initial positioning reference points; Calculate a first Euclidean distance between the point to be located and each of the initial positioning reference points based on the multiple weight factors, the multiple second received signal strength indication values, and the multiple first received signal strength indication values; Sort each of the first Euclidean distances to obtain a sorting result; Based on the sorting result, a preset number of actual positioning reference points are determined from the plurality of initial positioning reference points.
4. The method according to claim 2, characterized in that: The obtaining the actual coordinate based on the plurality of the second coordinates specifically includes: Determine the second Euclidean distance between each of the actual reference points for positioning and the point to be positioned; Based on each of the second Euclidean distances, obtaining a weight parameter corresponding to each of the actual positioning reference points; The actual coordinates are obtained based on the plurality of second coordinates and the plurality of weight parameters.
5. The method according to claim 3, characterized in that: The determining, based on each of the first received signal strength indication values, a weight factor corresponding to each of the initial positioning reference points specifically includes: The weight factor corresponding to each of the initial positioning reference points is calculated by the following formula: in, is the weight factor between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, is the first received signal strength indicator value between the i-th positioning initial reference point and the u-th Bluetooth positioning beacon, and N is the number of the positioning initial reference points.
6. The method according to claim 4, characterized in that The obtaining, based on each of the second Euclidean distances, a weight parameter corresponding to each of the actual positioning reference points specifically includes: The weight parameters corresponding to each of the actual positioning reference points are calculated by the following formula: Wherein, k is the number of actual reference points for positioning, w j is the weight parameter corresponding to the jth actual reference point, d j is the second Euclidean distance between the jth actual positioning reference point and the point to be positioned.
7. The method according to claim 4, characterized in that The obtaining the actual coordinates based on the plurality of the second coordinates and the plurality of the weight parameters specifically includes: The actual coordinates are calculated by the following formula: Wherein, k is the number of actual reference points for positioning, (X, Y) is the actual coordinate, and w j is the weight parameter corresponding to the jth actual positioning reference point, (x j ,y j ) is the second coordinate corresponding to the jth actual positioning reference point.
8. A positioning system based on weight factors and WKNN, characterized in that: The system comprises: a processing module and an acquisition module; The processing module is used to divide the preset site into a grid structure and set an initial positioning reference point at a node of each grid; The processing module is further used to set a plurality of Bluetooth positioning beacons in a preset site, and the Bluetooth positioning beacons are used to send Bluetooth signals to the plurality of initial positioning reference points and points to be positioned; The acquisition module is used to acquire the first coordinates corresponding to each of the initial positioning reference points, and acquire a plurality of first received signal strength indicator values received by each of the initial positioning reference points; The acquisition module is further used to acquire a plurality of second received signal strength indicator values received by the point to be located; The processing module is further used to obtain the actual coordinates corresponding to the point to be located based on the multiple first coordinates, the multiple first received signal strength indication values and the multiple second received signal strength indication values.
9. An electronic device, characterized in that: The electronic device (700) comprises a processor (701), a memory (705), a user interface (703) and a network interface (704), wherein the memory (705) is used to store instructions, the user interface (703) and the network interface (704) are used to communicate with other devices, and the processor (701) is used to execute the instructions stored in the memory (705) so that the electronic device (700) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Bluetooth positioning method based on RSSI characteristic values
CN111050275A
Indoor positioning method and device, computer equipment and readable storage medium
CN112243193A
Cited By
Adaptive WKNN indoor positioning method, system, device and medium
CN120659145A
An adaptive WKNN indoor positioning method, system, device, and medium
CN120659145B