Bluetooth positioning method and device based on genetic algorithm and TDOA, and medium

By deploying multiple base stations in an indoor three-dimensional spatial environment and using genetic algorithm optimization, the problem of low accuracy of TDOA positioning method in complex indoor environments is solved, and higher positioning accuracy and better global search capabilities are achieved.

CN120166356APending Publication Date: 2025-06-17WUXI ZHENYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510409234.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The existing TDOA positioning method has low positioning accuracy due to multipath effect and non-line-of-sight propagation in complex indoor environments, and traditional algorithms are easily trapped in local optimal solutions with sensitivity to initial values.

Method used

Using Bluetooth positioning method based on genetic algorithm and TDOA, we use the indoor three-dimensional spatial environment, deploy multiple base stations and calculate the actual TDOA, build a hyperbolic nonlinear positioning model, and use genetic algorithms to perform iterative optimization to improve positioning accuracy.

Benefits of technology

It effectively avoids local optimal solutions, improves the accuracy of indoor positioning, and reduces the impact of measurement errors caused by multipath effect and non-line-of-sight propagation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120166356A_ABST
    Figure CN120166356A_ABST
Patent Text Reader

Abstract

The invention discloses a Bluetooth positioning method and device based on a genetic algorithm and TDOA, and a medium, and relates to the technical field of Bluetooth positioning. The method comprises the following steps: constructing an indoor three-dimensional space environment deployed with N base stations, acquiring signal receiving time of each base station, and calculating actual TDOA (Time Difference of Arrival) of each base station relative to a reference base station based on the signal receiving time; constructing a hyperboloid nonlinear positioning model containing the distance difference between the target position and each base station based on the actual TDOA, and calculating a corresponding predicted TDOA based on the hyperboloid nonlinear positioning model; constructing a fitness function, carrying out iterative optimization on a population containing the three-dimensional coordinate information of the target position in an indoor three-dimensional space environment by adopting a genetic algorithm based on the fitness function, and when a termination condition is reached in the iterative optimization process, carrying out iterative optimization on the population containing the three-dimensional coordinate information of the target position. And determining the three-dimensional coordinate corresponding to the individual with the minimum fitness function value in the last generation of population as the positioning coordinate of the target position. By implementing the technical scheme provided by the invention, the accuracy of indoor positioning can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Bluetooth positioning, and specifically relates to a Bluetooth positioning method, device and medium based on genetic algorithm and TDOA. Background Art

[0002] With the rapid development of indoor positioning technology, indoor positioning solutions based on Bluetooth signals have been widely used in fields such as shopping mall navigation, warehousing logistics, and smart home due to their advantages such as low deployment cost and wide coverage. In Bluetooth indoor positioning technology, the Time Difference of Arrival (TDOA) positioning method has gradually become a research hotspot because it does not require clock synchronization between the mobile terminal and the base station and has relatively high positioning accuracy.

[0003] Currently, the TDOA positioning method mainly determines the target position by measuring the time difference of the signals sent by the mobile terminal arriving at multiple base stations. Common positioning algorithms include the Chan algorithm, Taylor series expansion method, etc. However, TDOA needs to solve a non-linear hyperboloid equation system. Traditional algorithms (such as the least squares method) are sensitive to the initial value and are prone to falling into local optimal solutions; the multi-path effect and non-line-of-sight propagation in complex indoor environments lead to significant time difference measurement errors, resulting in low indoor positioning accuracy. Summary of the Invention

[0004] The present application provides a Bluetooth positioning method, device and medium based on genetic algorithm and TDOA, which can improve the accuracy of indoor positioning.

[0005] In a first aspect, the present application provides a Bluetooth positioning method based on genetic algorithm and TDOA. The method includes: constructing an indoor three-dimensional space environment in which N base stations are deployed, where one base station is a reference base station, and at least one base station is at a different height from other base stations, and N is a positive integer greater than or equal to 4; acquiring the signal reception time of each base station, and calculating the actual TDOA of each base station relative to the reference base station based on the signal reception time; constructing a hyperboloid non-linear positioning model including the distance difference between the target position and each base station based on the actual TDOA, and calculating the corresponding predicted TDOA based on the hyperboloid non-linear positioning model; constructing a fitness function, and based on the fitness function, using a genetic algorithm to iteratively optimize a population including the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment, and when the termination condition is reached during the iterative optimization process, determining the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation population as the positioning coordinates of the target position.

[0006] By adopting the above technical solution, multiple base stations are deployed in the indoor three-dimensional space environment, and one of them is set as the reference base station. The actual TDOA is obtained by calculating the time difference of the signals received by each base station, and then a hyperbolic nonlinear positioning model including the distance differences between the target position and each base station is constructed. Based on this model, the predicted TDOA is calculated, and a fitness function is constructed with the reciprocal of the sum of the squares of the errors between the predicted TDOA and the actual TDOA. The genetic algorithm is used to iteratively optimize the population containing the three-dimensional coordinate information of the target position. Since the genetic algorithm has the ability of global search, it can effectively avoid falling into the local optimal solution, and the quality of the solution can be continuously improved through the population iterative optimization until the three-dimensional coordinates corresponding to the optimal individual are obtained as the positioning coordinates of the target position when the termination condition is met. At the same time, through the three-dimensional base station layout formed by deploying base stations at different heights, combined with the hyperbolic nonlinear positioning model, the signal propagation characteristics in the complex indoor environment can be more accurately described, and the measurement error effects caused by multipath effects and non-line-of-sight propagation can be effectively reduced, thus significantly improving the accuracy of indoor positioning.

[0007] In the second aspect of the present application, a Bluetooth positioning system based on genetic algorithm and TDOA is provided. The system includes: a space construction module for constructing an indoor three-dimensional space environment, in which N base stations are deployed, one of the base stations is a reference base station, and at least one base station is at a different height from other base stations, and N is a positive integer greater than or equal to 4; A time difference calculation module for obtaining the signal reception times of each of the base stations and calculating the actual TDOA of each base station relative to the reference base station based on the signal reception times; A model construction module for constructing a hyperbolic nonlinear positioning model including the distance differences between the target position and each of the base stations based on the actual TDOA, and calculating the corresponding predicted TDOA based on the hyperbolic nonlinear positioning model; An iterative optimization module for constructing a fitness function, and based on the fitness function, using a genetic algorithm to iteratively optimize a population containing the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment, and when the termination condition is reached during the iterative optimization process, determining the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation of the population as the positioning coordinates of the target position.

[0008] In the third aspect of the present application, a computer storage medium is provided. The computer storage medium stores multiple instructions, and the instructions are adapted to be loaded and executed by a processor to perform the above method steps.

[0009] In the fourth aspect of the present application, an electronic device is provided, including: a processor and a memory; wherein, the memory stores a computer program, and the computer program is adapted to be loaded and executed by the processor to perform the above method steps.

[0010] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: In the present application, multiple base stations are deployed in an indoor three-dimensional space environment, and one of them is set as a reference base station. The actual TDOA is obtained by calculating the time difference of the signals received by each base station, and then a hyperbolic nonlinear positioning model including the distance differences between the target position and each base station is constructed. Based on this model, the predicted TDOA is calculated, and a fitness function with the reciprocal of the sum of the squares of the errors between the predicted TDOA and the actual TDOA is constructed. The genetic algorithm is used to iteratively optimize the population containing the three-dimensional coordinate information of the target position. Since the genetic algorithm has the ability of global search, it can effectively avoid falling into local optimal solutions, and the quality of the solution can be continuously improved through population iterative optimization until the three-dimensional coordinates corresponding to the optimal individual are obtained as the positioning coordinates of the target position when the termination condition is met. At the same time, through the three-dimensional base station layout formed by deploying base stations at different heights and combining with the hyperbolic nonlinear positioning model, the signal propagation characteristics in a complex indoor environment can be more accurately described, effectively reducing the influence of measurement errors caused by multipath effects and non-line-of-sight propagation, thereby significantly improving the accuracy of indoor positioning. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is a schematic flow chart of a Bluetooth positioning method based on genetic algorithm and TDOA provided by an embodiment of the present application; Figure 2 is a schematic diagram of building an indoor three-dimensional space environment provided by an embodiment of the present application; Figure 3 is a schematic diagram of an error convergence curve provided by an embodiment of the present application; Figure 4 is a schematic diagram of modules of a Bluetooth positioning system based on genetic algorithm and TDOA provided by an embodiment of the present application; Figure 5 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application.

[0012] Description of the reference numerals: 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0013] In order to enable those skilled in the art 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 with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.

[0014] In the description of the embodiments of the present application, words such as "for example" or "for illustration" are used to give examples, illustrations or explanations. Any embodiment or design solution described as "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "for example" or "for illustration" is intended to present related concepts in a specific manner.

[0015] In the description of the embodiments of the present application, the term "a plurality of" means two or more. For example, a plurality of systems means two or more systems, and a plurality of screen terminals means two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0016] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.

[0017] Please refer to Figure 1 , and a flowchart of a Bluetooth positioning method based on genetic algorithm and TDOA is specifically proposed. This method can be implemented depending on a computer program, can be implemented depending on a single-chip microcomputer, or can run on a Bluetooth positioning system based on genetic algorithm and TDOA. This computer program can be integrated in a computer device or can run as an independent tool-class application. Specifically, this method includes steps 10 to 40, and the above steps are as follows: Step 10: Construct an indoor three-dimensional space environment, in which N base stations are deployed. One of the base stations is a reference base station, and at least one base station is at a different height from other base stations. N is a positive integer greater than or equal to 4.

[0018] The three-dimensional space environment in the embodiments of the present application refers to an enclosed indoor space with three dimensions of length, width and height. For example, it can be specific scenarios such as a shopping mall, an office, a warehouse, etc. This three-dimensional space environment can be described using a Cartesian coordinate system, that is, the position of any point in the space is determined by the X-axis, Y-axis and Z-axis. Among them, a corner point of the indoor space can be set as the coordinate origin (0, 0, 0), the X-axis and Y-axis are respectively parallel to two perpendicular directions of the ground, and the Z-axis is perpendicular to the ground and upward.

[0019] There are N base stations deployed in the indoor three-dimensional space environment. A base station refers to a fixed device that can receive Bluetooth signals and record the reception time. Each base station has a wireless signal receiving module, a clock module, and a data processing module. Among them, the wireless signal receiving module is used to receive Bluetooth signals sent by mobile terminals; the clock module is used to record the signal reception time, and the clock modules of each base station are synchronized with the clock of the reference base station; the data processing module is used to preprocess the received signals and transmit the reception time information to the central processing unit. Each base station is assigned fixed three-dimensional coordinate values during deployment, and these coordinate values will be used as known parameters in subsequent positioning calculations.

[0020] As Figure 2 shown, Figure 2 Figure 1 is a schematic diagram of building an indoor three-dimensional space environment provided by an embodiment of the present application. As can be seen from Figure 2 Figure 1, there are six base stations, at least one base station is located above the horizontal plane, and one of them is selected as the reference base station (the green dot in the figure).

[0021] Specifically, in order to achieve precise positioning in the indoor environment, it is first necessary to construct a suitable base station deployment environment. Deploy 4 or more base stations in the indoor three-dimensional space environment, and select one base station as the reference base station. Considering the complexity of signal propagation in the indoor environment, at least one base station is deployed at a different height from other base stations. For example, 3 base stations can be arranged at the three corner positions of the room, and the 4th base station can be arranged on the ceiling. This three-dimensional layout method can not only expand the signal coverage range but also better capture the signal propagation characteristics in space. Practice has shown that when the number of base stations N is 4, the basic three-dimensional positioning requirements can be met; when N is greater than 4, more TDOA measurement values can be obtained, which helps to improve the positioning accuracy. During actual deployment, it is necessary to accurately record the fixed coordinate positions of each base station and ensure good communication line-of-sight between the base stations to reduce attenuation and interference during signal transmission. This base station deployment scheme forms a complete three-dimensional measurement network by setting base stations at different heights, provides a reliable spatial geometric basis for subsequent TDOA-based positioning calculations, and effectively improves the resolution ability of the positioning system for the target three-dimensional position.

[0022] Step 20: Obtain the signal reception time of each base station and calculate the actual TDOA of each base station relative to the reference base station based on the signal reception time.

[0023] The signal reception time refers to the moment when each base station receives the Bluetooth signal sent by the mobile terminal. When the mobile terminal sends a Bluetooth signal in the indoor three-dimensional space environment, the clock module of each base station will record the specific time point when the signal is received. For example, if the mobile terminal sends a signal at time t0, the reference base station may receive the signal at time t1, and other base stations may receive the signal at times t2, t3, t4, etc. These specific reception times are the signal reception times. Since the clocks between the base stations have been synchronized, these time values have the same time reference.

[0024] The actual TDOA refers to the difference between the moment when each base station receives the Bluetooth signal sent by the mobile terminal and the moment when the reference base station receives the same signal. For example, if the signal reception time of the reference base station is t1 and the signal reception time of another base station is t2, then the actual TDOA between these two base stations is t2 - t1.

[0025] Specifically, before indoor positioning, it is necessary to first obtain the time information of each base station receiving the Bluetooth signal sent by the mobile terminal. Since the principle of the TDOA positioning method is based on the time difference of the signal arriving at different base stations to calculate the target position, it is necessary to ensure the synchronization of the clocks of each base station. In specific implementation, first, the clocks of all base stations are synchronized with the clock of the reference base station through a clock synchronization protocol (such as the Network Time Protocol NTP), so that each base station has the same time reference. When the mobile terminal sends a Bluetooth signal, the clock module of each base station will accurately record the moment when the signal is received, and these moments are the signal reception times. Subsequently, by calculating the difference between the signal reception time of each base station and the signal reception time of the reference base station, N - 1 actual TDOA values can be obtained. For example, if the reference base station receives the signal at time t1 and the i-th base station receives the signal at time ti, then TDOAi - 1 = ti - t1 can be calculated. This measurement method based on time difference does not require the mobile terminal and the base station to be clock-synchronized, nor does it need to know the signal transmission moment, which can effectively reduce the system complexity. At the same time, since the clocks of each base station have been synchronized, the obtained actual TDOA values can accurately reflect the time difference of signal propagation, providing reliable input data for subsequent construction of the hyperbolic nonlinear positioning model.

[0026] Step 30: Construct a hyperbolic nonlinear positioning model including the distance differences between the target position and each base station based on the actual TDOA, and calculate the corresponding predicted TDOA based on the hyperbolic nonlinear positioning model.

[0027] The target position refers to the actual position of the mobile terminal to be located in the indoor three-dimensional space environment, which can be represented by the three-dimensional coordinates (x, y, z).

[0028] The hyperbolic nonlinear positioning model refers to a mathematical model constructed based on the actual TDOA.

[0029] The predicted TDOA refers to the theoretical time difference calculated based on the hyperbolic nonlinear positioning model.

[0030] Specifically, in order to accurately calculate the position of the mobile terminal, the obtained time difference information needs to be converted into a solvable mathematical model. In this embodiment, first, based on the principle of electromagnetic wave propagation, using the speed of light c (about 3×10^8 m / s), the actual TDOA is converted into a distance difference, thereby establishing the spatial geometric relationship between the target position and each base station. Let the target position coordinates of the mobile terminal be (x, y, z), the coordinates of the reference base station be (x1, y1, z1), and the coordinates of the i-th base station be (xi, yi, zi), then a hyperbolic nonlinear positioning model based on the distance difference can be constructed. Considering the measurement errors caused by factors such as multipath effects and signal attenuation in the actual environment, a zero-mean noise term ε obeying the Gaussian distribution is introduced into the model for correction. For the deployment scenario of N base stations, N - 1 nonlinear equations can be obtained, forming a complete positioning equation set. Based on this hyperbolic nonlinear positioning model, when a set of possible target position coordinates is given, the theoretically observable time difference, that is, the predicted TDOA, can be calculated by substituting the coordinate values in reverse. The establishment of this model not only considers the physical characteristics of signal propagation but also takes into account the influence of the actual environment through the noise term, providing a theoretical basis for subsequent optimization and solution. By comparing the difference between the predicted TDOA and the actual TDOA, the accuracy of the assumed position can be evaluated, which provides an important basis for constructing the fitness function subsequently.

[0031] Based on the above embodiment, as an alternative embodiment, the step of constructing a hyperbolic nonlinear positioning model including the distance difference between the target position and each base station based on the actual TDOA may further include the following steps: Step 301: Construct a distance difference equation between the target position and each base station based on the actual TDOA and the transmission speed of electromagnetic waves in the air.

[0032] Specifically, in the embodiment of the present application, six base stations are set and one of them is selected as the reference base station, and its point coordinates are recorded as BS i (x i ,y i ,z i )(i = 2, 3,... 6) and the coordinates of the target position (x, y, z). The signal released by the target position is received by the reference base station and other base stations, the time difference of the signals received by different base stations is recorded, and then the hyperbolic equation is obtained by positioning through the actual TDOA as: In the formula, D i1 is the distance difference between the reference base station and the i-th base station, Δti1 where is the signal transmission coordinate and is the time difference measured by the reference base station and the th base station, and c is the transmission speed of electromagnetic waves in the air.

[0033] Step 302: Correct the distance difference equation based on zero-mean noise that follows a Gaussian distribution.

[0034] Specifically, when measuring the actual TDOA, in order to simulate the noise interference in the actual environment, introduce ε i which is zero-mean and follows a Gaussian white distribution with variance σ 2 white noise, and the noise standard deviation σ ∈ [0.05m, 0.15m]; due to environmental interference, correcting the distance difference equation based on zero-mean noise that follows a Gaussian distribution can be more accurate and conform to the actual situation.

[0035] Step 303: Based on the corrected distance difference equation, establish a hyperbolic nonlinear positioning model that includes the three-dimensional coordinates of the target position.

[0036] Specifically, based on the corrected distance difference equation, establish a hyperbolic nonlinear positioning model that includes the three-dimensional coordinates of the target position: d i represents the distance between the th base station and the target coordinates, D i1 = d i - d1. For different hyperbolic equations, the intersection point of the single-sheet hyperboloid drawn by four or more positioning base stations is the target position. The solution (x * , y * , z * ) of the theoretical equations is also the target position and satisfies However, due to factors such as signal propagation environment and measurement errors, the solution determined based on spatial search does not conform to Therefore, define the objective function as: Find (x * , y * , z * ) through an optimization algorithm such that

[0037] Step 40: Construct a fitness function, and based on the fitness function, use a genetic algorithm to iteratively optimize the population containing the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment. When the termination condition is reached during the iterative optimization process, determine the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation of the population as the positioning coordinates of the target position.

[0038] Specifically, in order to accurately evaluate the proximity of each possible position to the true target position, it is necessary to construct a suitable fitness function. In this embodiment, first, a preset number of initial individuals are randomly generated in the indoor three-dimensional space environment. The population size is set to 100 individuals, and each individual contains a set of three-dimensional coordinates (x, y, z) representing the target position. During the generation process, it is necessary to ensure that each coordinate value satisfies the physical constraints of the indoor space, that is, the x coordinate is within the range of [0, L] (L is the space length), the y coordinate is within the range of [0, W] (W is the space width), and the z coordinate is within the range of [0, H] (H is the space height). This initialization method can ensure that the search space evenly covers the entire indoor environment and provides a good initial solution distribution for subsequent optimization.

[0039] For each individual in the population, substitute its three-dimensional coordinates into the hyperbolic nonlinear positioning model to calculate the predicted TDOA value corresponding to this position. Calculate the sum of the squares of the errors between the predicted TDOA and the actual TDOA, and take the reciprocal of the sum of the squares of the errors as the fitness function. The specific expression is: where n ≥ 3 is the total number of base stations, is the predicted TDOA, D i1 is the actual TDOA. The larger the fitness function value, the closer the three-dimensional coordinates corresponding to the individual are to the target position.

[0040] Furthermore, after constructing the fitness function, it is necessary to gradually improve the positioning accuracy through iterative optimization. First, calculate the fitness function value for each individual in the current population. For the three-dimensional coordinates (x, y, z) of each individual, substitute them into the hyperbolic nonlinear positioning model to calculate the predicted TDOA, and combine with the actual TDOA to calculate the fitness function value. By comparing the fitness function values of all individuals, select the individuals with higher fitness as the target individuals. Among them, this application embodiment also sets the range of parameters and variables. The parameters include: determining the three-dimensional search space range; randomly generating the population size N ∈ [50, 200], and randomly generating N individuals within the search space through uniform distribution. Each individual represents the three-dimensional coordinates (x, y, z) of the target. In this application embodiment, the selection operation adopts the roulette wheel strategy to select individuals, and calculates the selection probability of each individual Construct a roulette wheel according to the selection probability. Randomly rotate the roulette wheel N times, and each selected individual enters the new population, ensuring that individuals with higher fitness have a greater probability of being selected.

[0041] Use the genetic algorithm to perform iterative optimization on the population, update the population through selection, crossover, and mutation operations, and dynamically adjust the algorithm parameters to balance global search and local optimization.

[0042] Among them, for the selection operation, specifically adopt the roulette wheel strategy, select parental individuals according to the proportion of fitness values, and screen excellent individuals from the current population according to the fitness function value.

[0043] Crossover operation, specifically: for the selected parent generation with probability P c perform arithmetic crossover to generate offspring individuals. The crossover probability adopts a dynamic adjustment strategy. In the first 50% of the iterations, P c = 0.8, and in the last 50% of the iterations, P c = 0.5 to balance global search and local optimization.

[0044] Mutation operation, specifically: with probability P m perform Gaussian mutation on the offspring. Each time a mutation occurs, only one dimension of x, y, or z is randomly selected for perturbation, and the mutation amount follows N(0, σ 2 ), where σ ∈ [0.5m, 1.5m]. The mutation rate is calculated by comprehensively considering individual fitness and population diversity. Let P m = α·P m1 + (1 - α)·P m2 , where α is the weight coefficient (0 < α < 1), P m1 is the mutation rate based on individual fitness f is the individual fitness, f best is the optimal fitness of the population, f worst is the worst fitness of the population, P mmax and P mmin are the preset maximum and minimum mutation rates); P m2 is the mutation rate based on population diversity. The diversity is measured by calculating the gene difference degree among individuals in the population, and then P m2 is determined. For the selected individuals to be mutated, a gene is randomly selected and randomly perturbed within a certain range, that is, x = x + δ, where δ is a random value within the mutation range. The newly generated offspring individuals are added to the population to replace the individuals with low fitness, keeping the population size unchanged. Repeat the operations of selection, crossover, mutation, and population update until the predetermined number of iterations is reached, or the increase in fitness is less than the set value. At this time, the coordinates corresponding to the individual with the highest fitness in the population are the estimated target position, as Figure 3 shown, which is a schematic diagram of an error convergence curve provided by an embodiment of the present application.

[0045] Boundary constraints are introduced, specifically: if the offspring coordinates exceed the search space range, they are truncated to the nearest boundary value; at the same time, an adaptive mutation step size is introduced in the mutation operation to avoid local optima.

[0046] Judge whether the current iteration meets the termination condition. If it meets the termination condition, the three-dimensional coordinates corresponding to the individual with the minimum fitness function value in the new generation population are used as the positioning coordinates of the target position. If it does not meet the termination condition, the new generation population is used as the current population, and the iterative optimization is continued.

[0047] Among them, the termination conditions include: the number of iterations reaches a preset value, or the change amount of the fitness function value of the target individual within a continuous preset number of generations is less than a preset threshold. In the embodiments of the present application, the condition for stopping iteration is: reaching the preset maximum number of iterations, with a setting range of 100 - 200 generations, or the fitness improvement amplitude is less than 1% for 10 consecutive generations.

[0048] Based on the above embodiments, as an optional embodiment, an indoor Bluetooth positioning method based on genetic algorithm and TDOA may further include the following process: Specifically, this embodiment introduces a positioning accuracy verification and adaptive optimization mechanism after the initial positioning. First, the true coordinates of the target position are obtained through the calibration of the positioning system. In practical applications, these true coordinate values can be obtained through a high-precision laser rangefinder or other professional measurement devices, ensuring that their accuracy is at the millimeter level. Then, the Euclidean distance between the positioning coordinates output by the genetic algorithm and the true coordinates is calculated as a quantitative index of the positioning error. When the calculated positioning error is greater than the preset error threshold (the error threshold is set to 0.5 meters in this embodiment), it indicates that the accuracy of the current positioning result cannot meet the application requirements, and it is necessary to increase the computing resources to improve the positioning accuracy. Specifically, the population size is increased from the initial 100 individuals to 200 individuals, and at the same time, the maximum number of iterations is increased from 200 generations to 400 generations. The increase in population size can provide a larger search space coverage, which helps to find a better solution; the increase in the number of iterations allows the algorithm to have more sufficient time for detailed local search. After the parameter adjustment, the iterative optimization process is re-executed. In order to make full use of the results of the previous optimization, when initializing the new population, 10% of the individuals with the highest fitness in the original population are directly retained in the new population, and the remaining individuals are randomly generated under the consideration of boundary constraints. This initialization strategy not only retains the excellent solutions that have been obtained but also maintains the population diversity by introducing new random individuals. In the new optimization process, the selection operation adopts a hybrid strategy: 80% of the individuals are selected by the tournament method, and the remaining 20% are selected by the roulette wheel method. This dual selection mechanism not only ensures the selection probability of excellent individuals but also gives relatively weak individuals a certain chance of evolution. The probability of the crossover operation is increased to 0.9 to strengthen the exploration of the search space; the initial standard deviation of the mutation operation is reduced to half of the original to achieve a more refined local search. The termination conditions are also adjusted accordingly: when the relative change amount of the fitness function value of the optimal individual is less than 5×10^-7 (half of the original threshold) for 40 consecutive generations (twice the original), or when the new set maximum number of iterations of 400 generations is reached, the algorithm stops. This more stringent termination condition setting can ensure that the algorithm has sufficient time to converge to a more accurate solution.

[0049] Please refer to Figure 4, which is a schematic diagram of the modules of a Bluetooth positioning system based on genetic algorithm and TDOA provided by an embodiment of the present application. The system includes: A space construction module for constructing an indoor three-dimensional space environment, in which N base stations are deployed. One of the base stations is a reference base station, and at least one base station is at a different height from other base stations. N is a positive integer greater than or equal to 4; A time difference calculation module for obtaining the signal reception times of each base station and calculating the actual TDOA of each base station relative to the reference base station based on the signal reception times; A model construction module for constructing a hyperbolic nonlinear positioning model including the distance differences between the target position and each base station based on the actual TDOA, and calculating the corresponding predicted TDOA based on the hyperbolic nonlinear positioning model; An iterative optimization module for constructing a fitness function, and based on the fitness function, using a genetic algorithm to iteratively optimize a population including the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment, and when the termination condition is reached during the iterative optimization process, determining the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation population as the positioning coordinates of the target position.

[0050] Optionally, the time difference calculation module is further configured to synchronize the clocks of each base station with the clock of the reference base station and record the moments when each base station receives the Bluetooth signal sent by the mobile terminal; Calculate the differences between the moments when each base station receives the Bluetooth signal and the moment when the reference base station receives the Bluetooth signal respectively to obtain the actual TDOA.

[0051] Optionally, the model construction module is further configured to construct a distance difference equation between the target position and each base station based on the actual TDOA and the transmission speed of electromagnetic waves in the air; Correct the distance difference equation based on zero-mean noise that follows a Gaussian distribution; Based on the corrected distance difference equation, establish a hyperbolic nonlinear positioning model including the three-dimensional coordinates of the target position.

[0052] Optionally, the iterative optimization module is further configured to generate an initial population including a preset number of individuals in the indoor three-dimensional space environment, where each individual includes a set of three-dimensional coordinates of the target position; Calculate the sum of the squared errors between the predicted TDOA and the actual TDOA; Take the reciprocal of the sum of the squared errors as the fitness function, where the larger the fitness function value, the closer the three-dimensional coordinates corresponding to the individual are to the target position.

[0053] Optionally, the iterative optimization module is further configured to calculate the fitness function values of the individuals in the current population based on the fitness function, and determine the target individual; Perform crossover operation and mutation operation on the target individual by using a genetic algorithm to generate a new generation of population; Determine whether the current iteration meets the termination condition. If the termination condition is met, use the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the new generation of population as the positioning coordinates of the target position; if the termination condition is not met, use the new generation of population as the current population and continue to perform iterative optimization.

[0054] Optionally, the iterative optimization module is further configured to the termination condition includes: the number of iterations reaches a preset value, or the change amount of the fitness function value of the target individual within a continuous preset number of generations is less than a preset threshold.

[0055] Optionally, the iterative optimization module is further configured to obtain the true coordinates of the target position; Calculate the Euclidean distance between the positioning coordinates and the true coordinates to obtain a positioning error; When the positioning error is greater than a preset error threshold, increase the number of individuals in the population and the number of iterations, and re-perform iterative optimization.

[0056] It should be noted that: when the system provided in the above embodiment realizes its functions, only the above-mentioned division of each functional module is used for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, 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 system and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be seen in the method embodiment, which will not be elaborated here.

[0057] The embodiment of the present application also provides a computer storage medium. The computer storage medium can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor to perform a Bluetooth positioning method based on a genetic algorithm and TDOA in the above embodiment. The specific execution process can refer to the specific description in the above embodiment and will not be elaborated here.

[0058] Please refer to Figure 5 The present application also discloses an electronic device. Figure 5 It is a schematic structural diagram of an electronic device disclosed in the embodiment of the present application. The electronic device 300 may include: at least one processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.

[0059] Among them, the communication bus 302 is used to realize the connection and communication between these components.

[0060] Among them, the user interface 303 may include a display screen and a camera. Optionally, the user interface 303 may also include standard wired interfaces and wireless interfaces.

[0061] Among them, the network interface 304 may optionally include standard wired interfaces and wireless interfaces (such as WI-FI interfaces).

[0062] Among them, the processor 301 may include one or more processing cores. The processor 301 connects various parts within the entire server through various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling the data stored in the memory 305, the processor 301 performs various functions of the server and processes data. Optionally, the processor 301 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 301 may integrate one or a combination of several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; 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 301 and may be implemented separately by a single chip.

[0063] Among them, the memory 305 may include random access memory (RAM) and may also include read-only memory. Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 305 may also be at least one storage device located far from the aforementioned processor 301. Refer toFigure 5 In the memory 305, which is a computer storage medium, an operating system, a network communication module, a user interface module, and an application program of a Bluetooth positioning method based on a genetic algorithm and TDOA can be included.

[0064] In Figure 5 In the electronic device 300 shown, the user interface 303 is mainly used to provide an interface for the user to obtain user input data; and the processor 301 can be used to call the application program of a Bluetooth positioning method based on a genetic algorithm and TDOA stored in the memory 305. When executed by one or more processors 301, the electronic device 300 is caused to execute the method of one or more of the above embodiments. It should be noted that for the foregoing method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be in other sequences or performed 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 essential to the present application.

[0065] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0066] In several implementation manners provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some service interfaces. The indirect couplings or communication connections of the device or unit can be in electrical or other forms.

[0067] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0068] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0069] When 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, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, mobile hard disks, magnetic disks, or optical discs.

[0070] The above are only exemplary embodiments of the present disclosure and should not be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. After considering the specification and the practice of the present disclosure, those skilled in the art will easily think of other implementation schemes of the present disclosure.

[0071] The present application aims to cover any variations, uses, or adaptive changes of the present disclosure. These variations, uses, or adaptive changes follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not recorded in the present disclosure. The specification and the embodiments are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A Bluetooth positioning method based on genetic algorithm and TDOA, characterized in that: The method comprises: Constructing an indoor three-dimensional space environment, wherein N base stations are deployed in the indoor three-dimensional space environment, one of the base stations is a reference base station, and at least one base station is located at a different height from the other base stations, and N is a positive integer greater than or equal to 4; Acquire the signal reception time of each of the base stations, and calculate the actual TDOA of each base station relative to the reference base station based on the signal reception time; Based on the actual TDOA, a hyperbolic nonlinear positioning model including the distance difference between the target position and each of the base stations is constructed, and based on the hyperbolic nonlinear positioning model, a corresponding predicted TDOA is calculated; A fitness function is constructed, and based on the fitness function, a genetic algorithm is used to iteratively optimize a population containing the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment, and when a termination condition is reached during the iterative optimization process, the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation of the population are determined as the positioning coordinates of the target position.

2. The Bluetooth positioning method based on genetic algorithm and TDOA according to claim 1, characterized in that: The acquiring the signal reception time of each base station, and calculating the actual TDOA of each base station relative to the reference base station based on the signal reception time, comprises: Synchronize the clock of each base station with the clock of the reference base station, and record the time when each base station receives the Bluetooth signal sent by the mobile terminal; The differences between the time when each base station receives the Bluetooth signal and the time when the reference base station receives the Bluetooth signal are calculated respectively to obtain the actual TDOA.

3. The Bluetooth positioning method based on genetic algorithm and TDOA according to claim 1, characterized in that: The constructing of a hyperbolic nonlinear positioning model including the distance difference between the target position and each of the base stations based on the actual TDOA includes: Based on the actual TDOA and the transmission speed of the electromagnetic wave in the air, construct a distance difference equation between the target position and each of the base stations; Correcting the distance difference equation based on zero-mean noise that obeys a Gaussian distribution; Based on the corrected distance difference equation, a hyperbolic nonlinear positioning model including the three-dimensional coordinates of the target position is established.

4. The Bluetooth positioning method based on genetic algorithm and TDOA according to claim 1, characterized in that: The constructing of the fitness function comprises: Generating an initial population including a preset number of individuals in the indoor three-dimensional space environment, wherein each individual includes a set of three-dimensional coordinates of a target position; Calculating the sum of squares of errors between the predicted TDOA and the actual TDOA; The inverse of the sum of squared errors is used as the fitness function, wherein a larger value of the fitness function indicates that the three-dimensional coordinates corresponding to the individual are closer to the target position.

5. The Bluetooth positioning method based on genetic algorithm and TDOA according to claim 1, characterized in that: The method of iteratively optimizing a population containing the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment using a genetic algorithm based on the fitness function, and determining the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation of the population as the positioning coordinates of the target position when a termination condition is reached during the iterative optimization process, includes: Calculating the fitness function value of each individual in the current population based on the fitness function, and determining the target individual; Using a genetic algorithm to perform crossover and mutation operations on the target individuals to generate a new generation of population; Determine whether the current iteration meets the termination condition. If the termination condition is met, the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the new generation population are used as the positioning coordinates of the target position; if the termination condition is not met, the new generation population is used as the current population and iterative optimization is continued.

6. The Bluetooth positioning method based on genetic algorithm and TDOA according to claim 5, characterized in that: The termination condition includes: the number of iterations reaches a preset value, or the change in the fitness function value of the target individual within a continuous preset number of generations is less than a preset threshold.

7. The Bluetooth positioning method based on genetic algorithm and TDOA according to claim 1, characterized in that: The method further comprises: Obtaining the real coordinates of the target position; Calculate the Euclidean distance between the positioning coordinates and the real coordinates to obtain a positioning error; When the positioning error is greater than a preset error threshold, the number of individuals in the population and the number of iterations are increased, and the iterative optimization is re-executed.

8. A Bluetooth positioning system based on genetic algorithm and TDOA, characterized in that: The system comprises: A space construction module, used to construct an indoor three-dimensional space environment, wherein N base stations are deployed in the indoor three-dimensional space environment, one of which is a reference base station, and at least one base station is located at a different height from the other base stations, and N is a positive integer greater than or equal to 4; A time difference calculation module, used to obtain the signal reception time of each base station, and calculate the actual TDOA of each base station relative to the reference base station based on the signal reception time; A model building module, used to build a hyperbolic nonlinear positioning model including the distance difference between the target position and each of the base stations based on the actual TDOA, and calculate the corresponding predicted TDOA based on the hyperbolic nonlinear positioning model; The iterative optimization module is used to construct a fitness function, and based on the fitness function, use a genetic algorithm to iteratively optimize the population containing the three-dimensional coordinate information of the target position in the indoor three-dimensional space environment, and when the termination condition is reached during the iterative optimization process, the three-dimensional coordinates corresponding to the individual with the smallest fitness function value in the last generation of the population are determined as the positioning coordinates of the target position.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: It includes 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 the method as claimed in any one of claims 1 to 7.