[0050] Example two
[0051] Reference figure 2 , Shows a flow chart of the steps of a method for determining the location of an AP according to the second embodiment of the present invention.
[0052] The method for determining the location of an AP in the embodiment of the present invention includes the following steps:
[0053] Step S202: Acquire AP location related information for the same AP uploaded by each terminal within a preset time range.
[0054] Wherein, the AP location related information includes: terminal location coordinates, time stamp, and terminal UUID (Universally Unique Identifier).
[0055] The AP location related information includes a corresponding relationship between the terminal location coordinates and the time stamp and the terminal UUID.
[0056] Step S204: Screen the acquired AP location related information according to the terminal UUID and the timestamp.
[0057] The obtained AP location related information is filtered, and the purpose is to delete AP related information repeatedly uploaded by the same terminal in the same time period. Filtering the acquired AP location related information can delete a large amount of wrong location related information uploaded by the same terminal, and reduce the impact of the wrong location related information on the accuracy of the AP location.
[0058] It should be noted that the length of the time period can be set by those skilled in the art according to actual needs, for example: dividing every 5 minutes into a time period; another example: dividing every 10 minutes into a time period; another example: dividing every 30 minutes is divided into a time period.
[0059] For example, if the time period is 5 minutes, and terminal A uploads AP location related information every 1 minute, terminal A will upload AP location related information 5 times in the same time period. During the screening, only the AP location related information uploaded by terminal A during the time period is retained.
[0060] It should be noted that this step is an optional step, and a person skilled in the art can choose whether to execute this step according to actual needs in the specific implementation process.
[0061] Step S206: Call preset clustering parameters.
[0062] After the location-related information is filtered, the filtered location-related information can be clustered according to the location coordinates. When performing clustering, it is necessary to call preset clustering parameters to complete according to the corresponding clustering algorithm.
[0063] Among them, the clustering parameters include: the average value of each class, the variance of each class, the distance of each class, the number of classes, and the number of iterations.
[0064] The specific value of each parameter in the clustering parameter can be set by a person skilled in the art according to actual needs in the specific implementation process, which is not specifically limited in the embodiment of the present invention.
[0065] Step S208: cluster the AP location related information according to the clustering parameters through the iterative self-organizing data analysis algorithm.
[0066] Among them, ISODATA (Iterative Self-Organizing Data Analysis Techniques Algorithm) is an unsupervised classification method for remote sensing images. After clustering the AP location related information according to the clustering parameters, multiple clusters may be clustered, or only one cluster may be clustered.
[0067] Step S210: Determine the reliability class according to the set rule.
[0068] When there are multiple categories, the AP location may have changed within the preset time range, or the AP location may not have changed, but the terminal location coordinates uploaded by the terminal are wrong, causing the terminal location coordinates to be discrete. However, in either case, a reliability class needs to be determined, and the AP's location coordinates are finally determined according to the AP position related information in the determined reliability class.
[0069] A preferred way to determine the reliable class according to preset rules when there are multiple classes is:
[0070] S1: Determine the amount of AP location-related information contained in each category;
[0071] For example: A total of three clusters are A, B, and C. Among them, category A contains 100 sets of AP location related information, category B contains 50 sets of AP location related information, and category C contains 5 sets of AP location related information. information.
[0072] S2: Sort the determined quantity in descending order;
[0073] S3: Determine the two corresponding classes that are ranked first and greater than the preset value as effective classes;
[0074] The preset value can be set by those skilled in the art according to actual needs, for example, set to 40, 50, 100, etc., which is not specifically limited in the embodiment of the present invention.
[0075] Still referring to the above example, assuming that the default value is 40, type A corresponds to 100, type B corresponds to 50, and type C corresponds to 5. Since the numbers 100 and 50 are ranked in the first two digits, and both are greater than the preset value, A Class and Class B are determined as valid classes.
[0076] It should be noted that if there are two top-ranked quantities after sorting, but since one of the quantities does not meet the preset value, the class corresponding to the quantity that does not meet the preset value is not determined as a valid class, and It is only necessary to determine the top ranked class as the reliable class. In this case, there is no need to perform step S4. Still referring to the above example, suppose the default value is 60, type A corresponds to 100, type B corresponds to 50, and type C corresponds to 5. Although the numbers 100 and 50 are ranked in the first two digits, 50 is less than the preset value, so 50 corresponds to Class B of cannot be determined as a valid class, but only class A corresponding to 100 can be determined as a reliable class.
[0077] S4: Determine the reliable class based on the timestamp contained in the valid class.
[0078] Since each group of AP location related information includes a time stamp, the reliability class can be determined by the time stamp included in each group of AP location related information in the effective class.
[0079] A preferred way to determine the reliable class based on the timestamp contained in the valid class is as follows:
[0080] According to the timestamp contained in each AP location-related information in the two effective classes, determine whether there is AP location-related information that overlaps in time in the two effective classes; if it exists, determine the effective class that contains the most AP location-related information as Reliable class; if it does not exist, determine the valid class containing the latest time stamp, and determine the valid class containing the latest time stamp as the reliable class.
[0081] It should be noted that when there is only one cluster after clustering, the clustered cluster is directly determined as a reliable cluster.
[0082] After clustering, there is only one class, it can be determined that the AP to be located has no position change within the preset time range, and there is no wrong coordinate in the terminal position coordinate uploaded by the terminal, so the terminal position coordinate does not have a discrete situation, so , There is no class that aggregates discrete terminal position coordinates.
[0083] Step S212: Determine the location of the AP according to the terminal location coordinates included in the reliable category.
[0084] When determining the location of the AP based on the terminal location coordinates included in the reliable class, the cluster center corresponding to the reliable class can be determined based on the terminal location coordinates included in the reliable class, and the cluster center is determined as the location of the AP.
[0085] When determining the cluster center corresponding to the reliable class based on the terminal position coordinates contained in the reliable class, the average value of the terminal position coordinates can be taken, and the obtained average value is determined as the coordinate corresponding to the cluster center.
[0086] The method for determining the location of the AP provided by the embodiment of the present invention only determines the location coordinates of the AP based on the location coordinates of the terminal. Even if there is an error, it is only a single error, which is compared with the existing error that needs to accumulate the location coordinates of the terminal, and The dual error of signal strength determines the AP location coordinates, which can improve the accuracy of the AP location coordinates. Not only that, the method for determining AP location provided by the embodiment of the present invention obtains a large amount of AP location related information uploaded by each terminal within a preset time range, and clusters the AP location related information according to the terminal location coordinates to obtain a reliable class. The AP location coordinates are determined based on a large number of reliable terminal location coordinates included in the reliable category, therefore, the influence of terminal location coordinate errors on the AP location coordinates can be reduced, and the accuracy of the AP location coordinates can be improved.