WO2021197377A1 - 设备位置判断方法、装置、计算机设备和存储介质 - Google Patents

设备位置判断方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2021197377A1
WO2021197377A1 PCT/CN2021/084425 CN2021084425W WO2021197377A1 WO 2021197377 A1 WO2021197377 A1 WO 2021197377A1 CN 2021084425 W CN2021084425 W CN 2021084425W WO 2021197377 A1 WO2021197377 A1 WO 2021197377A1
Authority
WO
WIPO (PCT)
Prior art keywords
wireless
distance
ssid
location
target area
Prior art date
Application number
PCT/CN2021/084425
Other languages
English (en)
French (fr)
Inventor
廖辉
Original Assignee
深圳市万普拉斯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市万普拉斯科技有限公司 filed Critical 深圳市万普拉斯科技有限公司
Publication of WO2021197377A1 publication Critical patent/WO2021197377A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/02Access restriction performed under specific conditions
    • H04W48/04Access restriction performed under specific conditions based on user or terminal location or mobility data, e.g. moving direction, speed
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S5/00Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
    • G01S5/02Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using radio waves

Definitions

  • This application relates to the field of wireless communication technology, and in particular to a method, device, computer equipment, and storage medium for determining the location of equipment.
  • WLAN Wireless Local Area Network, wireless local area network
  • WLAN Wireless Local Area Network, wireless local area network
  • the above scheme only uses the saved network as the basis for location judgment, and only based on the network in the recording environment when the WLAN is turned off. Although it can be avoided to automatically turn on the WLAN in place, the device can only gain Know the WLAN that can be scanned at that time, and then the information about the original location network environment is solidified, and the original location range is fixed to the signal range of the saved AP that was scanned at that time.
  • the device original location determination range is too small and too easy It is determined that the device leaves its original location, causing unnecessary WLAN connection functions to be turned on. Therefore, the current device location judgment method has a problem that the judgment accuracy is not high.
  • the present application provides a method, a device, a computer device, and a storage medium for determining a device location that can improve the accuracy of device location determination.
  • this application provides a method for determining the location of a device, and the method includes:
  • the distance refers to the number of wireless networks between a wireless AP and the current initial position
  • the target area refers to an area within a preset range centered on the initial position
  • the device includes:
  • the initialization module is used to add the wireless AP scanned at the current initial position to the first wireless AP set and initialize the distance of each wireless AP in the first wireless AP set when it is detected that the WLAN connection function of the device is turned off;
  • the scanning module is used to scan the wireless AP at the current location in real time, and add the scanned wireless AP to the second wireless AP set;
  • the distance determining module is configured to determine the distance of each wireless AP in the second wireless AP set based on the distance between the first wireless AP set and each wireless AP in the first wireless AP set;
  • the location determination module is used to determine whether the device has deviated from the target area according to the relationship between the distance of each wireless AP in the second wireless AP set and the preset distance threshold, and return to the step of real-time scanning of the wireless AP at the current location;
  • the distance refers to the number of wireless networks between a wireless AP and the current initial position
  • the target area refers to an area within a preset range centered on the initial position
  • the distance refers to the number of wireless networks between a wireless AP and the current initial position
  • the target area refers to an area within a preset range centered on the initial position
  • Another aspect of the present application is a computer-readable storage medium with a computer program stored thereon, and the computer program implements the following steps when executed by a processor:
  • the distance refers to the number of wireless networks between a wireless AP and the current initial position
  • the target area refers to an area within a preset range centered on the initial position
  • FIG. 1 is a schematic flowchart of a method for determining a device location in an embodiment
  • FIG. 2 is a schematic flowchart of a method for judging the location of a device in another embodiment
  • Figure 3 is a topological diagram of wireless AP distribution in a network environment in an embodiment
  • Figure 4 is a topology diagram of wireless AP distribution in a network environment in another embodiment
  • Fig. 5 is a structural block diagram of an apparatus for determining device position in an embodiment
  • Figure 6 is a structural block diagram of an apparatus for determining device position in another embodiment
  • Fig. 7 is an internal structure diagram of a computer device in an embodiment.
  • a method for determining the location of a device is provided.
  • the method is applied to a terminal as an example. It is understood that the method can also be applied to a server or In a system including a terminal and a server, it is realized through the interaction between the terminal and the server.
  • the method includes the following steps:
  • Step 202 Add the wireless AP scanned at the current initial position to the first wireless AP set, and initialize the distance of each wireless AP in the first wireless AP set.
  • the distance refers to the number of wireless networks between a wireless AP and the current initial position.
  • judging whether the location of the device has changed can be based on WLAN scanning. Taking the Android device as an example, WLAN scanning can still be performed when the WLAN is turned off. Therefore, the device can perform low-precision positioning through WLAN scanning regardless of whether the WLAN is turned on.
  • the native location estimation logic of Android devices is relatively simple: when the user turns off the WLAN, the SSID of the saved network scanned in the environment is recorded first, and then the WLAN scan is initiated irregularly. As long as the previously recorded SSID appears in the scan result, it is judged as a device In the original position range, and vice versa.
  • the WLAN When it is judged to move to another location, and the SSID of the saved network is scanned, the WLAN will be automatically turned on. Under this mechanism, as long as the user leaves the signal range of the saved network recorded when the WLAN is turned off, it will be judged to have moved to another location. In fact, the moving distance may be very short, such as moving to within the company. The location in the office where the WLAN signal is not good, therefore, the above solution still has the problem of low accuracy of determination.
  • the device uses a mobile phone with a WLAN connection function as an example.
  • the mobile phone detects that the WLAN connection function is turned off, the current location of the mobile phone is used as the initial position.
  • the WLAN connection function of the mobile phone is turned off, the WLAN scan It is still possible to proceed. Therefore, at this time, the wireless AP scanned in the current initial position can be regarded as the neighbor node of the current initial position, and the currently scanned wireless AP can be added to the first wireless AP set, and at the same time, the first wireless AP can be initialized. The distance of each wireless AP in the wireless AP set.
  • each wireless AP in the initialized first wireless AP set is an initial neighbor node
  • the distance of each wireless AP in the first wireless AP set can be initialized to zero. It can be understood that, in other embodiments, the distance of each wireless AP in the first wireless AP set is initialized to other values, and the trigger condition for starting wireless scanning is not limited to detecting that the WLAN connection function is turned off, and can be specifically based on actual conditions. It depends, there is no limit here.
  • Step 204 Scan the wireless AP at the current location in real time, and add the scanned wireless AP to the second wireless AP set.
  • the mobile device may always be in a mobile state. Therefore, in order to improve the accuracy of the location change, it is necessary to scan the wireless AP near the current location in real time. Location judgment provides a more accurate basis.
  • the scanning frequency can be set by setting the debugging efficiency and accuracy, and the scanning frequency can be set according to specific conditions. It is understandable that scanning can also be performed anytime and anywhere. In different application scenarios, the manner and size of the set scanning frequency can be different, which is not limited here.
  • the wireless AP obtained by real-time scanning may be added to the second wireless AP set.
  • Step 206 Determine the distance of each wireless AP in the second wireless AP set based on the distance between the first wireless AP set and each wireless AP in the first wireless AP set.
  • the distance of each wireless AP in the second wireless AP set may be determined based on the distance between the first wireless AP set and each wireless AP in the first wireless AP set.
  • Step 208 Determine whether the device has deviated from the target area according to the relationship between the distance of each wireless AP in the second wireless AP set and the preset distance threshold, and return to step 204.
  • the target area refers to the area within the preset range centered on the initial position.
  • the maximum allowable distance ie, the preset distance threshold
  • the preset distance threshold can be set to 2. It is understood that in other embodiments, the distance threshold can also be set to 3, 4 or other values, depending on the actual situation. Make a limit.
  • the distance used to describe the location relationship between a certain AP and the initial location of the device is defined, the wireless AP scanned from the current initial location is added to the first wireless AP set, and the first wireless AP is initialized.
  • the distance of each wireless AP in the wireless AP set and then based on the relationship between the distance of each wireless AP in the second wireless AP set and the preset distance threshold, it is determined whether the device deviates from the initial position range.
  • the above solution combines the signal coverage (distance) of multiple wireless APs as the basis for determining the initial location range of the device. Compared with the existing solution, the initial location range of the device is expanded, and the accuracy of location judgment is improved. Whether the AP has been saved, the location of the device can be accurately determined based on the location relationship.
  • step 208 includes:
  • Step 228 When the distance of the wireless AP in the second wireless AP set is less than or equal to the preset distance threshold, it is determined that the device does not deviate from the target area, and the wireless AP is added to the first wireless AP set;
  • Step 230 When the distance of the wireless APs in the second wireless AP set is greater than the preset distance threshold, it is determined that the device has deviated from the target area.
  • the preset distance threshold is 2 as an example. If the distance between the wireless APs in the second wireless AP set is less than or equal to 2, it indicates that the wireless APs in the current second wireless AP set are separated from the initial position of the wireless AP. The number of networks is less than 2, indicating that the device is still within the initial location range and does not deviate from the target area. Add the wireless AP to the first wireless AP set. When the distance between the wireless APs in the second wireless AP set is greater than 2, it is determined The device has deviated from the target area. In this embodiment, by comparing the relationship between the distance of each wireless AP in the second wireless AP set and the preset distance threshold, it can be simply and quickly determined whether the device deviates from the initial position range.
  • step 206 includes: step 226, marking wireless APs in the first wireless AP set as known wireless APs, when the second wireless AP set and the first wireless AP set exist
  • the same known wireless AP is the same
  • the shortest distance of the same known wireless AP is searched, and based on the shortest distance, the distance of the non-known wireless AP in the second wireless AP set is determined.
  • the distance of the unknown AP in the second wireless AP set is set to a fixed value.
  • determining the distance of each wireless AP in the moving process may be: marking the wireless AP in the first wireless AP set as a known wireless AP, which can be regarded as a known neighbor node.
  • the neighbor node known wireless AP
  • the new wireless AP can be regarded as the neighboring node of the wireless AP with the shortest distance among the known wireless APs, and it can be selected based on the same known wireless APs in the first wireless AP set and the second wireless AP set.
  • the wireless AP with the shortest distance determines the distance of the non-known wireless AP in the second wireless AP set; if there is no known wireless AP in the second wireless AP set currently scanned, it means that the device is here Time is no longer near the initial position. At this time, the distance of the unknown wireless AP in the second wireless AP set can be set to positive infinity.
  • determining the distance of the unknown wireless AP in the second wireless AP set includes:
  • the distance of the current non-known wireless AP is consistent with the SSID of the same known wireless AP, set the distance of the current non-known wireless AP to the minimum distance of the known wireless AP with the same SSID;
  • the distance of the current non-known wireless AP is set to the shortest distance plus 1.
  • ESS Extended Service Set
  • the wireless network signal of the company's intranet usually covers the whole company, and the user turns off the WLAN of the device in the company, and the user should not want to use the wireless network of the entire company subjectively, and if the office area of this company is compared Large, there are many APs in the intranet ESS.
  • the distance is calculated only by judging whether the BSS is adjacent or not. The final original location range may not cover the entire company.
  • the WLAN may still be automatically turned on; Whether the ESS is adjacent to calculate the distance, treat APs belonging to the same ESS as the same AP, so that the original location range can be further expanded to cover the entire company. Therefore, the ESS can be used as a unit for judging whether or not it is adjacent.
  • some APs have the same SSID, the spatial distance between them may be very long.
  • the public WLANs of some chain stores have the same SSID, but the spatial distance may be very long. In order to correctly determine the location of the device, before judging whether the ESS is adjacent, first determine whether the new wireless AP is adjacent to a known wireless AP with the same SSID.
  • the new AP is regarded as part of the corresponding ESS, otherwise it does not belong to any If the ESS is known, it will be treated as a new ESS. Specifically, it may be to obtain the SSID of the unknown wireless AP in the second wireless AP set and the SSID of the same known wireless AP. If the SSID of the current unknown wireless AP is consistent with the SSID of the same known wireless AP, Then it is judged that the current non-known wireless AP is adjacent to the known wireless AP, and the distance of the current non-known wireless AP is set to the minimum distance of the known wireless AP with the same SSID found above (that is, wireless APs with the same SSID). The shortest distance in the AP); if the SSID of the current non-known wireless AP is inconsistent with the SSID of the same known wireless AP, set the distance of the current non-known wireless AP to the shortest distance plus 1.
  • the SSIDs of wireless AP nodes A, B, and F are all SSID_1. If 1 is the original location, then based on the above distance calculation method, the results of each wireless AP are obtained As follows: A and B are 0, C and D are 1, E is 2, F is 3, and the maximum allowable distance (preset distance threshold) is 2, the range covered by a wireless AP with a distance less than 2 is judged as It belongs to the range of the original location.
  • the second wireless AP set S ⁇ A, B, C ⁇ obtained at this time, this At this time, the same wireless AP in the two sets is A, and B and C can be regarded as adjacent nodes of known wireless APs. Determining the distance between B and C includes: First, obtain the SSID of B and C, and compare whether their SSID is consistent with A's SSID. The shortest distance among known wireless APs with the same SSID, because at this time the same known wireless AP only includes A, and the distance of A is 0.
  • the distance of B is set to 0, and the distance of C is SSID and A’s SSID are inconsistent, the distance of C is the shortest distance plus 1, which is 1.
  • the distance of F is the distance of E plus 1 is equal to 3 although F has the same as A SSID, but its distance is 3, which is greater than the preset distance threshold 2, it can be regarded as F has deviated from the target area.
  • the SSID to determine whether the wireless AP is adjacent and further determining the distance, it can be closer to the actual situation, reduce the occurrence of misjudgments, and provide a more accurate judgment basis for location judgment.
  • the method further includes: updating the distance of each wireless AP according to the second set of wireless APs obtained in each scan.
  • the WLAN scan of the device is performed in real time, and the scan results may be the same or different at different locations.
  • the distance of the wireless AP determined based on the scan result of each scan may be inaccurate. Therefore, it is possible to learn the positional relationship of each wireless AP in the signal environment according to the results of each scan, and to update the distance of each wireless AP.
  • the second wireless AP set S ⁇ A, C ⁇ , Since it has the same known wireless AP: A, according to the above-mentioned distance calculation principle, the distance of C obtained by this scan should be the shortest distance of A 0+1, therefore, the distance of C needs to be updated to the current distance 1 and the historical distance 2. The minimum value of is 1. In this embodiment, the distance of the wireless AP is learned and updated according to the result of each scan, which can improve the accuracy of location determination.
  • the method further includes: if the distance between the wireless APs in the second wireless AP set is greater than the preset distance threshold and is an existing wireless AP in the historical connection record, starting the WLAN connection function.
  • the distance of the currently scanned wireless AP is greater than 2 and the wireless AP is an existing wireless AP in the historical connection record, it means that the device has been connected to the wireless AP. If the user has returned home, it will improve the user experience , It can automatically start the WLAN connection function to connect to the wireless AP.
  • a device location determination device including: an initialization module 510, a scanning module 520, a distance determination module 530, and a location determination module 540, wherein:
  • the initialization module 510 is configured to add the wireless AP scanned at the current initial position to the first wireless AP set and initialize the distance of each wireless AP in the first wireless AP set;
  • the scanning module 520 is configured to scan the wireless AP at the current location in real time, and add the scanned wireless AP to the second wireless AP set;
  • the distance determining module 530 is configured to determine the distance of each wireless AP in the second wireless AP set based on the distance between the first wireless AP set and each wireless AP in the first wireless AP set;
  • the location determining module 540 is configured to determine whether the device has deviated from the target area according to the relationship between the distance of each wireless AP in the second wireless AP set and the preset distance threshold, and return to the step of real-time scanning of the wireless AP at the current location;
  • the distance refers to the number of wireless networks between a wireless AP and the current initial position
  • the target area refers to an area within a preset range centered on the initial position
  • the location determining module 540 is further configured to determine that the device does not deviate from the target area when the distance of the wireless APs in the second wireless AP set is less than or equal to the preset distance threshold, and add the wireless AP to the first wireless AP set.
  • the wireless AP set when the distance of the wireless APs in the second wireless AP set is greater than the preset distance threshold, it is determined that the device has deviated from the target area.
  • the distance determining module 530 is further configured to mark a wireless AP in the first wireless AP set as a known wireless AP, when the second wireless AP set and the first wireless AP set have the same known wireless AP , Search for the shortest distance of the same known wireless AP, and determine the distance of the non-known wireless AP in the second wireless AP set based on the shortest distance.
  • the second wireless AP set does not contain the known wireless AP, then The distance of the unknown AP of the second wireless AP set is set to a fixed value.
  • the distance determining module 530 is also used to obtain the SSID of the unknown wireless AP in the second wireless AP set and the SSID of the same known wireless AP, if the SSID of the current unknown wireless AP is the same as the SSID of the same known wireless AP If the SSID of the known wireless AP is the same, set the distance of the current non-known wireless AP to the minimum distance of the known wireless AP with the same SSID. If the SSID of the current non-known wireless AP is the same as that of the same known wireless AP SSIDs are inconsistent, set the distance of the current non-known wireless AP to the shortest distance plus 1.
  • the device further includes a distance update module 550, configured to update the distance of each wireless AP according to the second set of wireless APs obtained in each scan.
  • the distance determining module 530 is further configured to set the distance of the unknown AP of the second wireless AP set to positive infinity when the known wireless AP is not included in the second wireless AP set.
  • Each module in the device location determination device described above can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 7.
  • the computer equipment includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator's network, NFC (near field communication) or other technologies.
  • the computer program is executed by the processor to realize a method for judging the device position.
  • the display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, trackball or touch pad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
  • FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device including a memory and a processor, and a computer program is stored in the memory.
  • the processor executes the computer program, the following steps are implemented: adding a wireless AP scanned at a current initial position to the first A wireless AP set, and initialize the distance of each wireless AP in the first wireless AP set, scan the wireless AP at the current location in real time, and add the scanned wireless AP to the second wireless AP set, based on the first wireless AP set and the first wireless AP set.
  • the processor further implements the following steps when executing the computer program: when the distance between the wireless APs in the second wireless AP set is less than or equal to the preset distance threshold, it is determined that the device does not deviate from the target area, and the wireless AP It is added to the first wireless AP set, and when the distance of the wireless APs in the second wireless AP set is greater than the preset distance threshold, it is determined that the device has deviated from the target area.
  • the processor further implements the following steps when executing the computer program: mark the wireless APs in the first wireless AP set as known wireless APs, and when the second wireless AP set and the first wireless AP set have the same wireless AP, When the wireless AP is known, the shortest distance of the same known wireless AP is searched, and based on the shortest distance, the distance of the non-known wireless AP in the second wireless AP set is determined. When the second wireless AP set does not contain the known wireless AP At this time, the distance of the unknown AP of the second wireless AP set is set to a fixed value.
  • the processor further implements the following steps when executing the computer program: acquiring the SSID of an unknown wireless AP in the second set of wireless APs and the SSID of the same known wireless AP, if the current unknown wireless AP’s SSID
  • the SSID is consistent with the SSID of the same known wireless AP.
  • the processor further implements the following steps when executing the computer program: updating the distance of each wireless AP according to the second set of wireless APs obtained in each scan.
  • the processor further implements the following steps when executing the computer program: when the second wireless AP set does not include a known wireless AP, the distance of the unknown AP of the second wireless AP set is set to positive infinity .
  • a computer-readable storage medium is provided, and a computer program is stored thereon.
  • the computer program is executed by a processor, the following steps are implemented: add the wireless AP scanned at the current initial position to the first wireless AP Collect and initialize the distance of each wireless AP in the first wireless AP set, scan the wireless AP at the current location in real time, and add the scanned wireless AP to the second wireless AP set, based on the first wireless AP set and the first wireless AP set Determine the distance of each wireless AP in the second wireless AP set, determine whether the device has deviated from the target area according to the relationship between the distance of each wireless AP in the second wireless AP set and the preset distance threshold, and return to real time
  • the step of scanning the wireless AP at the current location wherein, the distance refers to the number of wireless networks between a wireless AP and the current initial location, and the target area refers to an area within a preset range centered on the initial location.
  • the following steps are also implemented: when the distance between the wireless APs in the second wireless AP set is less than or equal to the preset distance threshold, it is determined that the device does not deviate from the target area, and the wireless AP is not deviated from the target area.
  • the AP is added to the first wireless AP set, and when the distance of the wireless APs in the second wireless AP set is greater than the preset distance threshold, it is determined that the device has deviated from the target area.
  • the following steps are also implemented: mark the wireless APs in the first wireless AP set as known wireless APs, and when the second wireless AP set and the first wireless AP set have the same
  • the shortest distance of the same known wireless AP is searched, and based on the shortest distance, the distance of a non-known wireless AP in the second wireless AP set is determined.
  • the second wireless AP set does not contain a known wireless AP, In the case of an AP, the distance of the unknown AP in the second wireless AP set is set to a fixed value.
  • the following steps are also implemented: obtain the SSID of the unknown wireless AP in the second set of wireless APs and the SSID of the same known wireless AP, if the current unknown wireless AP The SSID is the same as the SSID of the same known wireless AP. Set the distance of the current non-known wireless AP to the minimum distance of the known wireless AP with the same SSID. If the SSID of the current non-known wireless AP is the same The SSIDs of known wireless APs are inconsistent, and the distance of the current non-known wireless AP is set to the shortest distance plus 1.
  • the following steps are further implemented: update the distance of each wireless AP according to the second set of wireless APs obtained in each scan.
  • the following steps are further implemented: when the second wireless AP set does not include a known wireless AP, the distance of the unknown AP of the second wireless AP set is set to be positive. endless.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, or optical storage.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM may be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请涉及一种设备位置判断方法、装置、计算机设备和存储介质。所述方法包括:将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离,实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合,基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离。根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤。

Description

设备位置判断方法、装置、计算机设备和存储介质
本申请要求于2020年3月31日提交中国专利局的申请号为202010244654.4、名称为“设备位置判断方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及无线通信技术领域,特别是涉及一种设备位置判断方法、装置、计算机设备和存储介质。
背景技术
随着通信技术的发展,出现了无线通信技术。WLAN(Wireless Local Area Network,无线局域网)是指应用无线通信技术将计算机设备互联起来,构成可以互相通信和实现资源共享的网络体系。由于无线网络的灵活性和移动性,其得到了广泛的应用,人们的生活也与无线网络变得越来越密不可分。
目前,人们使用的设备(如手机)多具有WLAN连接功能,以Android系统手机为例,Android原生具有一项特性:在已保存WLAN的优质信号下,会自动打开并连接WLAN,为用户提供一种更加人性化的、沉浸式的WLAN体验,并减少移动数据流量消耗。用户关闭WLAN时,可以认为当时环境中的WLAN网络都是用户主观上不想使用的,因此要在用户离开原来的位置,进入一个新的空间环境时,才允许WLAN自动打开。
然而,上述方案仅使用已保存的网络作为位置判断的依据,并且只会在关闭WLAN时根据记录环境中的网络,虽然可以实现避免原地自动打开WLAN,但由于关闭WLAN时,设备只能得知当时可以扫描到的WLAN,而后关于原位置网络环境的信息便被固化下来,原位置范围也就固定为当时扫描到的已保存AP的信号范围,存在设备原位置判定范围偏小、过于容易判定为设备离开原位置,导致不必要的WLAN连接功能打开。因此,当前的设备位置判断方法存在判断准确率不高的问题。
发明内容
本申请提供一种能够提高设备位置判断准确率的设备位置判断方法、装置、计算机设备和存储介质。
本申请一方面提供一种设备位置判断方法,方法包括:
将在当前初始位置扫描得到的无线AP(Access Point,无线访问节点)添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离;
实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离;
根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;
其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量,目标区域是指以初始位置为中心的预设范围内的区域。
本申请另一方面提供一种设备位置判断装置,装置包括:
初始化模块,用于当检测到设备的WLAN连接功能关闭时,将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离;
扫描模块,用于实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
距离确定模块,用于基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离;
位置判定模块,用于根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;
其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量,目标区域是指以初始位置为中心的预设范围内的区域。
本申请另一方面提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离;
实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离;
根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;
其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量,目标区域是指以初始位置为中心的预设范围内的区域。
本申请另一方面一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离;
实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离;
根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;
其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量,目标区域是指以初始位置为中心的预设范围内的区域。
本发明的一个或多个实施例的细节在下面的附图和描述中提出。本发明的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更好地描述和说明本申请的实施例,可参考一幅或多幅附图,但用于描述附图的附加细节或示例不应当被认为是对本申请的发明创造、目前所描述的实施例或优选方式中任何一者的范围的限制。
图1为一个实施例中设备位置判断方法的流程示意图;
图2为另一个实施例中设备位置判断方法的流程示意图;
图3为一个实施例中网络环境中无线AP分布拓扑图;
图4为另一个实施例中网络环境中无线AP分布拓扑图;
图5为一个实施例中设备位置判断装置的结构框图;
图6为另一个实施例中设备位置判断装置的结构框图;
图7为一个实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
在一个实施例中,如图1所示,提供了一种设备位置判断方法,本实施例以该方法应用于终端进行举例说明,可以理解的是,该方法也可以应用于服务器,还可以应用于包括终端和服务器的系统,并通过终端和服务器的交互实现。本实施例中,该方法包括以下步骤:
步骤202,将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离。
其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量。实际应用中,判断设备位置是否发生变化可以基于WLAN扫描进行。以Android设备为例,在WLAN关闭的情况下仍然可以进行WLAN扫描,因此无论是否开启WLAN,设备都可以通过WLAN扫描进行低精度定位。Android设备原生的推测位置逻辑相对朴素:用户关闭WLAN时,先记录环境中扫描到的已保存网络的SSID,此后不定期发起WLAN扫描,扫描结果中只要出现了先前记录的SSID,就判定为设备处于原位置范围,反之亦然。当判断移动到了其他位置, 并且扫描到了保存网络的SSID,才会自动打开WLAN。在这套机制下,只要用户离开了关闭WLAN时记录到的已保存网络的信号范围,就被判定为移动到了其他位置,实际上这个移动距离可能很近,例如仅是在公司范围内移动到办公室内WLAN信号不好的位置,因此,上述方案仍存在判定准确率不高的问题。
本实施例中,设备以具备WLAN连接功能的手机为例,可以是当手机检测到WLAN连接功能关闭时,以当前手机所处的位置为初始位置,由于手机的WLAN连接功能关闭时,WLAN扫描仍可以进行,因此,此时可将在当前初始位置扫描到的无线AP视为当前初始位置的邻居节点,并将当前扫描到的无线AP添加至第一无线AP集合中,同时,初始化第一无线AP集合中的各无线AP的距离。本实施例中,由于初始化的第一无线AP集合中各无线AP为初始位置的邻居节点,因此,可将第一无线AP集合中的各无线AP的距离初始化为0。可以理解的是,在其他实施例中,第一无线AP集合中的各无线AP的距离初始化为其他数值,开始无线扫描的触发条件也不局限于检测到WLAN连接功能关闭,具体可根据实际情况而定,在此不做限定。
步骤204,实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合。
由于在实际应用场景中,手机设备可能一直处于移动状态中,因此,为提高位置变化的准确率,需要实时扫描当前位置附近的无线AP,扫描次数越多,扫描频率越高,能为设备的位置判断提供更为准确依据。具体的,可通过设定扫描频次,调试效率和精度,扫描频次可根据具体情况来设置。可以理解的是,扫描也可以随时随地进行,在不同的应用场景下,设置的扫描频次的方式和大小可不同,在此不做限定。具体的,可将实时扫描得到的无线AP添加至第二无线AP集合中。例如,假设手机的初始位置为①处,在①处扫描到的无线AP为A(可视为邻居节点),则第一无线AP集合N={A},其中A的距离为0,当手机移动到②处时,在②处进行扫描,将能扫描无线AP节点有A、B以及C,则第二无线AP集合S={A、B、C}。
步骤206,基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离。
当得到第二无线AP集合后,即需要评估集合中的各无线AP距离初始位置的距离,以判断手机是否已偏离初始位置范围。具体的,可以是基于第一无线AP集合和第一无线AP集合中的各无线AP的距离,确定第二无线AP集合中的各无线AP的距离。
步骤208,根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回步骤204。
目标区域是指以初始位置为中心的预设范围内的区域实际应用中,可预设判定手机处于初始位置范围的最大允许距离(即预设的距离阈值),即若当前扫描到的AP的距离小于或等于预设距离,则判定手机仍处于初始位置范围(目标区域)内,否则,判定手机已偏离目标区域。本实施例中,预设的距离阈值可以设置为2,可以理解的是,在其他实施例中,距离阈值还可以设置为3、4或其他数值,具体可视实际情况而定,在此不做限定。
上述设备位置判断方法中,定义了用于描述某个AP与设备初始位置之间的位置关系的距离,将当前初始位置扫描得到的的无线AP添加至第一无线AP集合,并初始化第一无线AP集合中的各无线AP的距离,因为设备的位置可能随时在变化,通过实时扫描当前位置的无线AP得到第二无线AP集合,基于第一无线AP集合及其各无线AP的距离,确定第二无线AP集合中各无线AP的距离,再基于第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否偏离初始位置范围。上述方案,通过联合多个无线AP的信号覆盖范围(距离)作为设备的初始位置范围的判断依据,相比于现有方案,扩大了设备的初始位置范围,提高位置判断准确率,且无论无线AP是否已保存,都能基于位置关系准确判断设备的位置。
在一个实施例中,如图2所示,步骤208包括:
步骤228,当第二无线AP集合中的无线AP的距离小于或等于预设距离阈值时,则判定设备未偏离目标区域,将该无线AP添加至第一无线AP集合;
步骤230,当第二无线AP集合中的无线AP的距离大于预设距离阈值时,则判定设备已偏离目标区域。
具体实施时,预设距离阈值以2为例,若第二无线AP集合中的无线AP的 距离小于或等于2时,则表明当前的第二无线AP集合中的无线AP距离初始位置间隔的无线网络的数量小于2,表明设备仍处于初始位置范围内,未偏离目标区域,将该无线AP添加至第一无线AP集合,当第二无线AP集合中的无线AP的距离大于2时,则判定设备已偏离目标区域。本实施例中,通过比较第二无线AP集合中各无线AP的距离与预设距离阈值的关系,能够简单且快速判定设备是否偏离初始位置范围。
在其中一个实施例中,如图2所示,步骤206包括:步骤226,将第一无线AP集合中的无线AP标记为已知无线AP,当第二无线AP集合与第一无线AP集合存在相同的已知无线AP时,则查找相同的已知无线AP的最短距离,基于最短距离,确定第二无线AP集合中的非已知无线AP的距离,当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为固定值。
具体实施时,判定移动过程中各无线AP的距离可以是,将第一无线AP集合中的无线AP标记为已知无线AP,即可视为已知邻居节点。当前扫描得到的第二无线AP集合中存在已知无线AP时,即表明在此次扫描中扫描到新的无线AP的同时,还扫描到邻居节点(已知无线AP),意味着设备此时仍在初始位置附近。因此,可将新的无线AP视为已知无线AP中最短距离的无线AP的邻接节点,可基于由第一无线AP集合和第二无线AP集合中相同的已知无线AP,挑选出其中存在最短距离的无线AP,基于该最短距离,确定第二无线AP集合中的非已知无线AP的距离;若当前扫描得到的第二无线AP集合中不存在已知无线AP时,意味着设备此时已不在初始位置附近,此时,可将第二无线AP集合中的非已知无线AP的距离设置为正无穷。
在其中一个实施例中,基于最短距离,确定第二无线AP集合中的非已知无线AP的距离包括:
获取第二无线AP集合中的非已知无线AP的SSID以及相同的已知无线AP的SSID;
若当前非已知无线AP的SSID与相同的已知无线AP的SSID一致,将当前非已知无线AP的距离设置为具有相同SSID的已知无线AP的距离的最小值;
若当前非已知无线AP的SSID与相同的已知无线AP的SSID不一致,将当前非已知无线AP的距离设置为最短距离加1。
在实际应用中,可将ESS(Extended Service Set,扩展服务集)作为距离计算中判断是否邻接的单位,更切合满足实际需要。例如把一家公司视为一个整体,公司内网的无线网络信号通常覆盖全公司,用户在公司关掉设备的WLAN,用户应该主观上不想使用整个公司的无线网络,而如果这家公司办公面积比较大,内网ESS中有很多AP,仅通过判断BSS是否邻接来计算距离,最后得到的原位置范围可能不会覆盖全公司,用户在公司内移动,仍可能发生自动打开WLAN的情况;通过判断ESS是否邻接计算距离,将属于同一ESS的AP视为同一AP处理,这样原位置范围可以进一步扩大,从而覆盖全公司。因此,可将ESS作为判断是否邻接的单位。然而,某些AP虽然具有相同的SSID,但它们之间的空间距离可能很远,例如一些连锁商店的公共WLAN,虽具有相同的SSID,但空间距离可能很远。为了正确判断设备位置,在判断ESS是否邻接之前,先要判断新无线AP是否与具有相同SSID的已知无线AP邻接,如果邻接,则将新AP视为对应ESS的一部分,否则它不属于任何已知ESS,将其作为新的ESS来处理。具体的,可以是获取第二无线AP集合中的非已知无线AP的SSID以及相同的已知无线AP的SSID,若当前非已知无线AP的SSID与相同的已知无线AP的SSID一致,则判断当前非已知无线AP与已知无线AP邻接,将当前非已知无线AP的距离设置为前述查找出的且SSID相同的已知无线AP的距离的最小值(即具有相同SSID的无线AP中的最短距离);若当前非已知无线AP的SSID与相同的已知无线AP的SSID不一致,将当前非已知无线AP的距离设置为最短距离加1。
结合图3,在图3所示的信号覆盖环境中,无线AP节点A、B、F的SSID均为SSID_1,若①处为原位置,那么基于上述距离计算方式,得到的各无线AP的结果如下:A、B为0,C、D为1,E为2,F为3,最大允许距离(预设距离阈值)为2的情况下,距离小于2的无线AP所覆盖的范围则判定为属于原位置的范围。具体计算过程如下:用户在①关闭WLAN连接功能,此时扫描得到的第一无线AP集合N={A},初始化A的距离为0,且A的SSID为1。当用户 带着设备移动到②处进行了一次扫描,将会扫描发现B和C,且同时扫描到A,因此,此时得到的第二无线AP集合S={A、B、C},此时,两个集合中相同的无线AP为A,且B和C可视为已知无线AP的邻接节点。确定B和C的距离包括:首先,获取B和C的SSID,对比其SSID是否和A的SSID一致,比较过程中,发现B的SSID与A的SSID一致,则将B的距离设置为相同且SSID相同的已知无线AP中的最短距离,因为,此时相同的已知无线AP仅包括A,A的距离为0,则基于此次扫描结果,将B的距离设置为0,而C的SSID与A的SSID不一致,则将C的距离为最短距离加1,即为1,在确定B和C的距离之后,对比B和C的距离小于预设距离阈值2,则将B和C添加至第一无线集合N中,此时,N更新为N={A、B、C}。当设备移动到③处,将会扫描得到B和D,第二无线AP集合更新为S={B、D},由于此时集合N和集合S具有相同的已知无线AP:B且B的距离为0,则可将D视为B的邻接节点,且进一步发现,B和D的SSID不一致,则D的距离设置为1。同样的,以此方式,计算出E的距离为D的最短距离加1即等于2(1+1=2),F的距离为E的距离加1即为3,F虽具有与A相同的SSID,但其距离为3,大于预设距离阈值2,则可视为F已偏离目标区域。本实施例中,通过结合SSID判断无线AP是否邻接并进一步确定距离,能够更加贴近实际情况,减少误判的发生,为位置判断提供更精准的判断依据。
在其中一个实施例中,还包括:根据每次扫描得到的第二无线AP集合,更新各无线AP的距离。
在实际应用中,设备的WLAN扫描是实时进行的,在不同的位置扫描结果可能一样也可能不一样,基于每一次扫描结果确定的无线AP的距离,可能存在不准确的情况。因此,可根据每次的扫描结果,学习信号环境中的各无线AP的位置关系,更新各无线AP的距离。例如,结合图4,原位置为①,假设当前已知第一无线AP集合N={A、B},其中,无线AP的距离A=0,B=1,当前次扫描扫到了B和C,确定C=2,第一无线AP集合更新为N={A、B、C},若下次扫描,扫描到了A和C,则此时第二无线AP集合S={A、C},由于具有相同的已知无线AP:A,则按照上述距离计算原则,此次扫描得到C的距离应为A的 最短距离0+1,因此,C的距离需要更新为当前距离1与历史距离2的最小值,即为1。本实施例中,根据每次扫描结果学习并更新无线AP的距离,能够提高位置判断的准确率。
在其中一个实施例中,还包括:若第二无线AP集合中的无线AP的距离大于预设距离阈值且为历史连接记录中已有的无线AP时,则启动WLAN连接功能。
具体实施时,若当前扫描的无线AP的距离大于2且该无线AP为历史连接记录中已存在的无线AP,说明该设备曾连接过该无线AP,如用户已回到家中,为提升用户体验,可自动启动WLAN连接功能,以连接上该无线AP。
应该理解的是,虽然图1-2的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1-2中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图5所示,提供了一种设备位置判断装置,包括:初始化模块510、扫描模块520、距离确定模块530和位置判定模块540,其中:
初始化模块510,用于将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离;
扫描模块520,用于实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
距离确定模块530,用于基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离;
位置判定模块540,用于根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;
其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量, 目标区域是指以初始位置为中心的预设范围内的区域。
在一个实施例中,位置判定模块540还用于当第二无线AP集合中的无线AP的距离小于或等于预设距离阈值时,则判定设备未偏离目标区域,将该无线AP添加至第一无线AP集合,当第二无线AP集合中的无线AP的距离大于预设距离阈值时,则判定设备已偏离目标区域。
在一个实施例中,距离确定模块530还用于将第一无线AP集合中的无线AP标记为已知无线AP,当第二无线AP集合与第一无线AP集合存在相同的已知无线AP时,则查找相同的已知无线AP的最短距离,基于最短距离,确定第二无线AP集合中的非已知无线AP的距离,当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为固定值。
在一个实施例中,距离确定模块530还用于获取第二无线AP集合中的非已知无线AP的SSID以及相同的已知无线AP的SSID,若当前非已知无线AP的SSID与相同的已知无线AP的SSID一致,将当前非已知无线AP的距离设置为具有相同SSID的已知无线AP的距离的最小值,若当前非已知无线AP的SSID与相同的已知无线AP的SSID不一致,将当前非已知无线AP的距离设置为最短距离加1。
在一个实施例中,如图6所示,装置还包括距离更新模块550,用于根据每次扫描得到的第二无线AP集合,更新各无线AP的距离。
在一个实施例中,距离确定模块530还用于当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为正无穷。
关于设备位置判断装置的具体限定可以参见上文中对于设备位置判断方法的限定,在此不再赘述。上述设备位置判断装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提 供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种设备位置判断方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离,实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合,基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离,根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量,目标区域是指以初始位置为中心的预设范围内的区域。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:当第二无线AP集合中的无线AP的距离小于或等于预设距离阈值时,则判定设备未偏离目标区域,将该无线AP添加至第一无线AP集合,当第二无线AP集合中的无线AP的距离大于预设距离阈值时,则判定设备已偏离目标区域。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:将第一无线 AP集合中的无线AP标记为已知无线AP,当第二无线AP集合与第一无线AP集合存在相同的已知无线AP时,则查找相同的已知无线AP的最短距离,基于最短距离,确定第二无线AP集合中的非已知无线AP的距离,当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为固定值。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:获取第二无线AP集合中的非已知无线AP的SSID以及相同的已知无线AP的SSID,若当前非已知无线AP的SSID与相同的已知无线AP的SSID一致,将当前非已知无线AP的距离设置为具有相同SSID的已知无线AP的距离的最小值,若当前非已知无线AP的SSID与相同的已知无线AP的SSID不一致,将当前非已知无线AP的距离设置为最短距离加1。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:根据每次扫描得到的第二无线AP集合,更新各无线AP的距离。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为正无穷。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化第一无线AP集合中各无线AP的距离,实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合,基于第一无线AP集合和第一无线AP集合中各无线AP的距离,确定第二无线AP集合中各无线AP的距离,根据第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定设备是否已偏离目标区域,返回实时扫描当前位置的无线AP的步骤;其中,距离是指一个无线AP与当前初始位置之间间隔的无线网络的数量,目标区域是指以初始位置为中心的预设范围内的区域。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:当第二无线AP集合中的无线AP的距离小于或等于预设距离阈值时,则判定设备未偏离目标区域,将该无线AP添加至第一无线AP集合,当第二无线AP集合中的无 线AP的距离大于预设距离阈值时,则判定设备已偏离目标区域。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:将第一无线AP集合中的无线AP标记为已知无线AP,当第二无线AP集合与第一无线AP集合存在相同的已知无线AP时,则查找相同的已知无线AP的最短距离,基于最短距离,确定第二无线AP集合中的非已知无线AP的距离,当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为固定值。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取第二无线AP集合中的非已知无线AP的SSID以及相同的已知无线AP的SSID,若当前非已知无线AP的SSID与相同的已知无线AP的SSID一致,将当前非已知无线AP的距离设置为具有相同SSID的已知无线AP的距离的最小值,若当前非已知无线AP的SSID与相同的已知无线AP的SSID不一致,将当前非已知无线AP的距离设置为最短距离加1。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:根据每次扫描得到的第二无线AP集合,更新各无线AP的距离。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:当第二无线AP集合中不包含已知无线AP时,则将第二无线AP集合的非已知AP的距离设置为正无穷。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (10)

  1. 一种设备位置判断方法,包括:
    将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化所述第一无线AP集合中各无线AP的距离;
    实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
    基于所述第一无线AP集合和所述第一无线AP集合中各无线AP的距离,确定所述第二无线AP集合中各无线AP的距离;
    根据所述第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定所述设备是否已偏离目标区域,返回所述实时扫描当前位置的无线AP的步骤;
    其中,所述距离是指一个无线AP与所述当前初始位置之间间隔的无线网络的数量,所述目标区域是指以所述初始位置为中心的预设范围内的区域。
  2. 根据权利要求1所述的方法,其中,根据所述第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定所述设备是否已偏离目标区域包括:
    当所述第二无线AP集合中的无线AP的距离小于或等于预设距离阈值时,则判定所述设备未偏离目标区域,将该无线AP添加至所述第一无线AP集合;
    当所述第二无线AP集合中的无线AP的距离大于预设距离阈值时,则判定所述设备已偏离目标区域。
  3. 根据权利要求1所述的方法,其中,所述基于所述第一无线AP集合和所述第一无线AP集合中各无线AP的距离,确定所述第二无线AP集合中各无线AP的距离包括:
    将所述第一无线AP集合中的无线AP标记为已知无线AP;
    当所述第二无线AP集合与所述第一无线AP集合存在相同的已知无线AP时,则查找相同的已知无线AP的最短距离,基于所述最短距离,确定所述第二无线AP集合中的非已知无线AP的距离;
    当所述第二无线AP集合中不包含已知无线AP时,则将所述第二无线AP 集合的非已知AP的距离设置为固定值。
  4. 根据权利要求3所述的方法,其中,所述基于所述最短距离,确定所述第二无线AP集合中的非已知无线AP的距离包括:
    获取所述第二无线AP集合中的非已知无线AP的SSID以及所述相同的已知无线AP的SSID;
    若当前非已知无线AP的SSID与所述相同的已知无线AP的SSID一致,将当前非已知无线AP的距离设置为具有相同SSID的已知无线AP的距离的最小值;
    若当前非已知无线AP的SSID与所述相同的已知无线AP的SSID不一致,将当前非已知无线AP的距离设置为所述最短距离加1。
  5. 根据权利要求1所述的方法,其中,所述基于所述第一无线AP集合和所述第一无线AP集合中各无线AP的距离,确定所述第二无线AP集合中各无线AP的距离之后,还包括:
    根据每次扫描得到的第二无线AP集合,更新各无线AP的距离。
  6. 根据权利要求3所述的方法,其中,所述当所述第二无线AP集合中不包含已知无线AP时,则将所述第二无线AP集合的非已知AP的距离设置为固定值包括:
    当所述第二无线AP集合中不包含已知无线AP时,则将所述第二无线AP集合的非已知AP的距离设置为正无穷。
  7. 一种设备位置判断装置,包括:
    初始化模块,用于将在当前初始位置扫描得到的无线AP添加至第一无线AP集合、并初始化所述第一无线AP集合中各无线AP的距离;
    扫描模块,用于实时扫描当前位置的无线AP,将扫描得到的无线AP添加至第二无线AP集合;
    距离确定模块,用于基于所述第一无线AP集合和所述第一无线AP集合中各无线AP的距离,确定所述第二无线AP集合中各无线AP的距离;
    位置判定模块,用于根据所述第二无线AP集合中各无线AP的距离与预设距离阈值的关系,判定所述设备是否已偏离目标区域,返回所述实时扫描当前 位置的无线AP的步骤;
    其中,所述距离是指一个无线AP与所述当前初始位置之间间隔的无线网络的数量,所述目标区域是指以所述初始位置为中心的预设范围内的区域。
  8. 根据权利要求7所述的设备位置判断装置,其中,所述距离确定模块还用于当所述第二无线AP集合中的无线AP的距离小于或等于预设距离阈值时,则判定所述设备未偏离目标区域,将该无线AP添加至所述第一无线AP集合,当所述第二无线AP集合中的无线AP的距离大于预设距离阈值时,则判定所述设备已偏离目标区域。
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现权利要求1至6中任一项所述的方法的步骤。
  10. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。
PCT/CN2021/084425 2020-03-31 2021-03-31 设备位置判断方法、装置、计算机设备和存储介质 WO2021197377A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010244654.4A CN113473568B (zh) 2020-03-31 2020-03-31 设备位置判断方法、装置、计算机设备和存储介质
CN202010244654.4 2020-03-31

Publications (1)

Publication Number Publication Date
WO2021197377A1 true WO2021197377A1 (zh) 2021-10-07

Family

ID=77865462

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/084425 WO2021197377A1 (zh) 2020-03-31 2021-03-31 设备位置判断方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN113473568B (zh)
WO (1) WO2021197377A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114205739B (zh) * 2021-12-01 2024-02-06 南京天擎汽车电子有限公司 一种无线定位方法、无线定位装置及计算机可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517361A (zh) * 2013-10-25 2014-01-15 北京航空航天大学 一种室内外无缝定位切换方法
CN104144495A (zh) * 2014-07-04 2014-11-12 中国科学院光电研究院 一种基于方向传感器与wlan网络的指纹定位方法
CN107135483A (zh) * 2016-02-26 2017-09-05 日本电气株式会社 确定相对距离变化趋势的方法、室内定位方法及其装置
CN107809739A (zh) * 2017-09-13 2018-03-16 广州吉欧电子科技有限公司 一种连接wifi设备的方法及装置
EP3361277A1 (en) * 2015-10-23 2018-08-15 Huawei Technologies Co., Ltd. Method and device for node location
CN109509269A (zh) * 2018-10-10 2019-03-22 平安万家医疗投资管理有限责任公司 一种电子签到方法、计算机可读存储介质及服务器

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106034356B (zh) * 2015-03-16 2020-01-03 新华三技术有限公司 一种定位接入点选择方法和装置
CN104837215A (zh) * 2015-04-14 2015-08-12 广东欧珀移动通信有限公司 一种无线热点的连接方法及终端
CN107613552A (zh) * 2017-10-31 2018-01-19 广东小天才科技有限公司 一种基于移动终端的定位方法及移动终端
CN107820301B (zh) * 2017-11-30 2021-02-02 Oppo广东移动通信有限公司 无线局域网开关的控制方法、装置、终端及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517361A (zh) * 2013-10-25 2014-01-15 北京航空航天大学 一种室内外无缝定位切换方法
CN104144495A (zh) * 2014-07-04 2014-11-12 中国科学院光电研究院 一种基于方向传感器与wlan网络的指纹定位方法
EP3361277A1 (en) * 2015-10-23 2018-08-15 Huawei Technologies Co., Ltd. Method and device for node location
CN107135483A (zh) * 2016-02-26 2017-09-05 日本电气株式会社 确定相对距离变化趋势的方法、室内定位方法及其装置
CN107809739A (zh) * 2017-09-13 2018-03-16 广州吉欧电子科技有限公司 一种连接wifi设备的方法及装置
CN109509269A (zh) * 2018-10-10 2019-03-22 平安万家医疗投资管理有限责任公司 一种电子签到方法、计算机可读存储介质及服务器

Also Published As

Publication number Publication date
CN113473568A (zh) 2021-10-01
CN113473568B (zh) 2022-11-15

Similar Documents

Publication Publication Date Title
US8982732B2 (en) Detecting neighboring access points in a network
US8126476B2 (en) System and method for mapping wireless access points
US10966122B2 (en) Method and migration managing module for managing a migration of a service
WO2022028074A1 (zh) 网络注册方法、装置、计算机设备和存储介质
TW202014020A (zh) 一種測量方法、終端、lmf實體及電腦可存儲介質
WO2018176511A1 (zh) 一种指纹定位方法及相关设备
US10371790B2 (en) Calibration-free location determination using wireless communication
WO2022121315A1 (zh) 网络切换方法、装置、计算机设备和存储介质
US20140024357A1 (en) Method and apparatus for cell type specific measurement configuration
US10383128B2 (en) Assignment of hierarchical cell structures employing geolocation techniques
EP2174523A1 (en) System and method for mapping wireless access points
US20130331100A1 (en) Method and system of providing small cell information to user equipments in a heterogeneous network environment
CN112470523A (zh) 用于搜索可用网络的无线设备的知晓环境的自适应回退
US11330551B2 (en) Method and apparatus for location aware optimal wireless link selection system
US20140247806A1 (en) Wireless communication terminal, wireless communication method, and wireless communication system
TW201542019A (zh) 用於Wi-Fi位置決定之方法與設備
CN105376831A (zh) 信息处理设备和信息处理方法
US11140652B2 (en) Data processing method and apparatus
WO2021197377A1 (zh) 设备位置判断方法、装置、计算机设备和存储介质
US20230059954A1 (en) Method, electronic device and non-transitory computer-readable storage medium for determining indoor radio transmitter distribution
WO2023221973A1 (zh) 小区注册方法及终端
CN106792952A (zh) 用于终端连接到无线保真接入点的方法和装置
WO2022160670A1 (zh) Wi-Fi网络的识别方法和Wi-Fi网络的识别装置
JP2018066638A (ja) 位置情報特定装置
KR20120070177A (ko) 무선랜 환경에서 ap 간 핸드오버 방법 및 이를 위한 이동통신 단말

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21779327

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24/01/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21779327

Country of ref document: EP

Kind code of ref document: A1