Positioning method and apparatus, electronic device, and readable storage medium

By calculating the anomaly coefficient and using historical location information to determine the credibility of candidate grids, the candidate grids before localization are optimized, solving the localization error problem caused by inaccurate recall and achieving higher-precision localization.

CN117279090BActive Publication Date: 2026-05-19VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VIVO MOBILE COMM CO LTD
Filing Date
2023-10-16
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, inaccurate recall of candidate grids leads to significant positioning errors.

Method used

By acquiring base station and wireless network information of electronic devices, anomaly coefficients are calculated, abnormal candidate grids are eliminated, the credibility of candidate grids is determined using historical location information, untrusted grids are excluded, and the location information is optimized.

Benefits of technology

It improves positioning accuracy and reduces positioning errors caused by abnormal grids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117279090B_ABST
    Figure CN117279090B_ABST
Patent Text Reader

Abstract

The application discloses a positioning method and device, electronic equipment and a readable storage medium, and belongs to the technical field of communication. The method comprises the following steps: acquiring a first candidate grid set corresponding to first wireless network information and a second candidate grid set corresponding to first base station information according to the first wireless network information and the first base station information scanned by the electronic equipment at a first time; calculating an abnormal coefficient according to the first candidate grid set and the second candidate grid set; acquiring positioning information of at least one historical position of the electronic equipment in the case that the abnormal coefficient indicates that the candidate grid set is abnormal, wherein the candidate grid set comprises the first candidate grid set and the second candidate grid set; obtaining the credibility of a candidate grid in the candidate grid set according to the positioning information of the at least one historical position; and determining the positioning information of the electronic equipment according to the candidate grid in the case that the credibility is greater than a first threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, specifically relating to positioning methods, devices, electronic devices, and readable storage media. Background Technology

[0002] In the mobile internet era, user location serves as the input for most location-based services (LBS), and the accuracy of this location significantly impacts the user's device experience.

[0003] Traditional positioning methods include network positioning. In network positioning, the real world needs to be spatially encoded beforehand, dividing it into grids of roughly equal size. Then, historical signal fingerprints are established for each grid. During positioning, the device sends base station signals, wireless network signals, Bluetooth signals, etc., received from the network server. The network server recalls grids where these signals have historically appeared based on the received signals, designating them as candidate grids. It then compares the historical signal fingerprints of these candidate grids in real time to rank them. Finally, the top-ranked candidate grid is input into a deep positioning model for fine-tuning, thereby predicting the user's location.

[0004] It is evident that in existing technologies, if the recalled candidate grids are inaccurate, it will cause a large positioning error. Summary of the Invention

[0005] The purpose of this application embodiment is to provide a positioning method that can solve the problem in the prior art that if the recalled candidate grid is inaccurate, it will cause a large positioning error.

[0006] In a first aspect, embodiments of this application provide a positioning method, the method comprising: obtaining a first candidate grid set corresponding to the first wireless network information and a second candidate grid set corresponding to the first base station information based on first wireless network information and first base station information scanned by an electronic device in a first time; calculating an anomaly coefficient based on the first candidate grid set and the second candidate grid set; when the anomaly coefficient indicates that the candidate grid set is abnormal, obtaining positioning information of at least one historical location of the electronic device, the candidate grid set including the first candidate grid set and the second candidate grid set; for each candidate grid in the candidate grid set, obtaining the confidence level of the candidate grid based on the positioning information of the at least one historical location; and determining the positioning information of the electronic device based on the candidate grid when the confidence level is greater than a first threshold.

[0007] Secondly, embodiments of this application provide a positioning device, comprising: a first acquisition module, configured to acquire a first candidate grid set corresponding to the first wireless network information and a second candidate grid set corresponding to the first base station information based on first wireless network information and first base station information scanned by an electronic device in a first time; a calculation module, configured to calculate an anomaly coefficient based on the first candidate grid set and the second candidate grid set; a second acquisition module, configured to acquire positioning information of at least one historical location of the electronic device when the anomaly coefficient indicates that the candidate grid set is abnormal, wherein the candidate grid set includes the first candidate grid set and the second candidate grid set; a processing module, configured to obtain the credibility of the candidate grid in the candidate grid set based on the positioning information of the at least one historical location; and a first determination module, configured to determine the positioning information of the electronic device based on the candidate grid when the credibility is greater than a first threshold.

[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0012] In the embodiments of this application, based on the current environment of the electronic device, first base station information and first wireless network information scanned by the electronic device are obtained. A first candidate grid set is obtained from the server based on the first base station information, and a second candidate grid set is obtained from the server based on the first wireless network information. Then, an anomaly coefficient is obtained based on the relationship between the two candidate grid sets. When the candidate grid set obtained based on the anomaly coefficient is deemed abnormal, the positioning information of at least one historical location of the electronic device is obtained. The credibility of each candidate grid is obtained based on the positioning information of at least one historical location, and candidate grids with a credibility greater than a first threshold are found as candidate grids for determining fine-grained positioning information. Therefore, based on the embodiments of this application, the candidate grids are optimized before determining the positioning information to eliminate abnormal candidate grids and improve positioning accuracy. Attached Figure Description

[0013] Figure 1 This is a flowchart of the positioning method according to an embodiment of this application;

[0014] Figure 2 This is one of the illustrative diagrams illustrating the positioning method according to an embodiment of this application;

[0015] Figure 3 This is the second illustrative diagram illustrating the positioning method according to an embodiment of this application;

[0016] Figure 4 This is the third illustrative diagram illustrating the positioning method of this application embodiment;

[0017] Figure 5 This is the fourth illustrative diagram illustrating the positioning method of this application embodiment;

[0018] Figure 6 This is the fifth illustrative diagram illustrating the positioning method of this application embodiment;

[0019] Figure 7 This is the sixth illustrative diagram illustrating the positioning method of this application embodiment;

[0020] Figure 8 This is the seventh illustrative diagram illustrating the positioning method of this application embodiment;

[0021] Figure 9 This is a block diagram of a positioning device according to an embodiment of this application;

[0022] Figure 10 This is one of the hardware structure diagrams of the electronic device according to an embodiment of this application;

[0023] Figure 11 This is the second schematic diagram of the hardware structure of the electronic device according to an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] The positioning method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0027] Figure 1 A flowchart of a positioning method according to an embodiment of this application is shown. The method is applied to an electronic device and includes:

[0028] Step 110: Based on the first wireless network information and the first base station information scanned by the electronic device in the first time, obtain the first candidate grid set corresponding to the first wireless network information, and obtain the second candidate grid set corresponding to the first base station information.

[0029] The first base station information includes: the identity number (ID) of the currently connected base station and the ID of the neighboring base station.

[0030] The first wireless network information includes the Service Set Identifier (SSID), Basic Service Set Identifier (BSSID), Received Signal Strength Indicator (RSSI), and other information for the currently scanning wireless network (WIFI) signal.

[0031] In this step, the electronic device scans the first base station information and the first wireless network information in the current environment. Based on the first base station information, it queries the server's large base station grid table to obtain the historical grid set that appeared in the first base station information, and based on the first wireless network information, it queries the server's large wireless network grid table to obtain the historical grid set that appeared in the first wireless network information. Then, it performs grid deduplication on the two historical grid sets to obtain the wireless network candidate grid set A (i.e., the first candidate grid set) and the base station candidate grid set B (i.e., the second candidate grid set) for the current positioning.

[0032] Among them, the first time information is the current time, that is, the time information corresponding to when the electronic device scans the first base station information and the first wireless network information in the current environment.

[0033] Step 120: Calculate the anomaly coefficients based on the first candidate mesh set and the second candidate mesh set.

[0034] In this step, depending on the value of the calculated anomaly coefficient, it can be used to indicate whether the candidate mesh set determined in step 110 is abnormal or normal.

[0035] The candidate mesh set determined in step 110 includes a first candidate mesh set and a second candidate mesh set.

[0036] Step 130: When the anomaly coefficient indicates that the candidate grid set is abnormal, obtain the location information of at least one historical location of the electronic device, wherein the candidate grid set includes a first candidate grid set and a second candidate grid set.

[0037] When the anomaly coefficient indicates that the candidate grid set is abnormal, it means that there are a large number of abnormal candidate grids in the candidate grid set determined in step 110. When used in the subsequent fine positioning process, the probability of selecting abnormal candidate grids is also high, so the probability of large positioning errors is also high, and therefore it is necessary to remove abnormal candidate grids.

[0038] In this step, abnormal candidate grids in the candidate grid set are determined by combining the location information of at least one historical location of the electronic device.

[0039] Optionally, to avoid introducing new errors during the process of eliminating abnormal candidate grids, the location information of all historical locations is filtered.

[0040] For reference, historical location refers to the location where an electronic device was previously located. Through filtering based on conditions, historical locations with complete, valid (e.g., domestic), time-sensitive (e.g., located within the past few hours), and reliable information are selected. Specifically, big data research on location information has found that a hybrid positioning method using both base stations and wireless networks is more accurate than using only base stations or only wireless networks. In this hybrid positioning, the more wireless networks and base stations used, the higher the positioning accuracy. Therefore, "reliable" can be interpreted based on the number of wireless networks and base stations used during positioning; the more, the more reliable. It can be set as follows: when the number of wireless networks is greater than n and the number of base stations is greater than m, the historical location information is considered reliable.

[0041] Furthermore, outlier detection is performed using the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm to remove location information from historical locations with large errors. Finally, a set H of historical location information is obtained, where each element is a user's location information within the past h hours, including the latitude, longitude, and location time.

[0042] Step 140: For each candidate grid in the candidate grid set, the credibility of the candidate grid is obtained based on the location information of at least one historical location.

[0043] For any candidate grid in the candidate grid set, using the location information of real historical locations as a reference, if the authenticity of the candidate grid can be verified based on the location information of multiple historical locations, then the candidate grid is considered credible; conversely, if the authenticity of the candidate grid cannot be verified based on multiple historical location information, then the candidate grid is considered unreliable.

[0044] The credibility of candidate grids is used to indicate whether a candidate grid is trustworthy. A first threshold is set; when the credibility is greater than the first threshold, the candidate grid is considered trustworthy; conversely, when the credibility is less than or equal to the first threshold, the candidate grid is considered untrustworthy. Correspondingly, untrustworthy candidate grids, i.e., abnormal candidate grids, can be eliminated.

[0045] Step 150: If the confidence level is greater than the first threshold, determine the location information of the electronic device based on the candidate grid.

[0046] In this step, reliable candidate meshes are retained for subsequent fine localization processes, while unreliable candidate meshes are discarded.

[0047] Optionally, the first threshold can be set by the user or automatically by the system.

[0048] In the embodiments of this application, based on the current environment of the electronic device, first base station information and first wireless network information scanned by the electronic device are obtained. A first candidate grid set is obtained from the server based on the first base station information, and a second candidate grid set is obtained from the server based on the first wireless network information. Then, an anomaly coefficient is obtained based on the relationship between the two candidate grid sets. When the candidate grid set obtained based on the anomaly coefficient is deemed abnormal, the positioning information of at least one historical location of the electronic device is obtained. The credibility of each candidate grid is obtained based on the positioning information of at least one historical location, and candidate grids with a credibility greater than a first threshold are found as candidate grids for determining fine-grained positioning information. Therefore, based on the embodiments of this application, the candidate grids are optimized before determining the positioning information to eliminate abnormal candidate grids and improve positioning accuracy.

[0049] In the flow of the positioning method according to another embodiment of this application, step 120 includes:

[0050] Sub-step A1: Calculate the first ratio based on the first number of candidate grids contained in the first candidate grid set and the second number of candidate grids contained in the second candidate grid set. The range of the first ratio is [0, 1].

[0051] Sub-step A2: If the first ratio is greater than the second threshold, calculate the anomaly coefficient based on the intersection of the first candidate grid set and the second candidate grid set, and the union of the first candidate grid set and the second candidate grid set.

[0052] Sub-step A3: If the first ratio is less than or equal to the second threshold, calculate the anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set.

[0053] Alternatively, the method for calculating the anomaly coefficient is given in formula group (1):

[0054]

[0055] In formula group (1), Abn is used to represent the anomaly coefficient. |A| is used to represent the first proportion, |B| is used to represent the first quantity, and |B| is used to represent the second quantity. The first proportion is taken as... and The smaller value in the first ratio is used, so the range of the first ratio is [0, 1]. A∩B represents the intersection of the first and second candidate grid sets, A∪B represents the union of the first and second candidate grid sets, |A∩B| represents the number of candidate grids in the intersection, and |A∪B| represents the number of candidate grids in the union. τ represents the second threshold, 0 ≤ τ ≤ 1, such as τ = 0.3. τ is defined as the imbalance factor.

[0056] See Figure 2 "A" represents candidate meshes in the first candidate mesh set, "B" represents candidate meshes in the second candidate mesh set, and "A / B" represents overlapping candidate meshes in the two sets. The first ratio in the figure is 6 / 7. When the first ratio is greater than the second threshold, it indicates that the number of meshes in the two sets is not significantly different. When calculating the anomaly coefficient, the ratio between the number of meshes in the intersection set and the number of meshes in the union set is calculated. Figure 2 The ratio (4 / 9) ranges from [0, 1]. The closer the ratio is to 1, the more overlapping candidate grids there are in the two sets, and the lower the probability of the candidate grid set being abnormal. This is because the locations corresponding to the candidate grids in the candidate grid set have historically been connected to both the current first base station information and the first wireless network information. Furthermore, subtracting this ratio from 1 yields the anomaly coefficient. The closer the anomaly coefficient is to 1, the higher the probability of the candidate grid set being abnormal; conversely, the closer the anomaly coefficient is to 0, the lower the probability of the candidate grid set being abnormal.

[0057] See Figure 3 “A” represents a candidate grid in the first candidate grid set, “B” represents a candidate grid in the second candidate grid set, and “A / B” represents an overlapping candidate grid in the two sets. The first ratio in the figure is 1 / 4. When the first ratio is less than or equal to the second threshold (e.g., 0.3), it means that the number of grids in one set is less than 30% of the number of grids in the other set. Therefore, it is considered that the two sets are unbalanced. This phenomenon may be caused by the signal strength of the wireless network or base station, or by obstacles near the signal transmitter. In this case, if the first formula in formula group (1) is used, the abnormality coefficient is 1-1 / 9=8 / 9, which is close to 1. The abnormality probability of the candidate grid set is high. However, in reality, the user may be in that overlapping candidate grid. In this case, the abnormality coefficient may be artificially high, which does not match the real situation. Therefore, in this case, the abnormality coefficient can be calculated by using the second formula in formula group (1), which can solve the problem of artificially high abnormality coefficient caused by the imbalance of the two sets.

[0058] In this embodiment, a method for calculating the anomaly coefficient using formula group (1) is provided. Formula group (1) includes two formulas, which are respectively for the two cases of large and small differences in the number of candidates. This can avoid the problem of the anomaly coefficient being artificially high due to the large difference in the number of candidates. Finally, the probability of anomalies in the candidate grid set can be evaluated by the anomaly coefficient with practical significance, so that the evaluation result is more accurate.

[0059] In another embodiment of the positioning method of this application, after step 120, the method further includes:

[0060] Step B1: If the anomaly coefficient is greater than the third threshold, determine that the anomaly coefficient indicates an anomaly in the candidate grid set.

[0061] The range of the third threshold is (0, 1).

[0062] The third threshold can be defined as the anomaly detection threshold. The third threshold can be set by the user or automatically by the system.

[0063] The setting is as follows: when the anomaly coefficient is greater than the third threshold, the probability of the candidate grid set being abnormal is high enough, and the anomaly coefficient is considered to indicate that the candidate grid set is abnormal; conversely, when the anomaly coefficient is less than or equal to the third threshold, the probability of the candidate grid set being abnormal is low, and the anomaly coefficient is considered to indicate that the candidate grid set is normal.

[0064] In this embodiment, a third threshold is used to divide the two ranges to determine which range the calculated anomaly coefficient falls into, thereby determining whether the anomaly coefficient indicates that the candidate grid set is normal or abnormal.

[0065] In the flow of the positioning method according to another embodiment of this application, step 140 includes:

[0066] Sub-step C1: For any historical location, calculate the shortest path from any historical location to the candidate grid based on the coordinate sub-information in the location information of any historical location.

[0067] In this step, a shortest path algorithm based on road network data, such as Dijkstra's algorithm, is used for path planning to obtain the shortest path from a historical location i to a candidate grid j. The length of this shortest path is the shortest distance D. ij .

[0068] The distance refers to the distance that can be reached between two locations via roads, i.e., the navigation distance.

[0069] For reference, road network data is a network composed of road intersections and the travel distances between intersections. Each intersection can be considered a node, corresponding to a location. See also Figure 4 The historical location i 401 and candidate grid j 402 are mapped to the nearest nodes i 403 and j 404 in the road network. For example, the coordinate sub-information of the historical location i and the Euclidean distance of all road network nodes are calculated, and the nearest node i is selected; similarly, the center coordinate information of the candidate grid j and the Euclidean distance of all road network nodes are calculated, and the nearest node j is selected.

[0070] Further, see Figure 5 Initialize a distance array, set node i as the starting point, and initialize the path length for all nodes. If a node is adjacent to the starting point, the path length is its distance; otherwise, the path length is infinite. Mark all nodes as unvisited. See next step. Figure 6 Select the unvisited node k with the shortest path length as the current node and mark it as visited.

[0071] Next, see Figure 7 Calculate the distance D′ from node k to its neighboring unvisited node m. im =D ik +D km If D′ im <D im If the distance from node i to the unvisited node m is shorter than the current distance, then update the distance D of node m. im =D′ im .

[0072] Repeat the previous steps until all nodes have been visited, or until node j has been visited.

[0073] Finally, see Figure 8 By working backward from node j, traversing the parent nodes of each node back to node i, we obtain the shortest path and its length D. ij That is, the shortest route.

[0074] Sub-step C2: Calculate the first interval duration based on the time sub-information in the location information of any historical location and the first time information.

[0075] The first interval duration is the time difference between the time sub-information in the historical location and the first time information.

[0076] The time sub-information is the time when the historical location was located, and the first time information is the current time.

[0077] Sub-step C3: Calculate the distance sub-confidence of any historical location relative to the candidate grid based on the shortest path and the first interval duration, and calculate the weight value of any historical location based on the first interval duration.

[0078] Optionally, refer to formula group (2) to calculate the distance sub-confidence of historical position i with respect to candidate grid j. Wherein,

[0079]

[0080] In formula group (2), δ ij D is used to represent the distance sub-confidence of historical position i with respect to candidate grid j. ij Δt is used to represent the shortest path from historical position i to candidate grid j. i V is used to represent the duration of the first interval. abnormal Used to represent abnormal speed thresholds.

[0081] The abnormal speed threshold refers to speeds that are impossible to achieve in daily life. If the speed from historical position i to candidate grid j exceeds the abnormal speed threshold, the shortest path from historical position i to candidate grid j is considered unreliable, and the distance sub-confidence is set to 0; otherwise, it is set to 1, indicating that historical position i has voted for candidate grid j. The abnormal speed threshold can be automatically set by the system based on big data to conform to speed thresholds achievable in daily life.

[0082] Therefore, for a candidate grid j, it may receive votes from multiple historical positions.

[0083] Furthermore, the freshness weight ρ of historical position i i This refers to the weight value of historical location i. The weight of a vote for historical location i decreases as its historical information becomes more distant. This is because a user's location and environment are constantly changing dynamically; therefore, the further back in time a historical location has been located, the greater the potential for variables during this process, and thus the lower its vote weight should be.

[0084] Optionally, refer to formula (3) to calculate the weight value of historical position i for candidate grid j. Wherein,

[0085]

[0086] Sub-step C4: Calculate the confidence of the candidate grid based on the distance sub-confidence of at least one historical location and the weight value of at least one historical location.

[0087] Optionally, refer to formula (4) to calculate the confidence level Conf of candidate grid j. j .in,

[0088]

[0089] Conf j If the value is greater than the first threshold, the corresponding candidate grid is used for subsequent fine localization; otherwise, the corresponding candidate grid is discarded.

[0090] In this embodiment, the positional relationship between historical locations and candidate grids is used to determine whether the shortest path between them is reasonable, thus determining the reliability of each candidate grid relative to its historical location. If reliable, the historical location votes for the candidate grid, resulting in a different number of votes for each candidate grid. Combining this with the weight value of each historical location, the reliability of each candidate grid is finally determined. Therefore, the method in this embodiment effectively eliminates unreliable candidate grids using a voting mechanism.

[0091] In the flow of the positioning method according to another embodiment of this application, step 150 includes:

[0092] Sub-step D1: Calculate the second ranking score of the candidate grid based on the first ranking score of the candidate grid in the first localization model and the confidence of the candidate grid.

[0093] In this step, the trusted candidate grids are input into the positioning module. Combining the grid's historical fingerprint information and signal information (signal information includes the first base station information and the first wireless network information), the coarse positioning model (i.e., the first positioning model) sorts the candidate grids, obtaining the first ranking score S for each candidate grid. j Then, combined with the credibility of each candidate grid, Conf j The second ranking score for each candidate grid is obtained. j .

[0094] Optionally, referring to formula (5), calculate the second ranking score of candidate grid j. j .in,

[0095] Score j =Conf j *S j (5)

[0096] In the coarse localization model, the real-time signal fingerprint features are compared with the historical fingerprint features of the grid, the grids are sorted, and the candidate grid where the user is most likely to be located is found.

[0097] Sub-step D2: Determine the first candidate grid based on the second ranking scores of each candidate grid in the candidate grid set whose confidence is greater than the first threshold.

[0098] Optionally, the candidate grid with the highest second ranking score is selected as the first candidate grid.

[0099] Sub-step D3: Determine the positioning information of the electronic device in the second positioning model based on the first candidate grid.

[0100] The first candidate grid and its features, the first base station information, and the first wireless network information are input into the fine-grained positioning model (i.e., the second positioning model) for fine positioning. Finally, the network positioning result is output, and the output result includes at least the latitude and longitude of the current location and the positioning time.

[0101] In this embodiment, based on the ranking of candidate grids obtained from coarse positioning, and further combined with the corresponding confidence level, candidate grids with low confidence can be adjusted to ensure that the candidate grids with higher rankings have higher confidence in the final determination.

[0102] In summary, the purpose of this application is to provide a network positioning data preprocessing method that identifies anomalies before positioning and utilizes historical positioning information to preprocess, filter, and sort the grid data before positioning. This directly improves the accuracy of the positioning results while minimizing the impact on the positioning success rate. In this application, based on candidate grids from multiple data sources, an improved anomaly detection algorithm is designed for actual business scenarios to achieve early identification of abnormal positioning situations. When using historical positioning data to filter candidate grids for anomaly identification, a historical positioning voting mechanism combined with road network data and time information is used to achieve more accurate filtering of large abnormal grids. When sorting the filtered grids, the aforementioned preprocessing information is used as weights in the coarse positioning sorting, further improving the accuracy of the final positioning result. Therefore, this application can optimize network positioning results and reduce the phenomenon of large positioning errors caused by abnormal grids.

[0103] The positioning method provided in this application can be executed by a positioning device. This application uses the example of a positioning device executing the positioning method to illustrate the positioning device provided in this application.

[0104] Figure 9 A block diagram of a positioning device according to an embodiment of this application is shown. The device includes:

[0105] The first acquisition module 10 is used to acquire a first candidate grid set corresponding to the first wireless network information and a second candidate grid set corresponding to the first base station information based on the first wireless network information and the first base station information scanned by the electronic device in the first time.

[0106] Calculation module 20 is used to calculate anomaly coefficients based on the first candidate mesh set and the second candidate mesh set;

[0107] The second acquisition module 30 is used to acquire the location information of at least one historical location of the electronic device when the anomaly coefficient indicates that the candidate grid set is abnormal. The candidate grid set includes a first candidate grid set and a second candidate grid set.

[0108] The processing module 40 is used to obtain the credibility of a candidate grid based on the location information of at least one historical location for the candidate grid in the candidate grid set.

[0109] The first determining module 50 is used to determine the positioning information of the electronic device based on the candidate grid when the confidence level is greater than a first threshold.

[0110] In the embodiments of this application, based on the current environment of the electronic device, first base station information and first wireless network information scanned by the electronic device are obtained. A first candidate grid set is obtained from the server based on the first base station information, and a second candidate grid set is obtained from the server based on the first wireless network information. Then, an anomaly coefficient is obtained based on the relationship between the two candidate grid sets. When the candidate grid set obtained based on the anomaly coefficient is deemed abnormal, the positioning information of at least one historical location of the electronic device is obtained. The credibility of each candidate grid is obtained based on the positioning information of at least one historical location, and candidate grids with a credibility greater than a first threshold are found as candidate grids for determining fine-grained positioning information. Therefore, based on the embodiments of this application, the candidate grids are optimized before determining the positioning information to eliminate abnormal candidate grids and improve positioning accuracy.

[0111] Optionally, the computing module 20 includes:

[0112] The first calculation unit is used to calculate a first ratio based on the first number of candidate grids contained in the first candidate grid set and the second number of candidate grids contained in the second candidate grid set, wherein the range of the first ratio is [0, 1].

[0113] The second calculation unit is used to calculate the anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set, and the union between the first candidate grid set and the second candidate grid set, when the first ratio is greater than the second threshold.

[0114] The third calculation unit is used to calculate the anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set when the first ratio is less than or equal to the second threshold.

[0115] Optionally, the device further includes:

[0116] The second determining module is used to determine that the anomaly coefficient indicates an anomaly in the candidate grid set when the anomaly coefficient is greater than the third threshold.

[0117] The range of the third threshold is (0, 1).

[0118] Optionally, the processing module 40 includes:

[0119] The fourth calculation unit is used to calculate the shortest path from any historical location to the candidate grid based on the coordinate sub-information in the positioning information of any historical location.

[0120] The fifth calculation unit is used to calculate the first interval duration based on the time sub-information in the positioning information of any historical location and the first time information;

[0121] The sixth calculation unit is used to calculate the distance sub-confidence of any historical location relative to the candidate grid based on the shortest path and the first interval duration, and to calculate the weight value of any historical location based on the first interval duration.

[0122] The seventh calculation unit is used to calculate the confidence of the candidate grid based on the distance sub-confidence of at least one historical position and the weight value of at least one historical position.

[0123] Optionally, the first determining module 50 includes:

[0124] The eighth calculation unit is used to calculate the second ranking score of the candidate grid based on the first ranking score of the candidate grid in the first localization model and the confidence of the candidate grid.

[0125] The first determining unit is used to determine the first candidate grid based on the second ranking scores of each candidate grid in the candidate grid set whose confidence is greater than the first threshold.

[0126] The second determining unit is used to determine the positioning information of the electronic device in the second positioning model based on the first candidate grid.

[0127] The device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0128] The apparatus in this application embodiment can be an apparatus with an action system. The action system can be an Android action system, an iOS action system, or other possible action systems, and this application embodiment does not specifically limit it.

[0129] The apparatus provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.

[0130] Optionally, such as Figure 10 As shown, this application embodiment also provides an electronic device 100, including a processor 101, a memory 102, and a program or instructions stored in the memory 102 and executable on the processor 101. When the program or instructions are executed by the processor 101, they implement the various steps of any of the above-described positioning method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0131] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0132] Figure 11 A schematic diagram of the hardware structure of an electronic device 1000 according to an embodiment of this application.

[0133] The electronic device 1000 includes, but is not limited to, the following components: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, processor 1010, camera 1011, etc.

[0134] Those skilled in the art will understand that the electronic device 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0135] The processor 1010 is configured to: obtain a first candidate grid set corresponding to the first wireless network information and a second candidate grid set corresponding to the first base station information based on the first wireless network information and the first base station information scanned by the electronic device in a first time; calculate an anomaly coefficient based on the first candidate grid set and the second candidate grid set; if the anomaly coefficient indicates that the candidate grid set is abnormal, obtain location information of at least one historical location of the electronic device, wherein the candidate grid set includes the first candidate grid set and the second candidate grid set; for each candidate grid in the candidate grid set, obtain the confidence level of the candidate grid based on the location information of the at least one historical location; and if the confidence level is greater than a first threshold, determine the location information of the electronic device based on the candidate grid.

[0136] In the embodiments of this application, based on the current environment of the electronic device, first base station information and first wireless network information scanned by the electronic device are obtained. A first candidate grid set is obtained from the server based on the first base station information, and a second candidate grid set is obtained from the server based on the first wireless network information. Then, an anomaly coefficient is obtained based on the relationship between the two candidate grid sets. When the candidate grid set obtained based on the anomaly coefficient is deemed abnormal, the positioning information of at least one historical location of the electronic device is obtained. The credibility of each candidate grid is obtained based on the positioning information of at least one historical location, and candidate grids with a credibility greater than a first threshold are found as candidate grids for determining fine-grained positioning information. Therefore, based on the embodiments of this application, the candidate grids are optimized before determining the positioning information to eliminate abnormal candidate grids and improve positioning accuracy.

[0137] Optionally, the processor 1010 is further configured to calculate a first ratio based on a first number of candidate grids contained in the first candidate grid set and a second number of candidate grids contained in the second candidate grid set, wherein the range of the first ratio is [0, 1]; if the first ratio is greater than a second threshold, calculate an anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set and the union between the first candidate grid set and the second candidate grid set; if the first ratio is less than or equal to the second threshold, calculate an anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set.

[0138] Optionally, the processor 1010 is further configured to determine that the anomaly coefficient indicates an anomaly in the candidate grid set if the anomaly coefficient is greater than a third threshold; wherein the third threshold is in the range of (0, 1).

[0139] Optionally, the processor 1010 is further configured to, for any historical location, calculate the shortest path from the arbitrary historical location to the candidate grid based on the coordinate sub-information in the positioning information of the arbitrary historical location; calculate a first interval duration based on the time sub-information in the positioning information of the arbitrary historical location and the first time information; calculate the distance sub-confidence of the arbitrary historical location relative to the candidate grid based on the shortest path and the first interval duration, and calculate the weight value of the arbitrary historical location based on the first interval duration; and calculate the confidence of the candidate grid based on the distance sub-confidence of the at least one historical location and the weight value of the at least one historical location.

[0140] Optionally, the processor 1010 is further configured to: calculate a second ranking score of the candidate grid based on a first ranking score of the candidate grid in a first positioning model and the credibility of the candidate grid; determine a first candidate grid based on the second ranking scores of each candidate grid in the candidate grid set whose credibility is greater than the first threshold; and determine the positioning information of the electronic device in a second positioning model based on the first candidate grid.

[0141] In summary, the purpose of this application is to provide a network positioning data preprocessing method that identifies anomalies before positioning and utilizes historical positioning information to preprocess, filter, and sort the grid data before positioning. This directly improves the accuracy of the positioning results while minimizing the impact on the positioning success rate. In this application, based on candidate grids from multiple data sources, an improved anomaly detection algorithm is designed for actual business scenarios to achieve early identification of abnormal positioning situations. When using historical positioning data to filter candidate grids for anomaly identification, a historical positioning voting mechanism combined with road network data and time information is used to achieve more accurate filtering of large abnormal grids. When sorting the filtered grids, the aforementioned preprocessing information is used as weights in the coarse positioning sorting, further improving the accuracy of the final positioning result. Therefore, this application can optimize network positioning results and reduce the phenomenon of large positioning errors caused by abnormal grids.

[0142] It should be understood that, in this embodiment, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042. The GPU 10041 processes image data of still images or video images obtained by an image capture device (such as a camera) in video image capture mode or image capture mode. The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here. The memory 1009 can be used to store software programs and various data, including but not limited to applications and motion systems. Processor 1010 may integrate an application processor and a modem processor. The application processor mainly handles the action system, user page, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 1010.

[0143] The memory 1009 can be used to store software programs and various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1009 in this embodiment includes, but is not limited to, these and any other suitable types of memory.

[0144] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.

[0145] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described positioning method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0146] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0147] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described positioning method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0148] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0149] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the positioning method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0150] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0152] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A positioning method, characterized in that, The method includes: Based on the first wireless network information and the first base station information scanned by the electronic device in the first time, a first candidate grid set corresponding to the first wireless network information and a second candidate grid set corresponding to the first base station information are obtained. Calculate the anomaly coefficient based on the first candidate mesh set and the second candidate mesh set; When the anomaly coefficient indicates that the candidate grid set is abnormal, the positioning information of at least one historical location of the electronic device is obtained, wherein the candidate grid set includes the first candidate grid set and the second candidate grid set; For each candidate grid in the candidate grid set, the credibility of the candidate grid is obtained based on the location information of the at least one historical location. If the confidence level is greater than a first threshold, the location information of the electronic device is determined based on the candidate grid.

2. The method according to claim 1, characterized in that, The step of calculating the anomaly coefficient based on the first candidate grid set and the second candidate grid set includes: A first ratio is calculated based on the first number of candidate grids contained in the first candidate grid set and the second number of candidate grids contained in the second candidate grid set, wherein the range of the first ratio is [0, 1]. When the first ratio is greater than the second threshold, the anomaly coefficient is calculated based on the intersection of the first candidate grid set and the second candidate grid set, and the union of the first candidate grid set and the second candidate grid set. When the first ratio is less than or equal to the second threshold, the anomaly coefficient is calculated based on the intersection between the first candidate grid set and the second candidate grid set.

3. The method according to claim 1, characterized in that, After calculating the anomaly coefficients based on the first candidate mesh set and the second candidate mesh set, the method further includes: If the anomaly coefficient is greater than a third threshold, the anomaly coefficient is determined to indicate an anomaly in the candidate grid set; The range of the third threshold is (0, 1).

4. The method according to claim 1, characterized in that, The step of obtaining the credibility of the candidate grid based on the location information of the at least one historical location includes: For any historical location, calculate the shortest path from the historical location to the candidate grid based on the coordinate sub-information in the location information of the historical location; The first interval duration is calculated based on the time sub-information in the location information of any historical location and the first time information; Based on the shortest path and the first interval duration, calculate the distance sub-confidence of the arbitrary historical location relative to the candidate grid, and calculate the weight value of the arbitrary historical location based on the first interval duration. The confidence level of the candidate grid is calculated based on the distance sub-confidence of the at least one historical location and the weight value of the at least one historical location.

5. The method according to claim 1, characterized in that, Determining the location information of the electronic device based on the candidate grid includes: Calculate the second ranking score of the candidate grid based on the first ranking score of the candidate grid in the first localization model and the confidence level of the candidate grid; The first candidate grid is determined based on the second ranking score of each candidate grid in the candidate grid set whose confidence level is greater than the first threshold; The positioning information of the electronic device is determined in the second positioning model based on the first candidate grid.

6. A positioning device, characterized in that, The device includes: The first acquisition module is used to acquire a first candidate grid set corresponding to the first wireless network information and a second candidate grid set corresponding to the first base station information based on the first wireless network information and the first base station information scanned by the electronic device in the first time. The calculation module is used to calculate the anomaly coefficient based on the first candidate mesh set and the second candidate mesh set; The second acquisition module is used to acquire the location information of at least one historical location of the electronic device when the anomaly coefficient indicates that the candidate grid set is abnormal, wherein the candidate grid set includes the first candidate grid set and the second candidate grid set. A processing module is used to obtain the credibility of a candidate grid based on the location information of at least one historical location for each candidate grid in the candidate grid set. The first determining module is used to determine the location information of the electronic device based on the candidate grid when the confidence level is greater than a first threshold.

7. The apparatus according to claim 6, characterized in that, The computing module includes: The first calculation unit is used to calculate a first ratio based on the first number of candidate grids contained in the first candidate grid set and the second number of candidate grids contained in the second candidate grid set, wherein the range of the first ratio is [0, 1]. The second calculation unit is used to calculate the anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set, and the union between the first candidate grid set and the second candidate grid set, when the first ratio is greater than the second threshold. The third calculation unit is used to calculate the anomaly coefficient based on the intersection between the first candidate grid set and the second candidate grid set when the first ratio is less than or equal to the second threshold.

8. The apparatus according to claim 6, characterized in that, The device further includes: The second determining module is used to determine that the anomaly coefficient indicates an anomaly in the candidate grid set when the anomaly coefficient is greater than the third threshold. The range of the third threshold is (0, 1).

9. The apparatus according to claim 6, characterized in that, The processing module includes: The fourth calculation unit is used to calculate the shortest path from any historical location to the candidate grid based on the coordinate sub-information in the positioning information of the arbitrary historical location. The fifth calculation unit is used to calculate the first interval duration based on the time sub-information in the positioning information of the arbitrary historical location and the first time information; The sixth calculation unit is used to calculate the distance sub-confidence of any historical location relative to the candidate grid based on the shortest path and the first interval duration, and to calculate the weight value of any historical location based on the first interval duration. The seventh calculation unit is used to calculate the credibility of the candidate grid based on the distance sub-credibility of the at least one historical position and the weight value of the at least one historical position.

10. The apparatus according to claim 6, characterized in that, The first determining module includes: The eighth calculation unit is used to calculate the second ranking score of the candidate grid based on the first ranking score of the candidate grid in the first positioning model and the confidence level of the candidate grid. The first determining unit is used to determine the first candidate grid based on the second ranking scores of each candidate grid in the candidate grid set whose confidence is greater than the first threshold. The second determining unit is used to determine the positioning information of the electronic device in the second positioning model based on the first candidate grid.

11. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the positioning method as described in any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the positioning method as described in any one of claims 1 to 5.