WO2020259529A1 - Indoor location method and electronic device - Google Patents

Indoor location method and electronic device Download PDF

Info

Publication number
WO2020259529A1
WO2020259529A1 PCT/CN2020/097887 CN2020097887W WO2020259529A1 WO 2020259529 A1 WO2020259529 A1 WO 2020259529A1 CN 2020097887 W CN2020097887 W CN 2020097887W WO 2020259529 A1 WO2020259529 A1 WO 2020259529A1
Authority
WO
WIPO (PCT)
Prior art keywords
access point
parameter information
point parameter
rssi
electronic device
Prior art date
Application number
PCT/CN2020/097887
Other languages
French (fr)
Chinese (zh)
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 WO2020259529A1 publication Critical patent/WO2020259529A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/023Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/33Services specially adapted for particular environments, situations or purposes for indoor environments, e.g. buildings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application relates to the field of terminal technology, and in particular to an indoor positioning method and electronic equipment.
  • Location-based services involve many areas of daily life such as transportation, logistics, public security, etc., and can provide navigation, logistics management, traffic information, scheduling and other services, so it is widely used.
  • WiFi positioning technology means that electronic devices periodically scan the surrounding wireless signals, and periodically report the scanning results to the positioning server.
  • the location server determines the current location information of the electronic device according to the scanning result.
  • WiFi positioning technology for positioning, which consumes relatively large power consumption.
  • the electronic device periodically scans the surrounding wireless signals will consume power; on the other hand, the electronic device periodically reports the scan results to the positioning server will consume power, so if the electronic device’s WiFi positioning function is always on, Will seriously affect the endurance of electronic equipment.
  • the present application provides an indoor positioning method and electronic equipment, which are used to save the power consumption of the electronic equipment during the positioning process and improve the endurance of the electronic equipment.
  • an embodiment of the present application provides an indoor positioning method, which is applicable to an electronic device, and the method includes: the electronic device scans wireless signal sources around itself, obtains first access point parameter information, and then determines The similarity between the first access point parameter information and the stored historical access point parameter information, where a smaller similarity indicates that the first access point parameter information is more similar to the historical access point parameter information.
  • the similarity is less than or equal to the first threshold, discard the first access point parameter information, and when the similarity is greater than the first threshold, report the first access point parameter information to the positioning server, and the positioning server according to the first
  • the access point parameter information determines the location information of the electronic device, and finally the electronic device receives the location information sent by the positioning server.
  • the electronic device reports the scanning result only when the similarity between the access point parameter information and the historical access point parameter information is greater than the first threshold, so the power consumption of the electronic device can be saved, and the endurance of the electronic device can be improved .
  • the electronic device determines the similarity between the first access point parameter information and the stored historical access point parameter information in the following manner, and the specific manner includes:
  • the electronic device determines k identical media access control MAC addresses from the first access point parameter information and the stored historical access point parameter information; and then obtains the first access point parameter information
  • the first RSSI set corresponding to the k identical MAC addresses, and the second RSSI set corresponding to the k identical MAC addresses are obtained from the historical access point parameter information; finally, according to the first RSSI set and the second RSSI Set, determine the similarity between the first access point parameter information and the stored historical access point parameter information.
  • the electronic device can accurately calculate the similarity between the first access point parameter information and the stored historical access point parameter information by using the above method, so as to determine whether it needs to be reported.
  • the electronic device normalizes the first RSSI set and the second RSSI set to obtain a normalized first RSSI set and a normalized second RSSI set , And then calculate the similarity according to the normalized first RSSI set and the normalized second RSSI set, and the similarity meets the requirements of the following formula:
  • k represents the number of the same MAC address
  • Num represents the union of the MAC address in the historical access point parameter information and the MAC address in the first access point parameter information to obtain the total number of MAC addresses
  • B i represents the return After normalization, the i-th RSSI in the first RSSI set
  • a i represents the i-th RSSI of the terminal in the second RSSI set after normalization
  • S represents the similarity
  • the value of i ranges from 1 to k, where B i and A i is the RSSI of the same MAC address.
  • the electronic device can accurately calculate the similarity according to the above method.
  • the electronic device normalizes the first RSSI set, and the obtained normalized first RSSI set meets the requirements of the following formula:
  • B i represents the i-th RSSI in the first RSSI set after normalization
  • b i is the i-th RSSI in the first RSSI set before normalization, where the value of i is from 1 to k ;
  • the second RSSI set is normalized, and the obtained normalized second RSSI set meets the requirements of the following formula:
  • a i represents the i-th RSSI in the second RSSI set after normalization; a i is the i-th RSSI in the second RSSI set before normalization, and the value of i is from 1 to k .
  • the electronic device can accurately normalize the RSSI according to the above method, so as to facilitate subsequent accurate calculation of similarity.
  • the electronic device may determine k identical media access control MAC addresses from the first access point parameter information and the historical access point parameter information; The access point parameter information and the MAC address in the historical access point parameter information are combined to obtain the total number of MAC addresses; finally the similarity is calculated according to the K and the total number of MAC addresses, and the similarity conforms to the following formula Claim:
  • k represents the number of the same media access control MAC address
  • M is the total number of MAC addresses
  • S is the degree of similarity
  • the electronic device can accurately calculate the similarity according to the above method.
  • the wireless signal sources around the electronic device are scanned to generate the first access point parameter information
  • the specific method is: when the timer expires, the wireless signal sources around the electronic device are scanned; Or, when the moving distance of the electronic device reaches a certain threshold, the wireless signal sources around the electronic device are scanned.
  • the terminal is set to touch and scan according to the above conditions, which can reduce the number of scans to a certain extent and reduce power consumption.
  • an embodiment of the present application provides an electronic device including a processor and a memory.
  • the memory is used to store one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the electronic device can implement any one of the possible design methods in any of the foregoing aspects.
  • an embodiment of the present application also provides a device, which includes a module/unit that executes any one of the possible design methods in any of the foregoing aspects.
  • modules/units can be realized by hardware, or by hardware executing corresponding software.
  • an embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium includes a computer program.
  • the computer program runs on an electronic device, the electronic device executes any of the above aspects. Any one of the possible design methods.
  • the embodiments of the present application also provide a computer program product, which when the computer program product runs on a terminal, causes the electronic device to execute any one of the possible design methods in any of the foregoing aspects.
  • the embodiments of the present application also provide a chip, which is coupled with a memory, and is used to execute a computer program stored in the memory, so that the electronic device executes any possible design method of any of the above aspects .
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of an application scenario of a location tracker provided by an embodiment of the application
  • FIG. 3 is a schematic structural diagram of a position tracker provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of an Android system architecture provided by an embodiment of the application.
  • FIG. 5 is a schematic flowchart of an indoor positioning method for electronic equipment according to an embodiment of the application.
  • FIG. 6 is a schematic diagram of a positioning scenario provided by an embodiment of the application.
  • FIG. 7 is a schematic flowchart of another indoor positioning method for electronic equipment according to an embodiment of the application.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • the access point parameter information refers to the identification of each wireless signal source detected by the electronic device at a certain geographic location, and the characteristic parameters of the signal of each wireless signal source.
  • the wireless signal source may be an access point (AP) in a wireless area network (WLAN), and the wireless signal source identifier may be the media access control (MAC) address of the AP, and
  • the characteristic parameter of the signal of the wireless signal source may be a received signal strength indication (RSSI).
  • RSSI received signal strength indication
  • the wireless signal source may be a short-range wireless communication signal source such as an access point (AP) and a Bluetooth signal source.
  • the AP may specifically refer to a wireless router, a mobile phone hot spot, etc., which is not limited in the embodiment of the present application.
  • Each AP has a unique WiFi ID, and the WiFi ID can be a Service Set Identifier (SSID) or a WiFi name.
  • SSID Service Set Identifier
  • the WiFi identification may also include the MAC address of the AP, RSSI, and so on.
  • FIG. 1 is a schematic diagram of an indoor positioning scene architecture.
  • the scene architecture includes an electronic device 100 and a server 200 located in an indoor space, and multiple wireless signal sources (such as AP1/AP2/AP3/ AP4).
  • the electronic device 100 and the server 200 may communicate with each other through a communication network.
  • the indoor space in Figure 1 is a building, and AP1/AP2/AP3/AP4 are located on different floors.
  • the server 200 may be one server, or a server cluster composed of several servers, or a cloud server.
  • the communication network may be a local area network, or a wide area network switched through a relay device, or include a local area network and a wide area network.
  • the communication network may be a short-distance communication network such as a WiFi hotspot network, a WiFi P2P network, a Bluetooth network, a zigbee network, or a near field communication (NFC) network.
  • the communication network may be a 3rd-generation wireless telephone technology (3G) network, or the 4th generation mobile communication technology (4G). ) Network, the fifth-generation mobile communication technology (5G) network, the future evolution of the public land mobile network (PLMN) or the Internet, etc.
  • the positioning server stores the corresponding relationship between the parameter information and the location of each access point.
  • the electronic device periodically scans the surrounding APs, obtains the access point parameter information of the location, and periodically sends the access point parameter information obtained each time to the positioning server.
  • the positioning server matches the access point parameter information sent by the electronic device each time with the access point parameter information in the preset correspondence relationship, and determines the location information of the electronic device according to the matching result.
  • the electronic device in the prior art reports each scan result to the positioning server, and from the actual test, this part of the power consumption is relatively large. Considering that in some scenarios, the front and rear positions of the electronic device have not changed much. For example, when the electronic device 100 in FIG. 1 moves from the area where AP2 is located to the area where AP3 is located, the AP scan result of the electronic device 100 is not too large. Therefore, in this case, the access point parameter information scanned in the area where AP3 is located may not be sent to the positioning server.
  • an embodiment of the present application provides an indoor positioning method, which can be applied to the scene architecture shown in FIG. 1, and the method includes: the electronic device 100 scans the surrounding wireless signal sources to obtain the first position of the current position. Access point parameter information. When the similarity between the first access point parameter information and the stored historical access point parameter information is less than the first threshold, the electronic device reports the first access point parameter information to the The positioning server 200. The positioning server 200 matches the first access point parameter information with the reference access point parameter information in the access point parameter information database, determines the current location information of the electronic device according to the matching result, and determines the current location information of the electronic device. The location information is sent to the electronic device 100.
  • the electronic device 100 in this application may be a position tracker as shown in FIGS. 1 and 2.
  • the location tracker is widely used.
  • the electronic device 100 can be used as a pet locator, the electronic device 100 can also be worn by the elderly and children, or the electronic device 100 can be installed in suitcases and bicycles.
  • the above positioning method is particularly suitable for a location tracker whose WiFi positioning function is always on, that is, the positioning function is in a normally open state.
  • the positioning method provided by the embodiment of the present application is applied to a position tracker, the battery life of the position tracker can be greatly improved.
  • FIG. 3 shows a structural diagram of a position tracker.
  • the location tracker mainly includes: a processor 301, a memory 302, a mobile communication module 303, and a wireless communication module 304.
  • the memory 302 generally includes internal memory and external memory.
  • the memory may be random access memory (RAM), double rate random access memory (DDR RAM), read only memory (ROM), or high-speed cache (CACHE).
  • the external storage can be a hard disk, an optical disk, a universal serial bus (USB), a flash memory (FLASH), a floppy disk or a tape drive, etc.
  • the memory 302 is used to store computer programs (including various firmware, operating systems, etc.) and other data.
  • the memory 302 may include an information caching module 3021, a positioning service logic module 3022, and a "home area" determining module 3023.
  • the information caching module 3021 may be used to store historical access point parameter information.
  • the positioning service logic module 3022 is used to execute indoor positioning algorithms, process the AP scanning results scanned by the wireless communication module 304, and determine the current position according to the position information returned by the positioning server, or according to the global navigation satellite system (global navigation satellite system). , GNSS) to determine the current location; the "home zone" determining module 3023 is used to determine whether the similarity between the AP scan result currently scanned by the wireless communication module 304 and the stored historical access point parameter information is greater than the first Threshold.
  • the global navigation satellite system global navigation satellite system
  • GNSS global navigation satellite system
  • the processor 301 is configured to read the computer program in the memory 302, and then execute the method defined by each module. For example, in the embodiment of the present application, the processor 301 may execute the methods defined in the positioning service logic module 3022 and the "home area" judgment module 3023.
  • the processor 301 may include one or more general-purpose processors, and may also include one or more DSPs (digital signal processors, digital signal processors), which are used to perform related operations to implement the methods provided in the embodiments of this application.
  • DSPs digital signal processors, digital signal processors
  • the mobile communication module 303 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the position tracker.
  • the mobile communication module 303 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and so on.
  • the mobile communication module 303 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 303 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 303 may be provided in the processor 110.
  • the mobile communication module 303 can also be used to exchange information with the positioning server, that is, to send the scanning result of the wireless signal source (the scanning result is the first access point parameter information) to the positioning server, and from the positioning server Get location information.
  • the wireless communication module 304 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation applications that are used in mobile phone location trackers. Satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 304 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 304 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 301.
  • the wireless communication module 304 can also receive the signal to be sent from the processor 301, perform frequency modulation, amplify it, and convert it to electromagnetic wave radiation via the antenna 2.
  • the wireless communication module 304 is configured to scan wireless signal sources around the electronic device to obtain the first access point parameter information.
  • the location tracker may also include components such as sensors, GPS, power supply, and antenna.
  • the structure of the position tracker shown in FIG. 3 does not constitute a limitation on the position tracker, and the position tracker provided in the embodiment of the present application may include more or less components than shown in the figure. Or combine certain components, or different component arrangements.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to exemplify the software structure of the electronic device 100.
  • FIG. 4 is a software structure block diagram of an electronic device 100 according to an embodiment of the present invention.
  • the software architecture shown in FIG. 4 is based on the Android operating system as an example.
  • the software modules and/or codes of the software architecture can be stored in the internal memory 302.
  • the processor 301 runs the software modules or codes, the embodiments of the present application are executed.
  • the indoor positioning method provided.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
  • the application layer can include a series of application packages.
  • the application package may include applications such as phone, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides application programming interfaces (application programming interface, API) and programming frameworks for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text and controls that display pictures.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), fusion daemon (Fusion Daemon) and location based service (location based) service, LBS) etc.
  • surface manager surface manager
  • media library Media Libraries
  • 3D graphics processing library for example: OpenGL ES
  • 2D graphics engine for example: SGL
  • fusion daemon Fusion Daemon
  • location based service location based service
  • the fusion daemon is used to report the information reported by the kernel layer to the framework layer through the location-based service channel.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least sensorhub driver, WiFi driver communication protocol module, and display driver.
  • the sensorhub driver is responsible for collecting and transmitting sensor information and GPS information.
  • the WiFi driver is responsible for collecting information of each wireless signal source, such as the identification of each wireless signal source (for example, the MAC address of the AP), and the characteristic parameters of the signal of each wireless signal source (for example, the RSSI of the AP).
  • the communication protocol module is used to communicate with the modem, collect community information, and perform data communication transmission.
  • the sensorhub driver can be connected to the wireless communication module 304.
  • the wireless communication module 304 detects the first access point parameter information, that is, the MAC address and RSSI of the AP, it sends the first access point parameter information to the sensorhub driver, and the sensorhub driver reports the first access point parameter information to System layer.
  • the kernel layer may also include a display driver for driving the display screen to display information.
  • an indoor positioning method provided by an embodiment of this application is executed by an electronic device 100.
  • the specific steps are as follows.
  • Step 501 The electronic device 100 scans the surrounding wireless signal sources to obtain first access point parameter information.
  • one trigger condition for triggering the electronic device 100 to scan the surrounding wireless signal sources is: the electronic device sets the scan period of the WiFi driver, and whenever the timer expires, triggers the WiFi driver to scan the surrounding wireless signal sources; another A trigger condition is: the processor of the electronic device determines that the displacement of the electronic device reaches a set distance (for example, 500m) based on the detection results of the gyroscope, accelerometer, and electronic compass, and triggers the WiFi driver to scan the surrounding wireless signal sources .
  • a set distance for example, 500m
  • the electronic device may scan APs around the electronic device through WiFi driver to generate first access point parameter information
  • the first access point parameter information may include the MAC address and RSSI of at least one AP, or the first access point
  • the parameter information may include the SSID and RSSI of at least one AP, or the first access point parameter information may include the MAC address, SSID, and RSSI of at least one AP.
  • the first access point parameter information is shown in Table 1.
  • AP MAC address SSID RSSI(dBm) AP1 74:C1:4F:BB:8C:A4 TDIP -20 AP2 74:C1:4F:BB:8C:A6 HW-1 -twenty two AP3 74:C1:4F:BB:8C:AF HW-2 -25
  • the first access point parameter information includes the MAC addresses, SSID, and RSSI of the scanned 3 APs (AP1, AP2, and AP3).
  • AP1's MAC address is 74:C1:4F:BB:8C:A4, SSID is TDIP, RSSI is -20dBm;
  • AP2's MAC address is 74:C1:4F:BB:8C:A6, SSID is HW-1, RSSI It is -22dBm;
  • AP3's MAC address is 74:C1:4F:BB:8C:AF, SSID is HW-2, and RSSI is -25dBm.
  • Step 502 The electronic device 100 determines the similarity between the first access point parameter information and the stored historical access point parameter information.
  • a database including historical access point parameter information is pre-stored in the memory 302 of the electronic device 100, and the database may be as shown in Table 2.
  • the historical access point parameter information includes:
  • the MAC address of ap1 is 74:C1:4F:BB:8C:A4, the SSID is TDIP, and the RSSI is -19dBm;
  • the MAC address of ap2 is 74:C1:4F :BB:8C:A6, SSID is HW-1, RSSI is -20dBm;
  • MAC address of ap3 is 75:C1:4F:BB:8C:AF, SSID is HW-8, RSSI is -16dBm.
  • the "home zone" judgment module 3023 of the electronic device 100 can calculate the similarity between the first access point parameter information and the historical access point parameter information in the following two ways.
  • the electronic device 100 first determines k identical target MAC addresses from the first access point parameter information and the stored historical access point parameter information. Then the electronic device calculates the first access point parameter information and the stored historical access point parameter information according to the RSSI corresponding to the target MAC address in the first access point parameter information and the RSSI corresponding to the target MAC address in the historical access point parameter information The similarity between.
  • the electronic device can calculate the Euclidean distance (English: Euclidean Metric) or Manhattan distance ( English: Manhattan Distance) to get the similarity based on Euclidean distance or Manhattan distance. It should be noted that the smaller the Euclidean distance or Manhattan distance, the greater the similarity. Therefore, the smaller the similarity is, the more similar the first access point parameter information and the historical access point parameter information are.
  • the first access point parameter information is the same as the MAC addresses 74:C1:4F:BB:8C:A4 of AP1 and ap1 in the stored historical access point parameter information, AP2 and ap2
  • the MAC address 74:C1:4F:BB:8C:A4 is the same, so there are two same MAC addresses.
  • the electronic device can calculate the Euclidean distance between two RSSIs.
  • the electronic device can calculate the Euclidean distance between two RSSIs.
  • the electronic device determines the similarity between the first access point parameter information and the historical access point parameter information according to the two Euclidean distances.
  • the electronic device first determines k identical MAC addresses from the first access point parameter information and the stored historical access point parameter information. If k is greater than 0, it calculates the MAC address and the first in the historical access point parameter information. Take the union of the MAC addresses in the parameter information of an access point to obtain the total number of elements M of the union (ie the total number of MAC addresses), and the similarity S is equal to If S ⁇ the first threshold, it means that the results of the two scans are similar. If S>the first threshold, it means that the results of the two scans are not similar. The first threshold can be adjusted according to actual tests.
  • the first access point parameter information is the same as the MAC addresses 74:C1:4F:BB:8C:A4 of AP1 and ap1 in the stored historical access point parameter information, AP2 It is the same as ap2 's MAC address 74:C1:4F:BB:8C:A4, so there are two identical MAC addresses. There are 4 different MAC addresses in the first access point parameter information and historical access point parameter information. The total number of MAC addresses is 4, so the similarity is equal to Assuming that the first threshold is 0.3, the similarity 0.5 is greater than 0.3, so the two scan results are not similar.
  • Step 503 When the similarity is greater than the first threshold, the electronic device 100 reports the first access point parameter information to the positioning server 200.
  • the electronic device sends a message to the positioning server 200 through the mobile communication module 303, the message including the first access point parameter information.
  • the indoor positioning method may further include step 504, when the similarity is less than or equal to the first threshold, the electronic device discards the first access point parameter information. That is, the electronic device does not report the first access point parameter information to the positioning server.
  • Step 505 The positioning server 200 determines the location information of the electronic device 100 according to the first access point parameter information.
  • the positioning server 200 may use a positioning algorithm to determine the position information of the electronic device 100 according to the first access point parameter information.
  • a positioning algorithm There are currently many WiFi-based positioning algorithms, and the commonly used positioning algorithms include fingerprint positioning algorithms and triangulation positioning algorithms.
  • the positioning server 200 uses a fingerprint positioning algorithm, the positioning server 200 matches the first access point parameter information sent by the electronic device 100 with the reference access point parameter information in the access point parameter information database, and determines the match According to the one or more reference access point parameter information that satisfies the condition, the positioning server determines the location information of the electronic device according to the determined location information corresponding to the determined one or more reference access point parameter information.
  • the access point parameter information database is pre-stored in the positioning server, and the access point parameter information database is composed of the location information (such as GPS coordinates) of multiple locations and the access point parameter information of the multiple locations. Forming. Exemplarily, the access point parameter information database is shown in Table 3.
  • the location information of location 1 is (X1, Y1)
  • the access point parameter information of location 1 is (MAC1, RSSI1), (MAC3, RSSI2), (MAC4, RSSI3), etc.
  • the location information of location 2 Is (X2, Y2)
  • the access point parameter information of position 2 is (MAC1, RSSI4), (MAC2, RSSI5), (MAC4, RSSI6), etc.
  • the position information of position 3 is (X3, Y3), etc., position 3
  • the access point parameter information is (MAC1, RSSI7), (MAC2, RSSI8), (MAC3, RSSI9), etc.
  • the positioning server 200 uses the signal attenuation model to estimate the distance between the electronic device 100 and each AP (where the location of the AP is known) according to the first access point parameter information, and then according to the distance between the electronic device 100 and the surrounding APs Draw a circle, and the intersection point is the position of the electronic device.
  • Step 506 The positioning server 200 sends the position information to the electronic device 100.
  • the electronic device 100 may display the positioning result including the location information on the display interface of the touch screen, or may update the display interface of the map application.
  • the electronic device 100 after the electronic device 100 reports the first access point parameter information to the positioning server 200, the electronic device 100 saves the first access point parameter information as historical access point parameter information to the electronic device In the database of 100, the electronic device 100 can subsequently calculate the similarity.
  • the following takes the electronic device 100 as an example of a position tracker worn by a pet to illustrate the indoor positioning method described above.
  • the access point parameter information 1 includes the MAC addresses and RSSI of the three APs.
  • the location tracker calculates that the similarity between the access point parameter information 1 and the historical access point parameter information is greater than the first threshold, so it reports the access point parameter information 1 to the positioning server 200, and replaces the information with the access point parameter information 1 Cache the historical access point parameter information in the module 3021.
  • the location tracker scans APs around location B, and at the second moment, access point parameter information 2 is generated, and the access point parameter information 2 includes The MAC addresses and RSSI of the three APs.
  • the processor 301 of the location tracker uses the aforementioned indoor positioning algorithm to calculate that the similarity between the access point parameter information 2 and the access point parameter information 1 is less than the first threshold, so the location tracker discards the access point parameter information 2, namely Do not report access point parameter information 2.
  • the pet moves from location B shown in FIG. 6 to location C in the park, and the location tracker scans APs around location C, and at the third moment, access point parameter information 3 is generated.
  • the entry point parameter information 3 includes the MAC addresses and RSSI of the three APs.
  • the processor 301 of the location tracker uses the aforementioned indoor positioning algorithm to calculate that the similarity between the access point parameter information 3 and the access point parameter information 1 is greater than the first threshold, so the location tracker uses the mobile communication module 303 to calculate the access point parameters Information 3 is reported to the positioning server 200. And the location tracker uses the access point parameter information 3 to replace the historical access point parameter information in the information caching module 3021 (ie, the access point parameter information 1).
  • Step 701 After receiving the positioning request, the electronic device 100 scans the surrounding wireless signal sources.
  • the electronic device 100 is a location tracker, and when the timer set in the location tracker expires, the location tracker is triggered to start scanning the surrounding wireless signal sources.
  • step 702 the electronic device 100 determines whether the "home zone" flag of the electronic device 100 is set (for example, set to 1). If not, go to step 703, and if yes, go to step 704.
  • the "home zone” indicates a state where the wireless signal source in the environment where the electronic device is located is basically unchanged.
  • the "home zone” flag is set (for example, set to 1) that the electronic device is in the "home zone", and the electronic device preferentially uses the indoor positioning method provided in the embodiment of this application for positioning;
  • the "home zone” flag is not set Bit (for example, 0) indicates that the electronic device is not in the "home zone, and the electronic device first executes the outdoor positioning algorithm. It can be seen that the electronic device can accurately determine the corresponding positioning method according to the "home zone” flag, and effectively perform the electronic device Positioning can not only ensure the accuracy of the positioning result, but also save the power consumption of the electronic device in the positioning process to a certain extent.
  • the "home zone” flag is set Set from 0 to 1.
  • the electronic device first determines whether the "home zone” flag is 1, if it is, then executes step 703; otherwise, executes step 704.
  • Step 703 When the electronic device 100 determines that the "home zone" flag is not set (for example, it is still 0), the electronic device 100 preferentially executes the outdoor positioning algorithm.
  • the electronic device 100 may adopt global positioning system (GPS) ) For positioning.
  • GPS global positioning system
  • Step 704 When the electronic device 100 determines that the "home zone" flag is set (for example, it is set to 1), the electronic device preferentially uses the indoor positioning method provided in this embodiment of the application for positioning, that is, the processor of the electronic device 100 first Send a scan instruction to the WiFi driver, and the WiFi driver scans the surrounding wireless signal sources to obtain the first access point parameter information.
  • the electronic device preferentially uses the indoor positioning method provided in this embodiment of the application for positioning, that is, the processor of the electronic device 100 first Send a scan instruction to the WiFi driver, and the WiFi driver scans the surrounding wireless signal sources to obtain the first access point parameter information.
  • Step 705 The processor of the electronic device 100 calculates the similarity between the first access point parameter information and the historical access point parameter information.
  • the specific calculation process includes the following steps.
  • Step a The electronic device 100 first determines k identical MAC addresses from the first access point parameter information and stored historical access point parameter information.
  • Step b The electronic device 100 obtains the first RSSI set corresponding to k identical MAC addresses from the first access point parameter information, and obtains the second RSSI corresponding to k identical MAC addresses from the historical access point parameter information set.
  • Step c since the RSSI is a similar value of -50dBm, which is not convenient for calculation, the electronic device 100 normalizes the first RSSI set and the second RSSI set to obtain the normalized first RSSI set and the normalized RSSI set The second RSSI collection. That is, on the one hand, the electronic device 100 performs normalization processing on the first RSSI set, and the obtained first RSSI after normalization meets the requirements of the following formula:
  • B i represents the i-th RSSI in the first RSSI set after normalization
  • b i is the i-th RSSI in the first RSSI set before normalization, where the value of i is from 1 to k ;
  • the electronic device 100 performs normalization processing on the second RSSI set, and the obtained normalized k second RSSIs meet the requirements of the following formula:
  • a i represents the i-th RSSI in the second RSSI set after normalization; a i is the i-th RSSI in the second RSSI set before normalization, and the value of i is from 1 to k .
  • Step d the electronic device 100 calculates the similarity according to the normalized first RSSI set and the normalized second RSSI set, and the similarity meets the requirements of the following formula:
  • k represents the number of the same MAC address
  • Num represents the union of the MAC address in the historical access point parameter information and the MAC address in the first access point parameter information to obtain the total number of elements of the union (ie the MAC address Total)
  • vector B is the first normalized RSSI set
  • B i represents the i-th RSSI in the first normalized RSSI set
  • vector A is the second normalized RSSI set
  • a i represents the i-th RSSI in the second normalized RSSI set
  • S represents the similarity
  • the value of i ranges from 1 to k, where B i and A i are RSSIs of the same MAC address.
  • the electronic device 100 first normalizes the RSSI, which can facilitate the calculation of the similarity. Because the above algorithm comprehensively considers the Euclidean distance between the two RSSIs corresponding to each same MAC address, so finally The calculated similarity is more accurate and reliable.
  • step 706 when the processor of the electronic device 100 determines that the similarity is less than or equal to the first threshold, step 707 is executed, and when it is greater than the first threshold, step 708 is executed.
  • the first threshold is set based on experience, for example, the first threshold is 0.1, and the processor determines whether the similarity S is greater than 0.1.
  • step 708 is executed.
  • step 707 is executed.
  • Step 707 When the similarity is less than or equal to the first threshold, the electronic device 100 does not report the first access point parameter information.
  • the position tracker moves from position B to position A as shown in FIG. 6, the similarity calculated by the position tracker is less than the first threshold, so the "home zone" flag is still maintained at 1, and the position tracker is not reported Access point parameter information obtained by scanning at location A.
  • Step 708 When the similarity is greater than the first threshold, the electronic device 100 clears the current “home zone” flag (for example, resets it from 1 to 0), and then reports the first access point parameter information to the positioning server 200.
  • the electronic device 100 clears the current “home zone” flag (for example, resets it from 1 to 0), and then reports the first access point parameter information to the positioning server 200.
  • the position tracker calculates that the similarity is greater than the first threshold, and the position tracker sets the current "home zone” flag from 1 to 0 , And report access point parameter information 3 to the positioning server 200.
  • step 709 the electronic device 100 replaces the historical access point parameter information in the information caching module 3021 with the first access point parameter information, so as to facilitate the calculation of the similarity next time.
  • Step 710 The electronic device 100 obtains location information from the positioning server 200, and generates a positioning result.
  • the positioning server 200 may match the first access point parameter information sent by the electronic device with the reference access point parameter information in the access point parameter information database, and determine one or more reference access points whose matching degree meets the condition. Point parameter information, and finally the positioning server determines the location information of the electronic device according to the determined location information corresponding to the determined one or more reference access point parameter information. Then the electronic device receives the location information sent from the positioning server.
  • the electronic device 100 may first obtain the access point parameter information database from the positioning server 200, and then the electronic device 100 takes the position corresponding to the historical access point parameter information as the center point, and takes the set distance as the radius. Determine a three-dimensional space area, determine the target location in the three-dimensional space area where the position information falls from the access point parameter information database, and determine the access point parameter information set composed of access point parameter information corresponding to all target locations . After the electronic device obtains the first access point parameter information, it can calculate the similarity between the first access point parameter information and each access point parameter information in the access point parameter information set, and when the similarity is greater than the first threshold , The first access point parameter information is reported to the positioning server, otherwise it is not reported. This method helps to save power consumption.
  • the electronic device 100 when the user of the electronic device 100 moves from location B to location C, the electronic device scans at location C to obtain access point parameter information 3, and when the access point parameter information 3 is in contact with the electronic device Only when the similarity of each access point parameter information in the access point parameter information set corresponding to the historical access point parameter information reported by location B is greater than the first threshold, the electronic device 100 reports the access point to the positioning server 200 Parameter information 3.
  • the electronic device 100 may also obtain the access point parameter information database from the positioning server 200 in advance, and the electronic device 100 compares the access point parameter information with the reference access point parameter in the access point parameter information database. The information is matched, one or more reference access point parameter information whose matching degree meets the condition are determined, and the location information of the electronic device 100 is determined according to the location information corresponding to the determined one or more reference access point parameter information. If the electronic device 100 cannot determine the location information of the electronic device according to the access point parameter information database, it reports the first access point parameter information to the positioning server 200, which helps to save power consumption.
  • the manner in which the electronic device obtains the access point parameter information data may be implemented in the following multiple manners.
  • the electronic device can download the access point parameter information database corresponding to the area range where the electronic device is currently located from the positioning server.
  • the current area of the electronic device may be the current cell or city.
  • the electronic device when the electronic device sends a request to the positioning server, the request carries cell information or city information, and the positioning server determines an access point parameter information database based on the request, and sends the access point parameter information database to the electronic device.
  • the electronic device may send the request periodically, or send the request when triggered by the user (for example, when the service push function is triggered), or when the electronic device detects that the current city information has changed , Report the city information to the positioning server, and then receive the access point parameter information database corresponding to the city information sent by the server, or, when the electronic device detects a change in the camping cell, report the handover camping cell to the positioning server And then receive the access point parameter information database corresponding to the camping cell sent by the positioning server.
  • the electronic device may send the request periodically, or send the request when triggered by the user (for example, when the service push function is triggered), or when the electronic device detects that the current city information has changed , Report the city information to the positioning server, and then receive the access point parameter information database corresponding to the city information sent by the server, or, when the electronic device detects a change in the camping cell, report the handover camping cell to the positioning server And then receive the access point parameter information database corresponding to the camping cell sent by the positioning server.
  • the positioning server can actively send the access point parameter information database to the electronic device. For example, after the positioning server determines that the access point parameter information database downloaded last time by the electronic device has been updated, it can actively send the updated access point parameter information database to the electronic device.
  • the positioning server may collect the access point parameter information and geographic location reported by each electronic device, and then determine the location information of the access point according to the reported geographic location information, and then form an access point parameter information database, and issue To the electronic device.
  • the access point parameter information database may also be calculated by the electronic device itself.
  • the electronic device may record geographic location information after each access to a WiFi access point, and then construct a correspondence between the WiFi access point and geographic location information to obtain an access point parameter information database.
  • the electronic device using the above positioning method can effectively reduce the power consumption consumed by the data transmission interaction with the positioning server during the WiFi indoor positioning process, thereby improving the endurance of the product.
  • the electronic device may include a hardware structure and/or a software module, and realize the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed in a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraint conditions of the technical solution.
  • This embodiment also provides a computer storage medium.
  • the computer storage medium stores computer instructions.
  • the computer instructions run on an electronic device, the electronic device executes one or the other of the embodiments shown in FIG. 5 and FIG. Multiple steps to implement the method in the above embodiment.
  • This embodiment also provides a program product.
  • the program product runs on a computer
  • the computer executes one or more steps in the embodiment shown in FIG. 5 and FIG. 7 to implement the method in the above embodiment. .
  • the embodiments of the present application also provide a device.
  • the device may specifically be a chip, component or module.
  • the device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions.
  • the processor can execute the computer-executable instructions stored in the memory, so that the chip executes one or more steps in the embodiment shown in FIG. 5 or FIG. 7 to implement the method in the foregoing embodiment.
  • the electronic device, computer storage medium, program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding method provided above The beneficial effects in the process will not be repeated here.
  • the electronic devices in the embodiments of the present application may also be mobile phones, tablets, wearable devices with wireless communication functions (such as smart watches), computers with wireless transmission and reception functions, and virtual reality (virtual reality, VR) equipment, augmented reality (AR) equipment, industrial control (industrial control) wireless equipment, unmanned driving (self-driving) wireless equipment, remote medical (remote medical) wireless equipment, smart grid Wireless devices in (smart grid), wireless devices in transportation safety, wireless devices in smart cities, wireless devices in smart homes, and so on.
  • VR virtual reality
  • AR augmented reality
  • industrial control industrial control
  • unmanned driving self-driving
  • remote medical remote medical
  • smart grid Wireless devices in (smart grid) wireless devices in transportation safety, wireless devices in smart cities, wireless devices in smart homes, and so on.
  • FIG. 8 shows a schematic structural diagram of the mobile phone 100.
  • the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, mobile communication module 151, wireless communication module 152, Audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, SIM card interface 195 and so on.
  • a processor 110 an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, mobile communication module 151, wireless communication module 152, Audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, SIM card interface 195 and so on.
  • the sensor module 180 may include a gyroscope sensor 180A, an acceleration sensor 180B, a proximity light sensor 180G, a fingerprint sensor 180H, and a touch sensor 180K (Of course, the mobile phone 100 may also include other sensors, such as temperature sensors, pressure sensors, distance sensors, and magnetic sensors. , Ambient light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100.
  • the mobile phone 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (Neural-network Processing Unit, NPU) Wait.
  • AP application processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • NPU neural network Processing Unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the mobile phone 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may run the indoor positioning method provided in the embodiment of the present application, and reduce the power consumption of the electronic device during the positioning process under the premise of ensuring the accuracy of the positioning result.
  • the processor 110 integrates different devices, such as integrated CPU and GPU, the CPU and GPU can cooperate to execute the indoor positioning method provided in the embodiments of the present application.
  • part of the algorithm is executed by the CPU, and the other part of the algorithm is executed by the GPU. In order to get faster processing efficiency.
  • the display screen 194 is used to display images, videos, etc.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the mobile phone 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the camera 193 (a front camera or a rear camera, or a camera can be used as a front camera or a rear camera) is used to capture still images or videos.
  • the camera 193 may include photosensitive elements such as a lens group and an image sensor, where the lens group includes a plurality of lenses (convex lens or concave lens) for collecting light signals reflected by the object to be photographed and transmitting the collected light signals to the image sensor .
  • the image sensor generates an original image of the object to be photographed according to the light signal.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store operating system, application program (such as camera application, WeChat application, etc.) codes and so on.
  • the data storage area can store data created during the use of the mobile phone 100 (for example, images and videos collected by a camera application).
  • the internal memory 121 may also store the code of the anti-mistouch algorithm provided in the embodiment of the present application.
  • the code of the anti-mistouch algorithm stored in the internal memory 121 is executed by the processor 110, the touch operation during the folding or unfolding process can be shielded.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • the code for implementing the algorithm for video editing can also be stored in an external memory.
  • the processor 110 may run the algorithm code stored in the external memory through the external memory interface 120 to implement editing of the video.
  • the functions of the sensor module 180 are described below.
  • the gyroscope sensor 180A can be used to determine the movement posture of the mobile phone 100.
  • the angular velocity of the mobile phone 100 around three axes ie, x, y, and z axes
  • the gyroscope sensor 180A can be used to detect the current movement state of the mobile phone 100, such as shaking or static.
  • the acceleration sensor 180B can detect the magnitude of the acceleration of the mobile phone 100 in various directions (generally three axes). That is, the gyroscope sensor 180A can be used to detect the current movement state of the mobile phone 100, such as shaking or static.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the mobile phone emits infrared light through light-emitting diodes. Mobile phones use photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the phone. When insufficient reflected light is detected, the phone can determine that there is no object near the phone.
  • the gyroscope sensor 180A (or acceleration sensor 180B) may send the detected motion state information (such as angular velocity) to the processor 110.
  • the processor 110 determines whether it is currently in a hand-held state or a tripod state based on the motion state information (for example, when the angular velocity is not 0, it means that the mobile phone 100 is in the hand-held state).
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the mobile phone 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the mobile phone 100, which is different from the position of the display screen 194.
  • the display screen 194 of the mobile phone 100 displays a main interface, and the main interface includes icons of multiple applications (such as a camera application, a WeChat application, etc.).
  • the display screen 194 displays an interface of the camera application, such as a viewfinder interface.
  • the wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 151, the wireless communication module 152, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 151 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the mobile phone 100.
  • the mobile communication module 151 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 151 can receive electromagnetic waves by the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 151 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 151 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 151 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 151 or other functional modules.
  • the wireless communication module 152 can provide applications on the mobile phone 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems. (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 152 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 152 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 152 can also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic wave
  • the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 151, and the antenna 2 is coupled with the wireless communication module 152, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the mobile phone 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the mobile phone 100 can receive the key 190 input, and generate key signal input related to the user settings and function control of the mobile phone 100.
  • the mobile phone 100 can use the motor 191 to generate a vibration notification (such as an incoming call vibration notification).
  • the indicator 192 in the mobile phone 100 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 in the mobile phone 100 is used to connect to the SIM card.
  • the SIM card can be connected to and separated from the mobile phone 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195.
  • the mobile phone 100 may include more or less components than those shown in FIG. 1, which is not limited in the embodiment of the present application.
  • the functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • a computer readable storage medium includes a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Provided are an indoor location method and an electronic device. The method is applied to the electronic device that supports a wireless local area network. The method can effectively reduce the power consumption overheads of the electronic device during a location process, and can improve the endurance ability of the electronic device. The method comprises: an electronic device scanning a wireless signal source around the electronic device, and acquiring first access point parameter information; then determining the similarity between the first access point parameter information and pre-stored historical access point parameter information, wherein a lower similarity indicates that the first access point parameter information is more similar to the historical access point parameter information; when the similarity is greater than a first threshold value, reporting the first access point parameter information to a location server; the location server determining, according to the first access point parameter information, position information of the electronic device; and finally, the electronic device receiving the position information sent by the location server.

Description

一种室内定位方法及电子设备Indoor positioning method and electronic equipment
本申请要求在2019年06月27日提交中华人民共和国知识产权局、申请号为201910568695.6、发明名称为“一种室内定位方法及终端设备”的中国专利申请的优先权,在2019年08月28日提交中华人民共和国知识产权局、申请号为201910804013.7、发明名称为“一种室内定位方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Intellectual Property Office of the People’s Republic of China, the application number is 201910568695.6, and the invention title is "an indoor positioning method and terminal equipment" on June 27, 2019, on August 28, 2019 Priority of the Chinese patent application filed with the Intellectual Property Office of the People’s Republic of China with the application number 201910804013.7 and the invention title of "An Indoor Positioning Method and Electronic Equipment", the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种室内定位方法及电子设备。This application relates to the field of terminal technology, and in particular to an indoor positioning method and electronic equipment.
背景技术Background technique
目前,随着移动通信技术的发展和业务需求的增长,基于移动终端位置的定位服务已经越来越多。基于定位的服务涉及交通、物流、治安等日常生活的诸多领域,可以提供导航、物流管理、交通信息、日程安排等众多业务,因此,应用非常广泛。At present, with the development of mobile communication technology and the growth of business requirements, there are more and more location services based on the location of mobile terminals. Location-based services involve many areas of daily life such as transportation, logistics, public security, etc., and can provide navigation, logistics management, traffic information, scheduling and other services, so it is widely used.
目前常用的室内定位技术是无线保真(wireless fidelity,WiFi)定位技术,所谓WiFi定位技术,即电子设备周期性地对周围的无线信号进行扫描,并将扫描结果周期性地上报至定位服务器,由定位服务器根据扫描结果确定电子设备的当前位置信息。At present, the commonly used indoor positioning technology is wireless fidelity (WiFi) positioning technology. The so-called WiFi positioning technology means that electronic devices periodically scan the surrounding wireless signals, and periodically report the scanning results to the positioning server. The location server determines the current location information of the electronic device according to the scanning result.
目前电子设备使用上述WiFi定位技术进行定位,所消耗的功耗较大。一方面,电子设备周期性地扫描周围的无线信号会消耗功耗;另一方面,电子设备周期性地将扫描结果上报至定位服务器会消耗功耗,所以若电子设备的WiFi定位功能一直开启,会严重影响电子设备的续航能力。Currently, electronic devices use the above-mentioned WiFi positioning technology for positioning, which consumes relatively large power consumption. On the one hand, the electronic device periodically scans the surrounding wireless signals will consume power; on the other hand, the electronic device periodically reports the scan results to the positioning server will consume power, so if the electronic device’s WiFi positioning function is always on, Will seriously affect the endurance of electronic equipment.
发明内容Summary of the invention
本申请提供一种室内定位方法及电子设备,用以节省在定位过程中电子设备所消耗的功耗,提高电子设备的续航能力。The present application provides an indoor positioning method and electronic equipment, which are used to save the power consumption of the electronic equipment during the positioning process and improve the endurance of the electronic equipment.
第一方面,本申请实施例提供了一种室内定位方法,该方法适用于电子设备,该方法包括:电子设备对自身周围的无线信号源进行扫描,获取第一接入点参数信息,然后确定第一接入点参数信息与存储的历史接入点参数信息之间的相似度,其中,相似度越小表示第一接入点参数信息和历史接入点参数信息越相似。当所述相似度小于或等于第一阈值时,丢弃所述第一接入点参数信息,当相似度大于第一阈值时,向定位服务器上报第一接入点参数信息,定位服务器根据第一接入点参数信息确定电子设备的位置信息,最终电子设备接收定位服务器发送的位置信息。In the first aspect, an embodiment of the present application provides an indoor positioning method, which is applicable to an electronic device, and the method includes: the electronic device scans wireless signal sources around itself, obtains first access point parameter information, and then determines The similarity between the first access point parameter information and the stored historical access point parameter information, where a smaller similarity indicates that the first access point parameter information is more similar to the historical access point parameter information. When the similarity is less than or equal to the first threshold, discard the first access point parameter information, and when the similarity is greater than the first threshold, report the first access point parameter information to the positioning server, and the positioning server according to the first The access point parameter information determines the location information of the electronic device, and finally the electronic device receives the location information sent by the positioning server.
本申请实施例中,电子设备只有在接入点参数信息和历史接入点参数信息的相似度大于第一阈值时才上报扫描结果,所以可以节省电子设备的功耗,提高电子设备的续航能力。In the embodiment of the application, the electronic device reports the scanning result only when the similarity between the access point parameter information and the historical access point parameter information is greater than the first threshold, so the power consumption of the electronic device can be saved, and the endurance of the electronic device can be improved .
在一种可能的设计中,电子设备按照如下方式确定第一接入点参数信息与存储的历史接入点参数信息之间的相似度,具体方式包括:In a possible design, the electronic device determines the similarity between the first access point parameter information and the stored historical access point parameter information in the following manner, and the specific manner includes:
电子设备从所述第一接入点参数信息与存储的历史接入点参数信息中,确定出k个相同的媒体访问控制MAC地址;然后从所述第一接入点参数信息中获取所述k个相同的MAC地址对应的第一RSSI集合,以及从所述历史接入点参数信息中获取所述k个相同的MAC地址对应的第二RSSI集合;最终根据第一RSSI集合和第二RSSI集合,确定所述第一接入点参数 信息与存储的历史接入点参数信息之间的相似度。The electronic device determines k identical media access control MAC addresses from the first access point parameter information and the stored historical access point parameter information; and then obtains the first access point parameter information The first RSSI set corresponding to the k identical MAC addresses, and the second RSSI set corresponding to the k identical MAC addresses are obtained from the historical access point parameter information; finally, according to the first RSSI set and the second RSSI Set, determine the similarity between the first access point parameter information and the stored historical access point parameter information.
本申请实施例中,电子设备利用上述方法可以准确地计算第一接入点参数信息与存储的历史接入点参数信息之间的相似度,以便于确定是否需要上报。In the embodiment of the present application, the electronic device can accurately calculate the similarity between the first access point parameter information and the stored historical access point parameter information by using the above method, so as to determine whether it needs to be reported.
在一种可能的设计中,电子设备将所述第一RSSI集合和所述第二RSSI集合进行归一化处理,得到归一化后的第一RSSI集合和归一化后的第二RSSI集合,然后根据所述归一化后的第一RSSI集合和归一化后的第二RSSI集合,计算所述相似度,所述相似度符合下述公式要求:In a possible design, the electronic device normalizes the first RSSI set and the second RSSI set to obtain a normalized first RSSI set and a normalized second RSSI set , And then calculate the similarity according to the normalized first RSSI set and the normalized second RSSI set, and the similarity meets the requirements of the following formula:
Figure PCTCN2020097887-appb-000001
Figure PCTCN2020097887-appb-000001
其中,k表示相同的MAC地址的个数,Num表示历史接入点参数信息中的MAC地址和第一接入点参数信息中的MAC地址取并集,得到的MAC地址总数,B i表示归一化后第一RSSI集合中的第i个RSSI,A i表示归一化后第二RSSI集合终端第i个RSSI,S表示相似度,i的取值从1到k,其中,B i和A i为同一MAC地址的RSSI。 Among them, k represents the number of the same MAC address, Num represents the union of the MAC address in the historical access point parameter information and the MAC address in the first access point parameter information to obtain the total number of MAC addresses, and B i represents the return After normalization, the i-th RSSI in the first RSSI set, A i represents the i-th RSSI of the terminal in the second RSSI set after normalization, S represents the similarity, and the value of i ranges from 1 to k, where B i and A i is the RSSI of the same MAC address.
本申请实施例中,电子设备按照上述方法可以准确地计算出相似度。In the embodiment of the present application, the electronic device can accurately calculate the similarity according to the above method.
在一种可能的设计中,电子设备将所述第一RSSI集合进行归一化处理,得到的归一化后的第一RSSI集合符合下述公式要求:In a possible design, the electronic device normalizes the first RSSI set, and the obtained normalized first RSSI set meets the requirements of the following formula:
Figure PCTCN2020097887-appb-000002
Figure PCTCN2020097887-appb-000002
其中,B i表示归一化后的第一RSSI集合中的第i个RSSI;b i为归一化之前的第一RSSI集合中的第i个RSSI,其中i的取值是从1到k; Among them, B i represents the i-th RSSI in the first RSSI set after normalization; b i is the i-th RSSI in the first RSSI set before normalization, where the value of i is from 1 to k ;
将所述第二RSSI集合进行归一化处理,得到的归一化后的第二RSSI集合符合下述公式要求:The second RSSI set is normalized, and the obtained normalized second RSSI set meets the requirements of the following formula:
Figure PCTCN2020097887-appb-000003
Figure PCTCN2020097887-appb-000003
其中,A i表示归一化后的第二RSSI集合中的第i个RSSI;a i为归一化之前的第二RSSI集合中的第i个RSSI,其中i的取值是从1到k。 Among them, A i represents the i-th RSSI in the second RSSI set after normalization; a i is the i-th RSSI in the second RSSI set before normalization, and the value of i is from 1 to k .
本申请实施例中,电子设备按照上述方法可以准确地对RSSI进行归一化,以便于后续准确计算相似度。In the embodiment of the present application, the electronic device can accurately normalize the RSSI according to the above method, so as to facilitate subsequent accurate calculation of similarity.
在一种可能的设计中,电子设备可以从所述第一接入点参数信息与所述历史接入点参数信息中,确定出k个相同的媒体访问控制MAC地址;然后将所述第一接入点参数信息与所述历史接入点参数信息中的MAC地址取并集,得到MAC地址总数;最终根据所述K与MAC地址总数计算所述相似度,所述相似度符合下述公式要求:In a possible design, the electronic device may determine k identical media access control MAC addresses from the first access point parameter information and the historical access point parameter information; The access point parameter information and the MAC address in the historical access point parameter information are combined to obtain the total number of MAC addresses; finally the similarity is calculated according to the K and the total number of MAC addresses, and the similarity conforms to the following formula Claim:
Figure PCTCN2020097887-appb-000004
Figure PCTCN2020097887-appb-000004
其中,k表示相同的媒体访问控制MAC地址的个数,M为MAC地址总数,S为相似度。Among them, k represents the number of the same media access control MAC address, M is the total number of MAC addresses, and S is the degree of similarity.
本申请实施例中,电子设备按照上述方法可以准确地计算出相似度。In the embodiment of the present application, the electronic device can accurately calculate the similarity according to the above method.
在一种可能的设计中,对电子设备周围的无线信号源进行扫描,生成第一接入点参数信息,具体方式是:当定时器时间到达时,对电子设备周围的无线信号源进行扫描;或者,当电子设备的移动距离达到一定门限值时,对电子设备周围的无线信号源进行扫描。In a possible design, the wireless signal sources around the electronic device are scanned to generate the first access point parameter information, and the specific method is: when the timer expires, the wireless signal sources around the electronic device are scanned; Or, when the moving distance of the electronic device reaches a certain threshold, the wireless signal sources around the electronic device are scanned.
本申请实施例中,终端设按照上述条件触扫描,一定程度上可以减少扫描次数,降低功 耗。In the embodiment of the present application, the terminal is set to touch and scan according to the above conditions, which can reduce the number of scans to a certain extent and reduce power consumption.
第二方面,本申请实施例提供一种电子设备,包括处理器和存储器。其中,存储器用于存储一个或多个计算机程序;当存储器存储的一个或多个计算机程序被处理器执行时,使得该电子设备能够实现上述任一方面的任意一种可能的设计的方法。In the second aspect, an embodiment of the present application provides an electronic device including a processor and a memory. Wherein, the memory is used to store one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the electronic device can implement any one of the possible design methods in any of the foregoing aspects.
第三方面,本申请实施例还提供一种装置,该装置包括执行上述任一方面的任意一种可能的设计的方法的模块/单元。这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。In a third aspect, an embodiment of the present application also provides a device, which includes a module/unit that executes any one of the possible design methods in any of the foregoing aspects. These modules/units can be realized by hardware, or by hardware executing corresponding software.
第四方面,本申请实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得所述电子设备执行上述任一方面的任意一种可能的设计的方法。In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium includes a computer program. When the computer program runs on an electronic device, the electronic device executes any of the above aspects. Any one of the possible design methods.
第五方面,本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在终端上运行时,使得所述电子设备执行上述任一方面的任意一种可能的设计的方法。In a fifth aspect, the embodiments of the present application also provide a computer program product, which when the computer program product runs on a terminal, causes the electronic device to execute any one of the possible design methods in any of the foregoing aspects.
第六方面,本申请实施例还提供一种芯片,芯片与存储器耦合,用于执行所述存储器中存储的计算机程序,使得所述电子设备执行上述任一方面的任意一种可能的设计的方法。In a sixth aspect, the embodiments of the present application also provide a chip, which is coupled with a memory, and is used to execute a computer program stored in the memory, so that the electronic device executes any possible design method of any of the above aspects .
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the application will be more concise and understandable in the description of the following embodiments.
附图说明Description of the drawings
图1为本申请实施例提供的一种应用场景示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the application;
图2为本申请实施例提供的一种位置追踪器的应用场景示意图;2 is a schematic diagram of an application scenario of a location tracker provided by an embodiment of the application;
图3为本申请实施例提供的一种位置追踪器的结构示意图;FIG. 3 is a schematic structural diagram of a position tracker provided by an embodiment of the application;
图4为本申请实施例提供的一种安卓系统架构示意图;4 is a schematic diagram of an Android system architecture provided by an embodiment of the application;
图5为本申请实施例提供的一种电子设备的室内定位方法流程示意图;FIG. 5 is a schematic flowchart of an indoor positioning method for electronic equipment according to an embodiment of the application;
图6为本申请实施例提供的一种定位场景示意图;FIG. 6 is a schematic diagram of a positioning scenario provided by an embodiment of the application;
图7为本申请实施例提供的另一种电子设备的室内定位方法流程示意图;FIG. 7 is a schematic flowchart of another indoor positioning method for electronic equipment according to an embodiment of the application;
图8为本申请实施例提供的一种电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
具体实施方式Detailed ways
为了便于理解,示例的给出了部分与本申请实施例相关概念的说明以供参考。For ease of understanding, some illustrations of concepts related to the embodiments of the present application are given as examples for reference.
接入点参数信息,指的是电子设备在某一地理位置处所检测到的各无线信号源的标识,以及各无线信号源的信号的特征参数。例如,无线信号源可以为无线局域网(wireless area networks,WLAN)中的接入点(access point,AP),无线信号源标识可以为该AP的媒体访问控制(media access control,MAC)地址,而无线信号源的信号的特征参数可以为接收信号强度指示(received signal strength indication,RSSI)。The access point parameter information refers to the identification of each wireless signal source detected by the electronic device at a certain geographic location, and the characteristic parameters of the signal of each wireless signal source. For example, the wireless signal source may be an access point (AP) in a wireless area network (WLAN), and the wireless signal source identifier may be the media access control (MAC) address of the AP, and The characteristic parameter of the signal of the wireless signal source may be a received signal strength indication (RSSI).
无线信号源,可以是接入点(access point,AP)、蓝牙信号源等近距离无线通信信号源。AP具体可以指无线路由、手机热点等,本申请实施例不作限定。每个AP具有一个特有的WiFi标识,WiFi标识可以是服务集标识(Service Set Identifier,SSID),或者WiFi名称。其中,WiFi标识还可以包括AP的MAC地址,RSSI等。The wireless signal source may be a short-range wireless communication signal source such as an access point (AP) and a Bluetooth signal source. The AP may specifically refer to a wireless router, a mobile phone hot spot, etc., which is not limited in the embodiment of the present application. Each AP has a unique WiFi ID, and the WiFi ID can be a Service Set Identifier (SSID) or a WiFi name. Among them, the WiFi identification may also include the MAC address of the AP, RSSI, and so on.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, below, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. . Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of these features.
图1为一种室内定位场景架构示意图,该场景架构包括位于室内空间的电子设备100和服务器200,以及分别位于室内空间中的不同楼层位置的多个无线信号源(例如AP1/AP2/AP3/AP4)。电子设备100和服务器200可以通过通信网络互相通信。示意性地,图1中的室内空间为一幢楼,AP1/AP2/AP3/AP4分别位于不同楼层。服务器200可以是一台服务器,或者由若干台服务器组成的服务器集群,或者是云服务器。FIG. 1 is a schematic diagram of an indoor positioning scene architecture. The scene architecture includes an electronic device 100 and a server 200 located in an indoor space, and multiple wireless signal sources (such as AP1/AP2/AP3/ AP4). The electronic device 100 and the server 200 may communicate with each other through a communication network. Schematically, the indoor space in Figure 1 is a building, and AP1/AP2/AP3/AP4 are located on different floors. The server 200 may be one server, or a server cluster composed of several servers, or a cloud server.
该通信网络可以是局域网,也可以是通过中继(relay)设备转接的广域网,或者包括局域网和广域网。当该通信网络为局域网时,示例性的,该通信网络可以是WiFi热点网络、WiFi P2P网络、蓝牙网络、zigbee网络或近场通信(near field communication,NFC)网络等近距离通信网络。当该通信网络为广域网时,示例性的,该通信网络可以是第三代移动通信技术(3rd-generation wireless telephone technology,3G)网络、第四代移动通信技术(the 4th generation mobile communication technology,4G)网络、第五代移动通信技术(5th-generation mobile communication technology,5G)网络、未来演进的公共陆地移动网络(public land mobile network,PLMN)或因特网等。The communication network may be a local area network, or a wide area network switched through a relay device, or include a local area network and a wide area network. When the communication network is a local area network, for example, the communication network may be a short-distance communication network such as a WiFi hotspot network, a WiFi P2P network, a Bluetooth network, a zigbee network, or a near field communication (NFC) network. When the communication network is a wide area network, for example, the communication network may be a 3rd-generation wireless telephone technology (3G) network, or the 4th generation mobile communication technology (4G). ) Network, the fifth-generation mobile communication technology (5G) network, the future evolution of the public land mobile network (PLMN) or the Internet, etc.
现有的WiFi定位技术原理是:定位服务器存储有每个接入点参数信息和位置的对应关系。电子设备周期性地扫描周围AP,获取所处位置的接入点参数信息,并周期性地将每次获取的接入点参数信息发送给定位服务器。定位服务器将电子设备每次发送的接入点参数信息与预设的对应关系中的接入点参数信息进行匹配,根据匹配结果确定出电子设备的位置信息。The principle of the existing WiFi positioning technology is: the positioning server stores the corresponding relationship between the parameter information and the location of each access point. The electronic device periodically scans the surrounding APs, obtains the access point parameter information of the location, and periodically sends the access point parameter information obtained each time to the positioning server. The positioning server matches the access point parameter information sent by the electronic device each time with the access point parameter information in the preset correspondence relationship, and determines the location information of the electronic device according to the matching result.
可见,现有技术中电子设备将每次的扫描结果均上报至定位服务器,从实际测试来看,这部分功耗消耗相对较大。考虑到在某些场景下,电子设备的前后位置并没有太大变化,比如图1中的电子设备100从AP2所在区域移动至AP3所在区域时,电子设备100的AP扫描结果并没有太大的变化,所以这种情况下可以不将在AP3所在区域扫描到的接入点参数信息发送至定位服务器。It can be seen that the electronic device in the prior art reports each scan result to the positioning server, and from the actual test, this part of the power consumption is relatively large. Considering that in some scenarios, the front and rear positions of the electronic device have not changed much. For example, when the electronic device 100 in FIG. 1 moves from the area where AP2 is located to the area where AP3 is located, the AP scan result of the electronic device 100 is not too large. Therefore, in this case, the access point parameter information scanned in the area where AP3 is located may not be sent to the positioning server.
基于上述分析,本申请实施例提供一种室内定位方法,该方法可以适用于图1所示的场景架构,该方法包括:电子设备100对周围的无线信号源进行扫描,获取当前位置的第一接入点参数信息,当第一接入点参数信息与存储的历史接入点参数信息之间的相似度小于第一阈值时,电子设备才通过通信网络将第一接入点参数信息上报给定位服务器200,定位服务器200将第一接入点参数信息与接入点参数信息数据库中的参考接入点参数信息进行匹配,根据匹配结果确定出电子设备当前的位置信息,并将确定出来的位置信息发送至电子设备100。Based on the above analysis, an embodiment of the present application provides an indoor positioning method, which can be applied to the scene architecture shown in FIG. 1, and the method includes: the electronic device 100 scans the surrounding wireless signal sources to obtain the first position of the current position. Access point parameter information. When the similarity between the first access point parameter information and the stored historical access point parameter information is less than the first threshold, the electronic device reports the first access point parameter information to the The positioning server 200. The positioning server 200 matches the first access point parameter information with the reference access point parameter information in the access point parameter information database, determines the current location information of the electronic device according to the matching result, and determines the current location information of the electronic device. The location information is sent to the electronic device 100.
本申请中的电子设备100,可以是如图1和图2所示的位置追踪器。目前位置追踪器应用广泛,参见图2,电子设备100可以作为宠物定位器,电子设备100也可以被老人和小孩随身佩戴,或者电子设备100可以被安装在行李箱和自行车中。上述定位方法尤其适用于WiFi定位功能一直开启,即定位功能处于常开状态的位置追踪器。当本申请实施例提供的定位方法应用至位置追踪器中时,可以大大提升位置追踪器的续航能力。The electronic device 100 in this application may be a position tracker as shown in FIGS. 1 and 2. At present, the location tracker is widely used. Referring to FIG. 2, the electronic device 100 can be used as a pet locator, the electronic device 100 can also be worn by the elderly and children, or the electronic device 100 can be installed in suitcases and bicycles. The above positioning method is particularly suitable for a location tracker whose WiFi positioning function is always on, that is, the positioning function is in a normally open state. When the positioning method provided by the embodiment of the present application is applied to a position tracker, the battery life of the position tracker can be greatly improved.
示例性地,图3示出了一种位置追踪器的结构图。该位置追踪器主要包括:处理器301、存储器302、移动通信模块303和无线通信模块304。Illustratively, FIG. 3 shows a structural diagram of a position tracker. The location tracker mainly includes: a processor 301, a memory 302, a mobile communication module 303, and a wireless communication module 304.
存储器302一般包括内存和外存。内存可以为随机存储器(random access memory,RAM)、双倍速率随机存储器(DDR RAM)、只读存储器(read only memory,ROM)或者高速缓存器(CACHE)等。外存可以为硬盘、光盘、通用串行总线(universal serial bus,USB)、闪存(FLASH)、软盘或磁带机等。存储器302用于存储计算机程序(包含各种固件、操作系统等)和其他数据。例如,在本申请实施例中,存储器302可以包括信息缓存模块3021、定位业务逻辑模块3022、“home区”判断模块3023,其中,信息缓存模块3021可用于保存历史 接入点参数信息。定位业务逻辑模块3022用于执行室内定位算法,对无线通信模块304所扫描得到的AP扫描结果进行处理,根据定位服务器返回的位置信息确定当前的位置,或者根据全球导航卫星系统(global navigation satellite system,GNSS)的采集结果确定当前的位置;“home区”判断模块3023用于判断无线通信模块304当前扫描得到的AP扫描结果与存储的历史接入点参数信息之间的相似度是否大于第一阈值。The memory 302 generally includes internal memory and external memory. The memory may be random access memory (RAM), double rate random access memory (DDR RAM), read only memory (ROM), or high-speed cache (CACHE). The external storage can be a hard disk, an optical disk, a universal serial bus (USB), a flash memory (FLASH), a floppy disk or a tape drive, etc. The memory 302 is used to store computer programs (including various firmware, operating systems, etc.) and other data. For example, in the embodiment of the present application, the memory 302 may include an information caching module 3021, a positioning service logic module 3022, and a "home area" determining module 3023. The information caching module 3021 may be used to store historical access point parameter information. The positioning service logic module 3022 is used to execute indoor positioning algorithms, process the AP scanning results scanned by the wireless communication module 304, and determine the current position according to the position information returned by the positioning server, or according to the global navigation satellite system (global navigation satellite system). , GNSS) to determine the current location; the "home zone" determining module 3023 is used to determine whether the similarity between the AP scan result currently scanned by the wireless communication module 304 and the stored historical access point parameter information is greater than the first Threshold.
处理器301用于读取存储器302中的计算机程序,然后执行各个模块定义的方法。例如,在本申请实施例中,处理器301可以执行定位业务逻辑模块3022和“home区”判断模块3023中定义的方法。The processor 301 is configured to read the computer program in the memory 302, and then execute the method defined by each module. For example, in the embodiment of the present application, the processor 301 may execute the methods defined in the positioning service logic module 3022 and the "home area" judgment module 3023.
可选的,处理器301可以包括一个或多个通用处理器,还可以包括一个或多个DSP(digital signal processor,数字信号处理器),用于执行相关操作,以实现本申请实施例所提供的室内定位方法。Optionally, the processor 301 may include one or more general-purpose processors, and may also include one or more DSPs (digital signal processors, digital signal processors), which are used to perform related operations to implement the methods provided in the embodiments of this application. Indoor positioning method.
移动通信模块303可以提供应用在位置追踪器上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块303可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块303可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块303还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块303的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块303的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。在本申请实施例中,移动通信模块303还可以用于与定位服务器进行信息交互,即向定位服务器发送无线信号源的扫描结果(扫描结果即第一接入点参数信息),以及从定位服务器获取位置信息。The mobile communication module 303 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the position tracker. The mobile communication module 303 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and so on. The mobile communication module 303 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 303 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 303 may be provided in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 303 and at least part of the modules of the processor 110 may be provided in the same device. In the embodiment of the present application, the mobile communication module 303 can also be used to exchange information with the positioning server, that is, to send the scanning result of the wireless signal source (the scanning result is the first access point parameter information) to the positioning server, and from the positioning server Get location information.
无线通信模块304可以提供应用在手机位置追踪器上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块304可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块304经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器301。无线通信模块304还可以从处理器301接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本申请实施例中,无线通信模块304,用于对电子设备周围的无线信号源进行扫描,获取第一接入点参数信息。The wireless communication module 304 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation applications that are used in mobile phone location trackers. Satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 304 may be one or more devices integrating at least one communication processing module. The wireless communication module 304 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 301. The wireless communication module 304 can also receive the signal to be sent from the processor 301, perform frequency modulation, amplify it, and convert it to electromagnetic wave radiation via the antenna 2. In this embodiment of the application, the wireless communication module 304 is configured to scan wireless signal sources around the electronic device to obtain the first access point parameter information.
可选的,该位置追踪器还可以包括:传感器、GPS、电源、天线等部件。Optionally, the location tracker may also include components such as sensors, GPS, power supply, and antenna.
本领域技术人员可以理解,图3中示出的位置追踪器的结构并不构成对位置追踪器的限定,本申请实施例提供的位置追踪器可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the position tracker shown in FIG. 3 does not constitute a limitation on the position tracker, and the position tracker provided in the embodiment of the present application may include more or less components than shown in the figure. Or combine certain components, or different component arrangements.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the present invention takes an Android system with a layered architecture as an example to exemplify the software structure of the electronic device 100.
图4是本发明实施例的电子设备100的软件结构框图。图4所示的软件架构是以安卓操作系统为例,该软件架构的软件模块和/或代码可以存储在内部存储器302中,当处理器301运行该软件模块或代码时,执行本申请实施例所提供的室内定位方法。FIG. 4 is a software structure block diagram of an electronic device 100 according to an embodiment of the present invention. The software architecture shown in FIG. 4 is based on the Android operating system as an example. The software modules and/or codes of the software architecture can be stored in the internal memory 302. When the processor 301 runs the software modules or codes, the embodiments of the present application are executed. The indoor positioning method provided.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接 口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图4所示,应用程序包可以包括电话、相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 4, the application package may include applications such as phone, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides application programming interfaces (application programming interface, API) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.
如图4所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 4, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。The content provider is used to store and retrieve data and make these data accessible to applications. The data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text and controls that display pictures. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)、融合守护进程(Fusion Daemon)和位置服务(location based service,LBS)等。The system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), fusion daemon (Fusion Daemon) and location based service (location based) service, LBS) etc.
融合守护进程,用于将内核层上报的信息通过基于位置服务通道上报至框架层。The fusion daemon is used to report the information reported by the kernel layer to the framework layer through the location-based service channel.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
2D图形引擎是2D绘图的绘图引擎。The 2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含传感器集(sensorhub)驱动、WiFi驱动 通信协议模块、显示屏驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least sensorhub driver, WiFi driver communication protocol module, and display driver.
传感器集(sensorhub)驱动,用于负责采集和传送传感器信息和GPS信息。The sensorhub driver is responsible for collecting and transmitting sensor information and GPS information.
WiFi驱动,用于负责采集各无线信号源的信息,例如各无线信号源的标识(例如AP的MAC地址)、各无线信号源的信号的特征参数(例如AP的RSSI)。The WiFi driver is responsible for collecting information of each wireless signal source, such as the identification of each wireless signal source (for example, the MAC address of the AP), and the characteristic parameters of the signal of each wireless signal source (for example, the RSSI of the AP).
通信协议模块,用于负责和调制解调器通信,采集小区信息,进行数据通信传输。The communication protocol module is used to communicate with the modem, collect community information, and perform data communication transmission.
从硬件角度来说,sensorhub驱动可以与无线通信模块304连接。比如,无线通信模块304检测到第一接入点参数信息,即AP的MAC地址和RSSI之后,将第一接入点参数信息发送给sensorhub驱动,sensorhub驱动将第一接入点参数信息上报至系统层。From a hardware perspective, the sensorhub driver can be connected to the wireless communication module 304. For example, after the wireless communication module 304 detects the first access point parameter information, that is, the MAC address and RSSI of the AP, it sends the first access point parameter information to the sensorhub driver, and the sensorhub driver reports the first access point parameter information to System layer.
内核层中还可以包括显示驱动,用于驱动显示屏显示信息。The kernel layer may also include a display driver for driving the display screen to display information.
如图5所示,为本申请实施例提供的一种室内定位方法,该方法由电子设备100执行,具体步骤如下。As shown in FIG. 5, an indoor positioning method provided by an embodiment of this application is executed by an electronic device 100. The specific steps are as follows.
步骤501,电子设备100对周围的无线信号源进行扫描,获取第一接入点参数信息。Step 501: The electronic device 100 scans the surrounding wireless signal sources to obtain first access point parameter information.
其中,触发电子设备100扫描周围的无线信号源的一种触发条件是:电子设备设置WiFi驱动的扫描周期,每当定时器时间到达时,触发WiFi驱动对周围的无线信号源进行扫描;另一种触发条件是:电子设备的处理器根据陀螺仪、加速度计、电子罗盘的检测结果,确定电子设备的位移达到设定距离(比如达到500m)时,触发WiFi驱动对周围的无线信号源进行扫描。Among them, one trigger condition for triggering the electronic device 100 to scan the surrounding wireless signal sources is: the electronic device sets the scan period of the WiFi driver, and whenever the timer expires, triggers the WiFi driver to scan the surrounding wireless signal sources; another A trigger condition is: the processor of the electronic device determines that the displacement of the electronic device reaches a set distance (for example, 500m) based on the detection results of the gyroscope, accelerometer, and electronic compass, and triggers the WiFi driver to scan the surrounding wireless signal sources .
示例性地,电子设备可以通过WiFi驱动扫描电子设备周围的AP,生成第一接入点参数信息,第一接入点参数信息可以包括至少一个AP的MAC地址和RSSI,或者第一接入点参数信息可以包括至少一个AP的SSID和RSSI,或者第一接入点参数信息可以包括至少一个AP的MAC地址、SSID和RSSI。示例性地,第一接入点参数信息如表1所示。Exemplarily, the electronic device may scan APs around the electronic device through WiFi driver to generate first access point parameter information, the first access point parameter information may include the MAC address and RSSI of at least one AP, or the first access point The parameter information may include the SSID and RSSI of at least one AP, or the first access point parameter information may include the MAC address, SSID, and RSSI of at least one AP. Exemplarily, the first access point parameter information is shown in Table 1.
表1Table 1
APAP MAC地址MAC address SSIDSSID RSSI(dBm)RSSI(dBm)
AP1AP1 74:C1:4F:BB:8C:A474:C1:4F:BB:8C:A4 TDIPTDIP -20-20
AP2AP2 74:C1:4F:BB:8C:A674:C1:4F:BB:8C:A6 HW-1HW-1 -22-twenty two
AP3AP3 74:C1:4F:BB:8C:AF74:C1:4F:BB:8C:AF HW-2HW-2 -25-25
从表1中可见,第一接入点参数信息包括扫描到的3个AP(AP1、AP2和AP3)的MAC地址、SSID、以及RSSI。AP1的MAC地址为74:C1:4F:BB:8C:A4,SSID是TDIP,RSSI为-20dBm;AP2的MAC地址为74:C1:4F:BB:8C:A6,SSID是HW-1,RSSI为-22dBm;AP3的MAC地址为74:C1:4F:BB:8C:AF,SSID是HW-2,RSSI为-25dBm。It can be seen from Table 1 that the first access point parameter information includes the MAC addresses, SSID, and RSSI of the scanned 3 APs (AP1, AP2, and AP3). AP1's MAC address is 74:C1:4F:BB:8C:A4, SSID is TDIP, RSSI is -20dBm; AP2's MAC address is 74:C1:4F:BB:8C:A6, SSID is HW-1, RSSI It is -22dBm; AP3's MAC address is 74:C1:4F:BB:8C:AF, SSID is HW-2, and RSSI is -25dBm.
步骤502,电子设备100确定第一接入点参数信息与存储的历史接入点参数信息之间的相似度。Step 502: The electronic device 100 determines the similarity between the first access point parameter information and the stored historical access point parameter information.
例如,电子设备100的存储器302中预先存储有包括历史接入点参数信息的数据库,该数据库可以如表2所示。For example, a database including historical access point parameter information is pre-stored in the memory 302 of the electronic device 100, and the database may be as shown in Table 2.
表2Table 2
apap MAC地址MAC address SSIDSSID RSSI(dBm)RSSI(dBm)
ap1ap1 74:C1:4F:BB:8C:A474:C1:4F:BB:8C:A4 TDIPTDIP -19-19
ap2ap2 74:C1:4F:BB:8C:A674:C1:4F:BB:8C:A6 HW-1HW-1 -20-20
ap3ap3 75:C1:4F:BB:8C:AF75:C1:4F:BB:8C:AF HW-8HW-8 -16-16
从表2中可见,历史接入点参数信息包括: ap1的MAC地址为74:C1:4F:BB:8C:A4,SSID是TDIP,RSSI为-19dBm; ap2的MAC地址为74:C1:4F:BB:8C:A6,SSID是HW-1,RSSI为-20dBm; ap3的MAC地址为75:C1:4F:BB:8C:AF,SSID是HW-8,RSSI为-16dBm。 It can be seen from Table 2 that the historical access point parameter information includes: The MAC address of ap1 is 74:C1:4F:BB:8C:A4, the SSID is TDIP, and the RSSI is -19dBm; the MAC address of ap2 is 74:C1:4F :BB:8C:A6, SSID is HW-1, RSSI is -20dBm; MAC address of ap3 is 75:C1:4F:BB:8C:AF, SSID is HW-8, RSSI is -16dBm.
具体地,电子设备100的“home区”判断模块3023可以通过以下两种方式计算第一接入点参数信息与历史接入点参数信息之间的相似度。Specifically, the "home zone" judgment module 3023 of the electronic device 100 can calculate the similarity between the first access point parameter information and the historical access point parameter information in the following two ways.
方式一method one
电子设备100从第一接入点参数信息与存储的历史接入点参数信息中,先确定出k个相同的目标MAC地址。然后电子设备根据第一接入点参数信息中目标MAC地址对应的RSSI和历史接入点参数信息中目标MAC地址对应的RSSI,计算第一接入点参数信息与存储的历史接入点参数信息之间的相似度。The electronic device 100 first determines k identical target MAC addresses from the first access point parameter information and the stored historical access point parameter information. Then the electronic device calculates the first access point parameter information and the stored historical access point parameter information according to the RSSI corresponding to the target MAC address in the first access point parameter information and the RSSI corresponding to the target MAC address in the historical access point parameter information The similarity between.
具体地,针对第一接入点参数信息和历史接入点参数信息中同一MAC地址对应的RSSI,,电子设备可以计算两个RSSI之间的欧氏距离(英文:Euclidean Metric)或者曼哈顿距离(英文:Manhattan Distance),从而根据欧氏距离或者曼哈顿距离得到相似度。需要说明的是,欧氏距离或曼哈顿距离越小,相似度越大。所以相似度越小,表示第一接入点参数信息和历史接入点参数信息越相似。Specifically, for the RSSI corresponding to the same MAC address in the first access point parameter information and the historical access point parameter information, the electronic device can calculate the Euclidean distance (English: Euclidean Metric) or Manhattan distance ( English: Manhattan Distance) to get the similarity based on Euclidean distance or Manhattan distance. It should be noted that the smaller the Euclidean distance or Manhattan distance, the greater the similarity. Therefore, the smaller the similarity is, the more similar the first access point parameter information and the historical access point parameter information are.
例如,从表1和表2可见,第一接入点参数信息与存储的历史接入点参数信息中的AP1和 ap1的MAC地址74:C1:4F:BB:8C:A4相同,AP2和 ap2的MAC地址74:C1:4F:BB:8C:A4相同,所以有两个相同的MAC地址。针对第一接入点参数信息中MAC地址74:C1:4F:BB:8C:A4对应的RSSI-20dBm,以及历史接入点参数信息中MAC地址74:C1:4F:BB:8C:A4对应的RSSI-19dBm,电子设备可以计算两个RSSI之间的欧氏距离。另外,针对第一接入点参数信息中MAC地址74:C1:4F:BB:8C:A6对应的RSSI-22dBm,以及历史接入点参数信息中MAC地址74:C1:4F:BB:8C:A6对应的RSSI-20dBm,电子设备可以计算两个RSSI之间的欧氏距离。最终,电子设备根据两个欧氏距离,确定出第一接入点参数信息和历史接入点参数信息之间的相似度。 For example, it can be seen from Table 1 and Table 2 that the first access point parameter information is the same as the MAC addresses 74:C1:4F:BB:8C:A4 of AP1 and ap1 in the stored historical access point parameter information, AP2 and ap2 The MAC address 74:C1:4F:BB:8C:A4 is the same, so there are two same MAC addresses. For the RSSI-20dBm corresponding to the MAC address 74:C1:4F:BB:8C:A4 in the first access point parameter information, and the MAC address 74:C1:4F:BB:8C:A4 in the historical access point parameter information With RSSI-19dBm, the electronic device can calculate the Euclidean distance between two RSSIs. In addition, for the RSSI-22dBm corresponding to the MAC address 74:C1:4F:BB:8C:A6 in the first access point parameter information, and the MAC address 74:C1:4F:BB:8C in the historical access point parameter information: A6 corresponds to the RSSI-20dBm, and the electronic device can calculate the Euclidean distance between two RSSIs. Finally, the electronic device determines the similarity between the first access point parameter information and the historical access point parameter information according to the two Euclidean distances.
方式二Way two
电子设备从第一接入点参数信息与存储的历史接入点参数信息中,先确定出k个相同的MAC地址,如果k大于0,则计算历史接入点参数信息中的MAC地址和第一接入点参数信息中的MAC地址取并集,得到并集的元素总数M(即MAC地址总数),相似度S等于
Figure PCTCN2020097887-appb-000005
如果S≤第一阈值,则表征两次扫描结果相似,如果S>第一阈值,则表征两次扫描结果不相似,其中,第一阈值可根据实际测试进行调整。
The electronic device first determines k identical MAC addresses from the first access point parameter information and the stored historical access point parameter information. If k is greater than 0, it calculates the MAC address and the first in the historical access point parameter information. Take the union of the MAC addresses in the parameter information of an access point to obtain the total number of elements M of the union (ie the total number of MAC addresses), and the similarity S is equal to
Figure PCTCN2020097887-appb-000005
If S≦the first threshold, it means that the results of the two scans are similar. If S>the first threshold, it means that the results of the two scans are not similar. The first threshold can be adjusted according to actual tests.
示例性地,从表1和表2可见,第一接入点参数信息与存储的历史接入点参数信息中的AP1和 ap1的MAC地址74:C1:4F:BB:8C:A4相同,AP2和 ap2的MAC地址74:C1:4F:BB:8C:A4相同,所以有两个相同的MAC地址。第一接入点参数信息和历史接入点参数信息中共有4个不同的MAC地址,MAC地址的总数为4,所以相似度等于
Figure PCTCN2020097887-appb-000006
假设第一阈值为0.3,则相似度0.5大于0.3,所以表征两次扫描结果不相似。
Exemplarily, it can be seen from Table 1 and Table 2 that the first access point parameter information is the same as the MAC addresses 74:C1:4F:BB:8C:A4 of AP1 and ap1 in the stored historical access point parameter information, AP2 It is the same as ap2 's MAC address 74:C1:4F:BB:8C:A4, so there are two identical MAC addresses. There are 4 different MAC addresses in the first access point parameter information and historical access point parameter information. The total number of MAC addresses is 4, so the similarity is equal to
Figure PCTCN2020097887-appb-000006
Assuming that the first threshold is 0.3, the similarity 0.5 is greater than 0.3, so the two scan results are not similar.
步骤503,当相似度大于第一阈值时,电子设备100向定位服务器200上报第一接入点参数信息。Step 503: When the similarity is greater than the first threshold, the electronic device 100 reports the first access point parameter information to the positioning server 200.
具体地,当“home区”判断模块3023确定相似度大于第一阈值时,电子设备通过移动通信模块303向定位服务器200发送报文,该报文包括第一接入点参数信息。Specifically, when the "home zone" judgment module 3023 determines that the similarity is greater than the first threshold, the electronic device sends a message to the positioning server 200 through the mobile communication module 303, the message including the first access point parameter information.
可选地,该室内定位方法还可以包括步骤504,当相似度小于或等于第一阈值时,电子设备丢弃第一接入点参数信息。也就是说,电子设备不向定位服务器上报第一接入点参数信息。Optionally, the indoor positioning method may further include step 504, when the similarity is less than or equal to the first threshold, the electronic device discards the first access point parameter information. That is, the electronic device does not report the first access point parameter information to the positioning server.
步骤505,定位服务器200根据第一接入点参数信息确定出电子设备100的位置信息。Step 505: The positioning server 200 determines the location information of the electronic device 100 according to the first access point parameter information.
具体地,定位服务器200可以利用定位算法,根据第一接入点参数信息确定出电子设备100的位置信息。目前基于WiFi的定位算法有很多,常用的定位算法有指纹定位算法和三角定位算法。Specifically, the positioning server 200 may use a positioning algorithm to determine the position information of the electronic device 100 according to the first access point parameter information. There are currently many WiFi-based positioning algorithms, and the commonly used positioning algorithms include fingerprint positioning algorithms and triangulation positioning algorithms.
一方面,当定位服务器200采用指纹定位算法时,定位服务器200将电子设备100发送的第一接入点参数信息与接入点参数信息数据库中的参考接入点参数信息进行匹配,确定出匹配度满足条件的一个或多个参考接入点参数信息,最终定位服务器根据确定出的一个或多个参考接入点参数信息对应的位置信息确定出电子设备的位置信息。On the one hand, when the positioning server 200 uses a fingerprint positioning algorithm, the positioning server 200 matches the first access point parameter information sent by the electronic device 100 with the reference access point parameter information in the access point parameter information database, and determines the match According to the one or more reference access point parameter information that satisfies the condition, the positioning server determines the location information of the electronic device according to the determined location information corresponding to the determined one or more reference access point parameter information.
需要说明的是,定位服务器中预先保存有接入点参数信息数据库,该接入点参数信息数据库是由多个位置的位置信息(如GPS坐标)以及该多个位置的接入点参数信息所形成的。示例性地,接入点参数信息数据库如表3所示。It should be noted that the access point parameter information database is pre-stored in the positioning server, and the access point parameter information database is composed of the location information (such as GPS coordinates) of multiple locations and the access point parameter information of the multiple locations. Forming. Exemplarily, the access point parameter information database is shown in Table 3.
表3table 3
Figure PCTCN2020097887-appb-000007
Figure PCTCN2020097887-appb-000007
从表2可见,位置1的位置信息为(X1,Y1),位置1的接入点参数信息为(MAC1,RSSI1),(MAC3,RSSI2),(MAC4,RSSI3)等;位置2的位置信息为(X2,Y2),位置2的接入点参数信息为(MAC1,RSSI4),(MAC2,RSSI5),(MAC4,RSSI6)等;位置3的位置信息为(X3,Y3)等,位置3的接入点参数信息为(MAC1,RSSI7),(MAC2,RSSI8),(MAC3,RSSI9)等。As can be seen from Table 2, the location information of location 1 is (X1, Y1), the access point parameter information of location 1 is (MAC1, RSSI1), (MAC3, RSSI2), (MAC4, RSSI3), etc.; the location information of location 2 Is (X2, Y2), the access point parameter information of position 2 is (MAC1, RSSI4), (MAC2, RSSI5), (MAC4, RSSI6), etc.; the position information of position 3 is (X3, Y3), etc., position 3 The access point parameter information is (MAC1, RSSI7), (MAC2, RSSI8), (MAC3, RSSI9), etc.
另一方面,定位服务器200根据第一接入点参数信息,利用信号衰减模型估算出电子设备100与各个AP(AP的位置已知)之间的距离,然后根据电子设备100和周围AP的距离画圆,其交点就是该电子设备的位置。On the other hand, the positioning server 200 uses the signal attenuation model to estimate the distance between the electronic device 100 and each AP (where the location of the AP is known) according to the first access point parameter information, and then according to the distance between the electronic device 100 and the surrounding APs Draw a circle, and the intersection point is the position of the electronic device.
需要说明的是,电子设备基于WIFI进行室内定位时,更多采用指纹定位算法,原因在于该算法不需要提前获取所有AP的位置,即便AP位置或状态的发生改变,也仍然适用。It should be noted that when electronic devices perform indoor positioning based on WIFI, fingerprint positioning algorithms are often used. The reason is that the algorithm does not need to obtain the positions of all APs in advance, and it is still applicable even if the positions or states of APs change.
步骤506,定位服务器200向电子设备100发送该位置信息。Step 506: The positioning server 200 sends the position information to the electronic device 100.
在一种可能的实施例中,当电子设备100收到该位置信息后,可以在触摸屏的显示界面上显示包括该位置信息的定位结果,或者可以更新地图应用的显示界面。In a possible embodiment, after the electronic device 100 receives the location information, it may display the positioning result including the location information on the display interface of the touch screen, or may update the display interface of the map application.
在一种可能的实施例中,在电子设备100向定位服务器200上报第一接入点参数信息之后,电子设备100会将第一接入点参数信息作为历史接入点参数信息保存至电子设备100的数据库中,以便于电子设备100后续计算相似度。In a possible embodiment, after the electronic device 100 reports the first access point parameter information to the positioning server 200, the electronic device 100 saves the first access point parameter information as historical access point parameter information to the electronic device In the database of 100, the electronic device 100 can subsequently calculate the similarity.
以下以电子设备100是宠物佩戴的位置追踪器为例,对上述室内定位方法进行举例说明。The following takes the electronic device 100 as an example of a position tracker worn by a pet to illustrate the indoor positioning method described above.
示例性地,如图6所示,假设佩戴位置追踪器的宠物在第一时刻所处位置为图6所示大楼内的位置A,位置追踪器扫描该位置A周围的AP,在第一时刻生成接入点参数信息1,该接入点参数信息1包括三个AP的MAC地址和RSSI。位置追踪器计算接入点参数信息1与历史接入点参数信息之间的相似度大于第一阈值,因此向定位服务器200上报接入点参数信息1,并利用接入点参数信息1替换信息缓存模块3021中的历史接入点参数信息。Illustratively, as shown in Fig. 6, suppose that the pet wearing the position tracker is at the position A in the building shown in Fig. 6 at the first moment, and the position tracker scans the APs around the position A. At the first moment Generate access point parameter information 1. The access point parameter information 1 includes the MAC addresses and RSSI of the three APs. The location tracker calculates that the similarity between the access point parameter information 1 and the historical access point parameter information is greater than the first threshold, so it reports the access point parameter information 1 to the positioning server 200, and replaces the information with the access point parameter information 1 Cache the historical access point parameter information in the module 3021.
在第二时刻,宠物从图6所示的位置A移动到位置B处,位置追踪器扫描位置B周围的AP,在第二时刻生成接入点参数信息2,该接入点参数信息2包括三个AP的MAC地址和RSSI。位置追踪器的处理器301采用上述室内定位算法计算接入点参数信息2与接入点参数信息1之间的相似度小于第一阈值,因此位置追踪器丢弃该接入点参数信息2,即不上报接入点参数信息2。At the second moment, the pet moves from location A to location B as shown in FIG. 6, the location tracker scans APs around location B, and at the second moment, access point parameter information 2 is generated, and the access point parameter information 2 includes The MAC addresses and RSSI of the three APs. The processor 301 of the location tracker uses the aforementioned indoor positioning algorithm to calculate that the similarity between the access point parameter information 2 and the access point parameter information 1 is less than the first threshold, so the location tracker discards the access point parameter information 2, namely Do not report access point parameter information 2.
再比如,在第三时刻,该宠物从图6所示的位置B移动到公园的位置C处,位置追踪器扫描位置C周围的AP,在第三时刻生成接入点参数信息3,该接入点参数信息3包括三个AP的MAC地址和RSSI。位置追踪器的处理器301采用上述室内定位算法计算接入点参数信息3与接入点参数信息1之间的相似度大于第一阈值,因此位置追踪器通过移动通信模块303将接入点参数信息3上报至定位服务器200。并且位置追踪器利用接入点参数信息3替换信息缓存模块3021中的历史接入点参数信息(即接入点参数信息1)。For another example, at the third moment, the pet moves from location B shown in FIG. 6 to location C in the park, and the location tracker scans APs around location C, and at the third moment, access point parameter information 3 is generated. The entry point parameter information 3 includes the MAC addresses and RSSI of the three APs. The processor 301 of the location tracker uses the aforementioned indoor positioning algorithm to calculate that the similarity between the access point parameter information 3 and the access point parameter information 1 is greater than the first threshold, so the location tracker uses the mobile communication module 303 to calculate the access point parameters Information 3 is reported to the positioning server 200. And the location tracker uses the access point parameter information 3 to replace the historical access point parameter information in the information caching module 3021 (ie, the access point parameter information 1).
本申请实施例以下将结合图7,对本申请实施例提供的室内定位方法进行系统阐述,具体步骤如下。The embodiments of the present application will systematically explain the indoor positioning method provided by the embodiments of the present application in conjunction with FIG. 7, and the specific steps are as follows.
步骤701,电子设备100接收定位请求后,对周围的无线信号源进行扫描。Step 701: After receiving the positioning request, the electronic device 100 scans the surrounding wireless signal sources.
例如,电子设备100为位置追踪器,当位置追踪器中设置的定时器时间到达时,触发位置追踪器开始对周围的无线信号源进行扫描。For example, the electronic device 100 is a location tracker, and when the timer set in the location tracker expires, the location tracker is triggered to start scanning the surrounding wireless signal sources.
步骤702,电子设备100确定电子设备100的“home区”标志位是否被置位(例如置为1)。若否,则执行步骤703,若是,则执行步骤704。In step 702, the electronic device 100 determines whether the "home zone" flag of the electronic device 100 is set (for example, set to 1). If not, go to step 703, and if yes, go to step 704.
需要说明的是,“home区”指示电子设备所处环境中无线信号源基本无变化的状态。“home区”标志位被置位(例如被置为1)表示电子设备处于“home区”,电子设备优先采用本申请实施例提供的室内定位方法进行定位;“home区”标志位没有被置位(例如为0)表示电子设备不处于“home区,电子设备优先执行室外定位算法。可见,电子设备可以根据“home区”标志位准确确定与之对应的定位方法,有效地对电子设备进行定位,既可以保证定位结果的准确度,又可以一定程度上节省在定位过程中电子设备所消耗的功耗。It should be noted that the "home zone" indicates a state where the wireless signal source in the environment where the electronic device is located is basically unchanged. The "home zone" flag is set (for example, set to 1) that the electronic device is in the "home zone", and the electronic device preferentially uses the indoor positioning method provided in the embodiment of this application for positioning; the "home zone" flag is not set Bit (for example, 0) indicates that the electronic device is not in the "home zone, and the electronic device first executes the outdoor positioning algorithm. It can be seen that the electronic device can accurately determine the corresponding positioning method according to the "home zone" flag, and effectively perform the electronic device Positioning can not only ensure the accuracy of the positioning result, but also save the power consumption of the electronic device in the positioning process to a certain extent.
例如,位置追踪器位于图6所示的位置B时,位置追踪器计算接入点参数信息2与接入点参数信息1之间的相似度小于第一阈值时,将“home区”标志位从0置为1。当位置追踪器位于图6所示的位置B移动至位置C时,电子设备先判断“home区”标志位是否为1,若是,则执行步骤703,否则执行步骤704。For example, when the location tracker is located at location B shown in Figure 6, when the location tracker calculates that the similarity between the access point parameter information 2 and the access point parameter information 1 is less than the first threshold, the "home zone" flag is set Set from 0 to 1. When the position tracker is located at the position B shown in FIG. 6 and moved to the position C, the electronic device first determines whether the "home zone" flag is 1, if it is, then executes step 703; otherwise, executes step 704.
步骤703,当电子设备100确定“home区”标志位没有被置位(例如仍为0)时,电子设备100优先执行室外定位算法,例如电子设备100可以采用全球定位技术(global positioning system,GPS)进行定位。Step 703: When the electronic device 100 determines that the "home zone" flag is not set (for example, it is still 0), the electronic device 100 preferentially executes the outdoor positioning algorithm. For example, the electronic device 100 may adopt global positioning system (GPS) ) For positioning.
步骤704,当电子设备100确定“home区”标志位被置位(例如被置为1)时,电子设备优先采用本申请实施例提供的室内定位方法进行定位,即电子设备100的处理器先向WiFi驱动发送扫描指令,WiFi驱动对周围的无线信号源进行扫描,获取第一接入点参数信息。Step 704: When the electronic device 100 determines that the "home zone" flag is set (for example, it is set to 1), the electronic device preferentially uses the indoor positioning method provided in this embodiment of the application for positioning, that is, the processor of the electronic device 100 first Send a scan instruction to the WiFi driver, and the WiFi driver scans the surrounding wireless signal sources to obtain the first access point parameter information.
步骤705,电子设备100的处理器计算第一接入点参数信息与历史接入点参数信息之间 的相似度。Step 705: The processor of the electronic device 100 calculates the similarity between the first access point parameter information and the historical access point parameter information.
其中,具体计算过程包括如下步骤。Among them, the specific calculation process includes the following steps.
步骤a,电子设备100先从第一接入点参数信息与存储的历史接入点参数信息中,先确定出k个相同的MAC地址。Step a: The electronic device 100 first determines k identical MAC addresses from the first access point parameter information and stored historical access point parameter information.
步骤b,电子设备100从第一接入点参数信息中获取k个相同的MAC地址对应的第一RSSI集合,以及从历史接入点参数信息中获取k个相同的MAC地址对应的第二RSSI集合。Step b. The electronic device 100 obtains the first RSSI set corresponding to k identical MAC addresses from the first access point parameter information, and obtains the second RSSI corresponding to k identical MAC addresses from the historical access point parameter information set.
步骤c,由于RSSI为-50dBm类似的数值,不便于计算,电子设备100将第一RSSI集合和第二RSSI集合进行归一化处理,得到归一化后的第一RSSI集合和归一化后的第二RSSI集合。也就是说,一方面,电子设备100将第一RSSI集合进行归一化处理,得到的归一化后的第一RSSI符合下述公式要求:Step c, since the RSSI is a similar value of -50dBm, which is not convenient for calculation, the electronic device 100 normalizes the first RSSI set and the second RSSI set to obtain the normalized first RSSI set and the normalized RSSI set The second RSSI collection. That is, on the one hand, the electronic device 100 performs normalization processing on the first RSSI set, and the obtained first RSSI after normalization meets the requirements of the following formula:
Figure PCTCN2020097887-appb-000008
Figure PCTCN2020097887-appb-000008
其中,B i表示归一化后的第一RSSI集合中的第i个RSSI;b i为归一化之前的第一RSSI集合中的第i个RSSI,其中i的取值是从1到k; Among them, B i represents the i-th RSSI in the first RSSI set after normalization; b i is the i-th RSSI in the first RSSI set before normalization, where the value of i is from 1 to k ;
另一方面,电子设备100将第二RSSI集合进行归一化处理,得到的归一化后的k个第二RSSI符合下述公式要求:On the other hand, the electronic device 100 performs normalization processing on the second RSSI set, and the obtained normalized k second RSSIs meet the requirements of the following formula:
Figure PCTCN2020097887-appb-000009
Figure PCTCN2020097887-appb-000009
其中,A i表示归一化后的第二RSSI集合中的第i个RSSI;a i为归一化之前的第二RSSI集合中的第i个RSSI,其中i的取值是从1到k。 Among them, A i represents the i-th RSSI in the second RSSI set after normalization; a i is the i-th RSSI in the second RSSI set before normalization, and the value of i is from 1 to k .
步骤d,电子设备100根据归一化后的第一RSSI集合和归一化后的第二RSSI集合,计算相似度,该相似度符合下述公式要求:Step d, the electronic device 100 calculates the similarity according to the normalized first RSSI set and the normalized second RSSI set, and the similarity meets the requirements of the following formula:
Figure PCTCN2020097887-appb-000010
Figure PCTCN2020097887-appb-000010
其中,k表示相同的MAC地址的个数,Num表示历史接入点参数信息中的MAC地址和第一接入点参数信息中的MAC地址取并集,得到并集的元素总数(即MAC地址总数),向量B为中归一化后的第一RSSI集合,B i表示归一化后的第一RSSI集合中的第i个RSSI,向量A为中归一化后的第二RSSI集合,A i表示归一化后的第二RSSI集合中的第i个RSSI,S表示相似度,i的取值从1到k,其中,B i和A i为同一MAC地址的RSSI。 Among them, k represents the number of the same MAC address, and Num represents the union of the MAC address in the historical access point parameter information and the MAC address in the first access point parameter information to obtain the total number of elements of the union (ie the MAC address Total), vector B is the first normalized RSSI set, B i represents the i-th RSSI in the first normalized RSSI set, vector A is the second normalized RSSI set, A i represents the i-th RSSI in the second normalized RSSI set, S represents the similarity, and the value of i ranges from 1 to k, where B i and A i are RSSIs of the same MAC address.
上述实施例中,电子设备100先对RSSI进行归一化处理,可以便于计算相似度,因上述算法中综合考虑了每个相同的MAC地址所对应的两个RSSI之间的欧式距离,所以最终计算得到的相似度的准确性和可信度较高。In the above embodiment, the electronic device 100 first normalizes the RSSI, which can facilitate the calculation of the similarity. Because the above algorithm comprehensively considers the Euclidean distance between the two RSSIs corresponding to each same MAC address, so finally The calculated similarity is more accurate and reliable.
步骤706,电子设备100的处理器判断相似度小于或等于第一阈值时,执行步骤707,当大于第一阈值时,执行步骤708。In step 706, when the processor of the electronic device 100 determines that the similarity is less than or equal to the first threshold, step 707 is executed, and when it is greater than the first threshold, step 708 is executed.
其中,第一阈值是根据经验设置的,例如第一阈值是0.1,处理器判断相似度S是否大于0.1。The first threshold is set based on experience, for example, the first threshold is 0.1, and the processor determines whether the similarity S is greater than 0.1.
示例性地,当位置追踪器从图6所述的位置B移动至位置C时,位置追踪器计算相似度大于第一阈值,因此执行步骤708。当位置追踪器从图6所述的位置B移动至位置A时,位置追踪器计算相似度小于第一阈值,因此执行步骤707。Exemplarily, when the position tracker moves from the position B to the position C described in FIG. 6, the position tracker calculates that the similarity is greater than the first threshold, so step 708 is executed. When the position tracker moves from the position B to the position A as shown in FIG. 6, the position tracker calculates that the similarity is less than the first threshold, so step 707 is executed.
步骤707,当相似度小于或等于第一阈值时,电子设备100不上报该第一接入点参数信息。Step 707: When the similarity is less than or equal to the first threshold, the electronic device 100 does not report the first access point parameter information.
示例性,当位置追踪器从图6所述的位置B移动至位置A时,位置追踪器计算相似度小于第一阈值,因此仍维持“home区”标志位为1,并且不上报位置追踪器在位置A处扫描得到的接入点参数信息。For example, when the position tracker moves from position B to position A as shown in FIG. 6, the similarity calculated by the position tracker is less than the first threshold, so the "home zone" flag is still maintained at 1, and the position tracker is not reported Access point parameter information obtained by scanning at location A.
步骤708,当相似度大于第一阈值时,电子设备100清除当前的“home区”标志位(例如从1置为0),然后向定位服务器200上报第一接入点参数信息。Step 708: When the similarity is greater than the first threshold, the electronic device 100 clears the current “home zone” flag (for example, resets it from 1 to 0), and then reports the first access point parameter information to the positioning server 200.
示例性地,当位置追踪器从图6所述的位置B移动至位置C时,位置追踪器计算相似度大于第一阈值,位置追踪器将当前的“home区”标志位从1置为0,并向定位服务器200上报接入点参数信息3。Exemplarily, when the position tracker moves from position B to position C as shown in FIG. 6, the position tracker calculates that the similarity is greater than the first threshold, and the position tracker sets the current "home zone" flag from 1 to 0 , And report access point parameter information 3 to the positioning server 200.
步骤709,电子设备100利用第一接入点参数信息替换信息缓存模块3021中的历史接入点参数信息,以便于下次相似度的计算。In step 709, the electronic device 100 replaces the historical access point parameter information in the information caching module 3021 with the first access point parameter information, so as to facilitate the calculation of the similarity next time.
步骤710,电子设备100从定位服务器200获取位置信息,生成定位结果。Step 710: The electronic device 100 obtains location information from the positioning server 200, and generates a positioning result.
其中,定位服务器200可以将电子设备发送的第一接入点参数信息与接入点参数信息数据库中的参考接入点参数信息进行匹配,确定出匹配度满足条件的一个或多个参考接入点参数信息,最终定位服务器根据确定出的一个或多个参考接入点参数信息对应的位置信息确定出电子设备的位置信息。然后电子设备接收来自定位服务器发送的位置信息。Wherein, the positioning server 200 may match the first access point parameter information sent by the electronic device with the reference access point parameter information in the access point parameter information database, and determine one or more reference access points whose matching degree meets the condition. Point parameter information, and finally the positioning server determines the location information of the electronic device according to the determined location information corresponding to the determined one or more reference access point parameter information. Then the electronic device receives the location information sent from the positioning server.
在一种可能的实施例中,电子设备100可以先从定位服务器200获取接入点参数信息数据库,然后电子设备100以历史接入点参数信息对应的位置为中心点,以设定距离为半径确定一个立体空间区域,从接入点参数信息数据库中确定出位置信息落在该立体空间区域中的目标位置,并确定由所有目标位置对应的接入点参数信息构成的接入点参数信息集合。当电子设备获取到第一接入点参数信息之后,可以计算第一接入点参数信息与接入点参数信息集合的每个接入点参数信息的相似度,当相似度大于第一阈值时,才向定位服务器上报第一接入点参数信息,否则不上报,该方法有助于节省功耗。In a possible embodiment, the electronic device 100 may first obtain the access point parameter information database from the positioning server 200, and then the electronic device 100 takes the position corresponding to the historical access point parameter information as the center point, and takes the set distance as the radius. Determine a three-dimensional space area, determine the target location in the three-dimensional space area where the position information falls from the access point parameter information database, and determine the access point parameter information set composed of access point parameter information corresponding to all target locations . After the electronic device obtains the first access point parameter information, it can calculate the similarity between the first access point parameter information and each access point parameter information in the access point parameter information set, and when the similarity is greater than the first threshold , The first access point parameter information is reported to the positioning server, otherwise it is not reported. This method helps to save power consumption.
示例性地,如图6所示,电子设备100的使用用户从位置B移动至位置C时,电子设备在位置C扫描得到接入点参数信息3,当接入点参数信息3与电子设备在位置B上报的历史接入点参数信息对应的接入点参数信息集合中的每个接入点参数信息的相似度均大于第一阈值时,电子设备100才向定位服务器200上报该接入点参数信息3。Exemplarily, as shown in FIG. 6, when the user of the electronic device 100 moves from location B to location C, the electronic device scans at location C to obtain access point parameter information 3, and when the access point parameter information 3 is in contact with the electronic device Only when the similarity of each access point parameter information in the access point parameter information set corresponding to the historical access point parameter information reported by location B is greater than the first threshold, the electronic device 100 reports the access point to the positioning server 200 Parameter information 3.
在一种可能的实施例中,电子设备100还可以预先从定位服务器200获取接入点参数信息数据库,电子设备100将接入点参数信息与接入点参数信息数据库中的参考接入点参数信息进行匹配,确定出匹配度满足条件的一个或多个参考接入点参数信息,根据确定出的一个或多个参考接入点参数信息对应的位置信息确定出电子设备100的位置信息。如果电子设备100无法根据接入点参数信息数据库确定出电子设备的位置信息,则向定位服务器200上报该第一接入点参数信息,该方法有助于节省功耗。In a possible embodiment, the electronic device 100 may also obtain the access point parameter information database from the positioning server 200 in advance, and the electronic device 100 compares the access point parameter information with the reference access point parameter in the access point parameter information database. The information is matched, one or more reference access point parameter information whose matching degree meets the condition are determined, and the location information of the electronic device 100 is determined according to the location information corresponding to the determined one or more reference access point parameter information. If the electronic device 100 cannot determine the location information of the electronic device according to the access point parameter information database, it reports the first access point parameter information to the positioning server 200, which helps to save power consumption.
在一种可能的实施例中,电子设备获取接入点参数信息数据的方式可以如下多种实现方式。In a possible embodiment, the manner in which the electronic device obtains the access point parameter information data may be implemented in the following multiple manners.
第一种实现方式,电子设备可以从定位服务器下载该电子设备当前所处的区域范围对应的接入点参数信息数据库。其中,电子设备当前所处的区域范围可以是当前所的处小区或者城市等。In the first implementation manner, the electronic device can download the access point parameter information database corresponding to the area range where the electronic device is currently located from the positioning server. Among them, the current area of the electronic device may be the current cell or city.
举例来说,电子设备可以向定位服务器发送请求时,请求中携带小区信息或城市信息,定位服务器基于该请求确定接入点参数信息数据库,向电子设备发送该接入点参数信息数据 库。For example, when the electronic device sends a request to the positioning server, the request carries cell information or city information, and the positioning server determines an access point parameter information database based on the request, and sends the access point parameter information database to the electronic device.
示例性的,电子设备可以周期性发送请求,或者,在用户触发的情况下发送请求(比如,触发启动服务推送功能的情况下),或者,电子设备检测到当前所处的城市信息发生变化时,向定位服务器上报城市信息,然后接收服务器发送的与所述城市信息对应的接入点参数信息数据库,或者,电子设备检测到驻留小区发生变化时,向定位服务器上报切换后的驻留小区的信息,然后接收定位服务器发送的与该驻留小区对应的接入点参数信息数据库。Exemplarily, the electronic device may send the request periodically, or send the request when triggered by the user (for example, when the service push function is triggered), or when the electronic device detects that the current city information has changed , Report the city information to the positioning server, and then receive the access point parameter information database corresponding to the city information sent by the server, or, when the electronic device detects a change in the camping cell, report the handover camping cell to the positioning server And then receive the access point parameter information database corresponding to the camping cell sent by the positioning server.
第二种实现方式,定位服务器可以主动将接入点参数信息数据库发送给电子设备。比如,定位服务器确定电子设备上一次下载过的接入点参数信息数据库已发生过更新后,可以主动将更新后的接入点参数信息数据库发送给电子设备。In the second implementation manner, the positioning server can actively send the access point parameter information database to the electronic device. For example, after the positioning server determines that the access point parameter information database downloaded last time by the electronic device has been updated, it can actively send the updated access point parameter information database to the electronic device.
示例性的,定位服务器可以搜集每个电子设备上报的接入点参数信息和地理位置,然后根据上报的地理位置信息,确定接入点的位置信息,然后形成接入点参数信息数据库,下发到电子设备。Exemplarily, the positioning server may collect the access point parameter information and geographic location reported by each electronic device, and then determine the location information of the access point according to the reported geographic location information, and then form an access point parameter information database, and issue To the electronic device.
第三种实现方式,接入点参数信息数据库还可以是电子设备自己统计的。比如,电子设备可以在每接入到一个WiFi接入点后,可以记录地理位置信息,然后构建WiFi接入点和地理位置信息之间的对应关系,得到接入点参数信息数据库。In the third implementation manner, the access point parameter information database may also be calculated by the electronic device itself. For example, the electronic device may record geographic location information after each access to a WiFi access point, and then construct a correspondence between the WiFi access point and geographic location information to obtain an access point parameter information database.
本申请实施例中,电子设备利用上述定位方法可以有效地降低WiFi室内定位过程中与定位服务器数据传输交互所消耗的功耗,从而提升了产品的续航能力。In the embodiment of the present application, the electronic device using the above positioning method can effectively reduce the power consumption consumed by the data transmission interaction with the positioning server during the WiFi indoor positioning process, thereby improving the endurance of the product.
为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In order to realize the functions in the methods provided in the above embodiments of the present application, the electronic device may include a hardware structure and/or a software module, and realize the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed in a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraint conditions of the technical solution.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行图5、图7所示的实施例中的一个或多个步骤,以实现上述实施例中的方法。This embodiment also provides a computer storage medium. The computer storage medium stores computer instructions. When the computer instructions run on an electronic device, the electronic device executes one or the other of the embodiments shown in FIG. 5 and FIG. Multiple steps to implement the method in the above embodiment.
本实施例还提供了一种程序产品,当该程序产品在计算机上运行时,使得计算机执行图5、图7所示的实施例中的一个或多个步骤,以实现上述实施例中的方法。This embodiment also provides a program product. When the program product runs on a computer, the computer executes one or more steps in the embodiment shown in FIG. 5 and FIG. 7 to implement the method in the above embodiment. .
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行图5或图7所示的实施例中的一个或多个步骤,以实现上述实施例中的方法。In addition, the embodiments of the present application also provide a device. The device may specifically be a chip, component or module. The device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions. When the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes one or more steps in the embodiment shown in FIG. 5 or FIG. 7 to implement the method in the foregoing embodiment.
其中,本实施例提供的电子设备、计算机存储介质、程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic device, computer storage medium, program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding method provided above The beneficial effects in the process will not be repeated here.
本申请实施例中的电子设备还可以是手机(mobile phone)、平板电脑(pad)、具备无线通讯功能的可穿戴设备(如智能手表)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线设备、无人驾驶(self driving)中的无线设备、远程医疗(remote medical)中的无线设备、智能电网(smart grid)中的无线设备、运输安全(transportation safety)中的无线设备、智慧城市(smart city)中的无线设备、智慧家庭(smart home)中的无线设备等等。The electronic devices in the embodiments of the present application may also be mobile phones, tablets, wearable devices with wireless communication functions (such as smart watches), computers with wireless transmission and reception functions, and virtual reality (virtual reality, VR) equipment, augmented reality (AR) equipment, industrial control (industrial control) wireless equipment, unmanned driving (self-driving) wireless equipment, remote medical (remote medical) wireless equipment, smart grid Wireless devices in (smart grid), wireless devices in transportation safety, wireless devices in smart cities, wireless devices in smart homes, and so on.
以电子设备100是手机为例,图8示出了手机100的结构示意图。Taking the electronic device 100 as a mobile phone as an example, FIG. 8 shows a schematic structural diagram of the mobile phone 100.
手机100可以包括处理器110,外部存储器接口120,内部存储器121,USB接口130, 充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块151,无线通信模块152,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及SIM卡接口195等。其中传感器模块180可以包括陀螺仪传感器180A,加速度传感器180B,接近光传感器180G、指纹传感器180H,触摸传感器180K(当然,手机100还可以包括其它传感器,比如温度传感器,压力传感器、距离传感器、磁传感器、环境光传感器、气压传感器、骨传导传感器等,图中未示出)。The mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, mobile communication module 151, wireless communication module 152, Audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, SIM card interface 195 and so on. The sensor module 180 may include a gyroscope sensor 180A, an acceleration sensor 180B, a proximity light sensor 180G, a fingerprint sensor 180H, and a touch sensor 180K (Of course, the mobile phone 100 may also include other sensors, such as temperature sensors, pressure sensors, distance sensors, and magnetic sensors. , Ambient light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
可以理解的是,本发明实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是手机100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (Neural-network Processing Unit, NPU) Wait. Among them, the different processing units may be independent devices or integrated in one or more processors. The controller may be the nerve center and command center of the mobile phone 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
处理器110可以运行本申请实施例提供的室内定位方法,在保证定位结果精确的前提下降低电子设备在定位过程消耗的功耗。当处理器110集成不同的器件,比如集成CPU和GPU时,CPU和GPU可以配合执行本申请实施例提供的室内定位方法,比如室内定位方法中部分算法由CPU执行,另一部分算法由GPU执行,以得到较快的处理效率。The processor 110 may run the indoor positioning method provided in the embodiment of the present application, and reduce the power consumption of the electronic device during the positioning process under the premise of ensuring the accuracy of the positioning result. When the processor 110 integrates different devices, such as integrated CPU and GPU, the CPU and GPU can cooperate to execute the indoor positioning method provided in the embodiments of the present application. For example, in the indoor positioning method, part of the algorithm is executed by the CPU, and the other part of the algorithm is executed by the GPU. In order to get faster processing efficiency.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone 100 may include one or N display screens 194, and N is a positive integer greater than one.
摄像头193(前置摄像头或者后置摄像头,或者一个摄像头既可作为前置摄像头,也可作为后置摄像头)用于捕获静态图像或视频。通常,摄像头193可以包括感光元件比如镜头组和图像传感器,其中,镜头组包括多个透镜(凸透镜或凹透镜),用于采集待拍摄物体反射的光信号,并将采集的光信号传递给图像传感器。图像传感器根据所述光信号生成待拍摄物体的原始图像。The camera 193 (a front camera or a rear camera, or a camera can be used as a front camera or a rear camera) is used to capture still images or videos. Generally, the camera 193 may include photosensitive elements such as a lens group and an image sensor, where the lens group includes a plurality of lenses (convex lens or concave lens) for collecting light signals reflected by the object to be photographed and transmitting the collected light signals to the image sensor . The image sensor generates an original image of the object to be photographed according to the light signal.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,应用程序(比如相机应用,微信应用等)的代码等。存储数据区可存储手机100使用过程中所创建的数据(比如相机应用采集的图像、视频等)等。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store operating system, application program (such as camera application, WeChat application, etc.) codes and so on. The data storage area can store data created during the use of the mobile phone 100 (for example, images and videos collected by a camera application).
内部存储器121还可以存储本申请实施例提供的防误触算法的代码。当内部存储器121中存储的防误触算法的代码被处理器110运行时,可以对折叠或者展开过程中的触摸操作进行屏蔽。The internal memory 121 may also store the code of the anti-mistouch algorithm provided in the embodiment of the present application. When the code of the anti-mistouch algorithm stored in the internal memory 121 is executed by the processor 110, the touch operation during the folding or unfolding process can be shielded.
此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
当然,本申请实施例提供的用于实现视频编辑的算法的代码还可以存储在外部存储器中。这种情况下,处理器110可以通过外部存储器接口120运行存储在外部存储器中算法的代码,实现对视频进行编辑。Of course, the code for implementing the algorithm for video editing provided in the embodiments of the present application can also be stored in an external memory. In this case, the processor 110 may run the algorithm code stored in the external memory through the external memory interface 120 to implement editing of the video.
下面介绍传感器模块180的功能。The functions of the sensor module 180 are described below.
陀螺仪传感器180A,可以用于确定手机100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180A确定手机100围绕三个轴(即,x,y和z轴)的角速度。即陀螺仪传感器180A可以用于检测手机100当前的运动状态,比如抖动还是静止。The gyroscope sensor 180A can be used to determine the movement posture of the mobile phone 100. In some embodiments, the angular velocity of the mobile phone 100 around three axes (ie, x, y, and z axes) can be determined by the gyroscope sensor 180A. That is, the gyroscope sensor 180A can be used to detect the current movement state of the mobile phone 100, such as shaking or static.
加速度传感器180B可检测手机100在各个方向上(一般为三轴)加速度的大小。即陀螺仪传感器180A可以用于检测手机100当前的运动状态,比如抖动还是静止。The acceleration sensor 180B can detect the magnitude of the acceleration of the mobile phone 100 in various directions (generally three axes). That is, the gyroscope sensor 180A can be used to detect the current movement state of the mobile phone 100, such as shaking or static.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。手机通过发光二极管向外发射红外光。手机使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定手机附近有物体。当检测到不充分的反射光时,手机可以确定手机附近没有物体。The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode. The light emitting diode may be an infrared light emitting diode. The mobile phone emits infrared light through light-emitting diodes. Mobile phones use photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the phone. When insufficient reflected light is detected, the phone can determine that there is no object near the phone.
陀螺仪传感器180A(或加速度传感器180B)可以将检测到的运动状态信息(比如角速度)发送给处理器110。处理器110基于运动状态信息确定当前是手持状态还是脚架状态(比如,角速度不为0时,说明手机100处于手持状态)。The gyroscope sensor 180A (or acceleration sensor 180B) may send the detected motion state information (such as angular velocity) to the processor 110. The processor 110 determines whether it is currently in a hand-held state or a tripod state based on the motion state information (for example, when the angular velocity is not 0, it means that the mobile phone 100 is in the hand-held state).
指纹传感器180H用于采集指纹。手机100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The mobile phone 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于手机100的表面,与显示屏194所处的位置不同。 Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the mobile phone 100, which is different from the position of the display screen 194.
示例性的,手机100的显示屏194显示主界面,主界面中包括多个应用(比如相机应用、微信应用等)的图标。用户通过触摸传感器180K点击主界面中相机应用的图标,触发处理器110启动相机应用,打开摄像头193。显示屏194显示相机应用的界面,例如取景界面。Exemplarily, the display screen 194 of the mobile phone 100 displays a main interface, and the main interface includes icons of multiple applications (such as a camera application, a WeChat application, etc.). The user clicks the icon of the camera application in the main interface through the touch sensor 180K, triggers the processor 110 to start the camera application, and turns on the camera 193. The display screen 194 displays an interface of the camera application, such as a viewfinder interface.
手机100的无线通信功能可以通过天线1,天线2,移动通信模块151,无线通信模块152,调制解调处理器以及基带处理器等实现。The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 151, the wireless communication module 152, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。手机100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块151可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块151可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块151可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块151还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块 151的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块151的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 151 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the mobile phone 100. The mobile communication module 151 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 151 can receive electromagnetic waves by the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 151 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 151 may be provided in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 151 and at least part of the modules of the processor 110 may be provided in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块151或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is processed by the baseband processor and then passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 151 or other functional modules.
无线通信模块152可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块152可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块152经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块152还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 152 can provide applications on the mobile phone 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems. (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 152 may be one or more devices integrating at least one communication processing module. The wireless communication module 152 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 152 can also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic wave radiation through the antenna 2.
在一些实施例中,手机100的天线1和移动通信模块151耦合,天线2和无线通信模块152耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS))和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the mobile phone 100 is coupled with the mobile communication module 151, and the antenna 2 is coupled with the wireless communication module 152, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
另外,手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。手机100可以接收按键190输入,产生与手机100的用户设置以及功能控制有关的键信号输入。手机100可以利用马达191产生振动提示(比如来电振动提示)。手机100中的指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。手机100中的SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和手机100的接触和分离。In addition, the mobile phone 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc. The mobile phone 100 can receive the key 190 input, and generate key signal input related to the user settings and function control of the mobile phone 100. The mobile phone 100 can use the motor 191 to generate a vibration notification (such as an incoming call vibration notification). The indicator 192 in the mobile phone 100 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, and so on. The SIM card interface 195 in the mobile phone 100 is used to connect to the SIM card. The SIM card can be connected to and separated from the mobile phone 100 by inserting into the SIM card interface 195 or pulling out from the SIM card interface 195.
应理解,在实际应用中,手机100可以包括比图1所示的更多或更少的部件,本申请实施例不作限定。It should be understood that in practical applications, the mobile phone 100 may include more or less components than those shown in FIG. 1, which is not limited in the embodiment of the present application.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述 的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example. In practical applications, the above-mentioned functions can be allocated as required It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the system, device, and unit described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not repeated here.
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。The functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application essentially or the part that contributes to the prior art or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage The medium includes a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited to this. Any changes or substitutions within the technical scope disclosed in the embodiments of the present application shall be covered by this Within the protection scope of the application embodiments. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims (16)

  1. 一种室内定位方法,应用于电子设备,其特征在于,该方法包括:An indoor positioning method applied to electronic equipment, characterized in that the method includes:
    对电子设备周围的无线信号源进行扫描,获取第一接入点参数信息;Scanning wireless signal sources around the electronic device to obtain first access point parameter information;
    确定所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,其中,所述相似度越小表示所述第一接入点参数信息和所述历史接入点参数信息越相似;Determine the similarity between the first access point parameter information and the stored historical access point parameter information, where the smaller the similarity indicates the first access point parameter information and the historical access point The more similar the parameter information;
    当所述相似度大于第一阈值时,向定位服务器上报所述第一接入点参数信息;When the similarity is greater than the first threshold, report the first access point parameter information to the positioning server;
    接收所述定位服务器发送的位置信息,所述位置信息是所述定位服务器根据所述第一接入点参数信息确定的。Receiving location information sent by the positioning server, where the location information is determined by the positioning server according to the first access point parameter information.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    当所述相似度小于或等于第一阈值时,丢弃所述第一接入点参数信息。When the similarity is less than or equal to the first threshold, discard the first access point parameter information.
  3. 根据权利要求1或2所述的方法,其特征在于,所述确定所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,包括:The method according to claim 1 or 2, wherein the determining the similarity between the first access point parameter information and the stored historical access point parameter information comprises:
    从所述第一接入点参数信息与存储的历史接入点参数信息中,确定出k个相同的媒体访问控制MAC地址;Determining k identical media access control MAC addresses from the first access point parameter information and the stored historical access point parameter information;
    从所述第一接入点参数信息中获取所述k个相同的MAC地址对应的第一RSSI集合,以及从所述历史接入点参数信息中获取所述k个相同的MAC地址对应的第二RSSI集合;Obtain the first RSSI set corresponding to the k identical MAC addresses from the first access point parameter information, and obtain the first RSSI set corresponding to the k identical MAC addresses from the historical access point parameter information 2. RSSI collection;
    根据所述第一RSSI集合和所述第二RSSI集合,确定所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度。Determine the similarity between the first access point parameter information and the stored historical access point parameter information according to the first RSSI set and the second RSSI set.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述第一RSSI集合和所述第二RSSI集合,确定所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,包括:The method according to claim 3, wherein the determining the first access point parameter information and the stored historical access point parameter information according to the first RSSI set and the second RSSI set The similarity between:
    将所述第一RSSI集合和所述第二RSSI集合进行归一化处理,得到归一化后的第一RSSI集合和归一化后的第二RSSI集合;Normalizing the first RSSI set and the second RSSI set to obtain a normalized first RSSI set and a normalized second RSSI set;
    根据所述归一化后的第一RSSI集合和归一化后的第二RSSI集合,计算所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,所述相似度符合下述公式要求:Calculating the similarity between the first access point parameter information and the stored historical access point parameter information according to the normalized first RSSI set and the normalized second RSSI set, The similarity meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100001
    Figure PCTCN2020097887-appb-100001
    其中,k表示相同的MAC地址的个数,Num表示历史接入点参数信息中的MAC地址和第一接入点参数信息中的MAC地址取并集,得到的MAC地址总数,B i表示归一化后第一RSSI集合中的第i个RSSI,A i表示归一化后第二RSSI集合中的第i个RSSI,S表示相似度,i的取值从1到k,其中,B i和A i为同一MAC地址的RSSI。 Among them, k represents the number of the same MAC address, Num represents the union of the MAC address in the historical access point parameter information and the MAC address in the first access point parameter information to obtain the total number of MAC addresses, and B i represents the return After normalization, the i-th RSSI in the first RSSI set, A i represents the i-th RSSI in the second RSSI set after normalization, S represents the similarity, and the value of i ranges from 1 to k, where B i And A i are the RSSI of the same MAC address.
  5. 根据权利要求4所述的方法,其特征在于,将所述第一RSSI集合和所述第二RSSI集合进行归一化处理,得到归一化后的第一RSSI集合和归一化后的第二RSSI集合,包括:The method of claim 4, wherein the first RSSI set and the second RSSI set are normalized to obtain a normalized first RSSI set and a normalized first RSSI set Two RSSI collections, including:
    将所述第一RSSI集合进行归一化处理,得到的归一化后的第一RSSI集合符合下述公式要求:The first RSSI set is normalized, and the obtained normalized first RSSI set meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100002
    Figure PCTCN2020097887-appb-100002
    其中,B i表示归一化后的第一RSSI集合中的第i个RSSI;b i为归一化之前的第一RSSI集合中的第i个RSSI,其中i的取值是从1到k; Among them, B i represents the i-th RSSI in the first RSSI set after normalization; b i is the i-th RSSI in the first RSSI set before normalization, where the value of i is from 1 to k ;
    将所述第二RSSI集合进行归一化处理,得到的归一化后的第二RSSI集合符合下述公式要求:The second RSSI set is normalized, and the obtained normalized second RSSI set meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100003
    Figure PCTCN2020097887-appb-100003
    其中,A i表示归一化后的第二RSSI集合中的第i个RSSI;a i为归一化之前的第二RSSI集合中的第i个RSSI,其中i的取值是从1到k。 Among them, A i represents the i-th RSSI in the second RSSI set after normalization; a i is the i-th RSSI in the second RSSI set before normalization, and the value of i is from 1 to k .
  6. 根据权利要求1或2所述的方法,其特征在于,所述确定所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,包括:The method according to claim 1 or 2, wherein the determining the similarity between the first access point parameter information and the stored historical access point parameter information comprises:
    从所述第一接入点参数信息与所述历史接入点参数信息中,确定出k个相同的媒体访问控制MAC地址;Determining k identical media access control MAC addresses from the first access point parameter information and the historical access point parameter information;
    将所述第一接入点参数信息与所述历史接入点参数信息中的MAC地址取并集,得到MAC地址总数;Taking a union of the first access point parameter information and the MAC addresses in the historical access point parameter information to obtain the total number of MAC addresses;
    根据所述k与MAC地址总数计算所述相似度,所述相似度符合下述公式要求:The similarity is calculated according to the total number of k and MAC addresses, and the similarity meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100004
    Figure PCTCN2020097887-appb-100004
    其中,k表示相同的媒体访问控制MAC地址的个数,M为MAC地址总数,S为相似度。Among them, k represents the number of the same media access control MAC address, M is the total number of MAC addresses, and S is the degree of similarity.
  7. 根据权利要求1至6任一项所述的方法,其特征在于,对电子设备周围的无线信号源进行扫描,生成第一接入点参数信息,包括:The method according to any one of claims 1 to 6, wherein scanning wireless signal sources around the electronic device to generate first access point parameter information comprises:
    当定时器时间到达时,对电子设备周围的无线信号源进行扫描;When the timer expires, scan the wireless signal sources around the electronic device;
    或者,当电子设备的移动距离达到一定门限值时,对电子设备周围的无线信号源进行扫描。Or, when the moving distance of the electronic device reaches a certain threshold, the wireless signal sources around the electronic device are scanned.
  8. 一种电子设备,其特征在于,包括存储器,处理器和收发器;An electronic device characterized by comprising a memory, a processor and a transceiver;
    所述存储器用于存储一个或多个计算机程序;The memory is used to store one or more computer programs;
    当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备执行:When one or more computer programs stored in the memory are executed by the processor, the electronic device is caused to execute:
    对电子设备周围的无线信号源进行扫描,获取第一接入点参数信息;Scanning wireless signal sources around the electronic device to obtain first access point parameter information;
    确定所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,其中,所述相似度越小表示所述第一接入点参数信息和所述历史接入点参数信息越相似;Determine the similarity between the first access point parameter information and the stored historical access point parameter information, where the smaller the similarity indicates the first access point parameter information and the historical access point The more similar the parameter information;
    当所述相似度大于第一阈值时,向定位服务器上报所述第一接入点参数信息;When the similarity is greater than the first threshold, report the first access point parameter information to the positioning server;
    通过所述收发器接收所述定位服务器发送的位置信息,所述位置信息是所述定位服务器根据所述第一接入点参数信息确定的。The location information sent by the positioning server is received by the transceiver, where the location information is determined by the positioning server according to the first access point parameter information.
  9. 根据权利要求8所述的电子设备,其特征在于,当所述存储器存储的一个或多个计算机程序被所述处理器执行时,还使得所述电子设备执行:The electronic device according to claim 8, wherein when one or more computer programs stored in the memory are executed by the processor, the electronic device is further caused to execute:
    当所述相似度小于或等于第一阈值时,丢弃所述第一接入点参数信息。When the similarity is less than or equal to the first threshold, discard the first access point parameter information.
  10. 根据权利要求8或9所述的电子设备,其特征在于,当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备具体执行:The electronic device according to claim 8 or 9, wherein when one or more computer programs stored in the memory are executed by the processor, the electronic device is caused to specifically execute:
    从所述第一接入点参数信息与存储的历史接入点参数信息中,确定出k个相同的媒体访问控制MAC地址;Determining k identical media access control MAC addresses from the first access point parameter information and the stored historical access point parameter information;
    从所述第一接入点参数信息中获取所述k个相同的MAC地址对应的第一RSSI集合,以及从所述历史接入点参数信息中获取所述k个相同的MAC地址对应的第二RSSI集合;Obtain the first RSSI set corresponding to the k identical MAC addresses from the first access point parameter information, and obtain the first RSSI set corresponding to the k identical MAC addresses from the historical access point parameter information 2. RSSI collection;
    根据所述第一RSSI集合和所述第二RSSI集合,确定所述第一接入点参数信息与存储的 历史接入点参数信息之间的相似度。Determine the similarity between the first access point parameter information and the stored historical access point parameter information according to the first RSSI set and the second RSSI set.
  11. 根据权利要求10所述的电子设备,其特征在于,当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备具体执行:The electronic device according to claim 10, wherein when one or more computer programs stored in the memory are executed by the processor, the electronic device is caused to specifically execute:
    将所述第一RSSI集合和所述第二RSSI集合进行归一化处理,得到归一化后的第一RSSI集合和归一化后的第二RSSI集合;Normalizing the first RSSI set and the second RSSI set to obtain a normalized first RSSI set and a normalized second RSSI set;
    根据所述归一化后的第一RSSI集合和归一化后的第二RSSI集合,计算所述第一接入点参数信息与存储的历史接入点参数信息之间的相似度,所述相似度符合下述公式要求:Calculating the similarity between the first access point parameter information and the stored historical access point parameter information according to the normalized first RSSI set and the normalized second RSSI set, The similarity meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100005
    Figure PCTCN2020097887-appb-100005
    其中,k表示相同的MAC地址的个数,Num表示历史接入点参数信息中的MAC地址和第一接入点参数信息中的MAC地址取并集,得到的MAC地址总数,B i表示归一化后第一RSSI集合中的第i个RSSI,A i表示归一化后第二RSSI集合中的第i个RSSI,S表示相似度,i的取值从1到k,其中,B i和A i为同一MAC地址的RSSI。 Among them, k represents the number of the same MAC address, Num represents the union of the MAC address in the historical access point parameter information and the MAC address in the first access point parameter information to obtain the total number of MAC addresses, and B i represents the return After normalization, the i-th RSSI in the first RSSI set, A i represents the i-th RSSI in the second RSSI set after normalization, S represents the similarity, and the value of i ranges from 1 to k, where B i And A i are the RSSI of the same MAC address.
  12. 根据权利要求11所述的电子设备,其特征在于,当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备具体执行:The electronic device according to claim 11, wherein when one or more computer programs stored in the memory are executed by the processor, the electronic device is caused to specifically execute:
    将所述第一RSSI集合进行归一化处理,得到的归一化后的第一RSSI集合符合下述公式要求:The first RSSI set is normalized, and the obtained normalized first RSSI set meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100006
    Figure PCTCN2020097887-appb-100006
    其中,B i表示归一化后的第一RSSI集合中的第i个RSSI;b i为归一化之前的第一RSSI集合中的第i个RSSI,其中i的取值是从1到k; Among them, B i represents the i-th RSSI in the first RSSI set after normalization; b i is the i-th RSSI in the first RSSI set before normalization, where the value of i is from 1 to k ;
    将所述第二RSSI集合进行归一化处理,得到的归一化后的第二RSSI集合符合下述公式要求:The second RSSI set is normalized, and the obtained normalized second RSSI set meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100007
    Figure PCTCN2020097887-appb-100007
    其中,A i表示归一化后的第二RSSI集合中的第i个RSSI;a i为归一化之前的第二RSSI集合中的第i个RSSI,其中i的取值是从1到k。 Among them, A i represents the i-th RSSI in the second RSSI set after normalization; a i is the i-th RSSI in the second RSSI set before normalization, and the value of i is from 1 to k .
  13. 根据权利要求8或9所述的电子设备,其特征在于,当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备具体执行:The electronic device according to claim 8 or 9, wherein when one or more computer programs stored in the memory are executed by the processor, the electronic device is caused to specifically execute:
    从所述第一接入点参数信息与所述历史接入点参数信息中,确定出k个相同的媒体访问控制MAC地址;Determining k identical media access control MAC addresses from the first access point parameter information and the historical access point parameter information;
    将所述第一接入点参数信息与所述历史接入点参数信息中的MAC地址取并集,得到MAC地址总数;Taking a union of the first access point parameter information and the MAC addresses in the historical access point parameter information to obtain the total number of MAC addresses;
    根据所述k与MAC地址总数计算所述相似度,所述相似度符合下述公式要求:The similarity is calculated according to the total number of k and MAC addresses, and the similarity meets the requirements of the following formula:
    Figure PCTCN2020097887-appb-100008
    Figure PCTCN2020097887-appb-100008
    其中,k表示相同的媒体访问控制MAC地址的个数,M为MAC地址总数,S为相似度。Among them, k represents the number of the same media access control MAC address, M is the total number of MAC addresses, and S is the degree of similarity.
  14. 根据权利要求8至13任一项所述的电子设备,其特征在于,当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备具体执行:The electronic device according to any one of claims 8 to 13, wherein when one or more computer programs stored in the memory are executed by the processor, the electronic device is caused to specifically execute:
    当定时器时间到达时,对电子设备周围的无线信号源进行扫描;When the timer expires, scan the wireless signal sources around the electronic device;
    或者,当电子设备的移动距离达到一定门限值时,对电子设备周围的无线信号源进行扫描。Or, when the moving distance of the electronic device reaches a certain threshold, the wireless signal sources around the electronic device are scanned.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求1至7任一项所述的电子设备的室内定位方法。A computer-readable storage medium, wherein the computer-readable storage medium includes a computer program, and when the computer program runs on an electronic device, the electronic device executes any one of claims 1 to 7 Indoor positioning method for electronic equipment.
  16. 一种芯片,其特征在于,所述芯片与存储器耦合,用于执行所述存储器中存储的计算机程序,以执行如权利要求1至7任一项所述的室内定位方法。A chip, characterized in that the chip is coupled with a memory, and is used to execute a computer program stored in the memory to execute the indoor positioning method according to any one of claims 1 to 7.
PCT/CN2020/097887 2019-06-27 2020-06-24 Indoor location method and electronic device WO2020259529A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201910568695.6 2019-06-27
CN201910568695 2019-06-27
CN201910804013.7 2019-08-28
CN201910804013.7A CN110505572B (en) 2019-06-27 2019-08-28 Indoor positioning method and electronic equipment

Publications (1)

Publication Number Publication Date
WO2020259529A1 true WO2020259529A1 (en) 2020-12-30

Family

ID=68590293

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097887 WO2020259529A1 (en) 2019-06-27 2020-06-24 Indoor location method and electronic device

Country Status (2)

Country Link
CN (1) CN110505572B (en)
WO (1) WO2020259529A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505572B (en) * 2019-06-27 2021-05-04 华为技术有限公司 Indoor positioning method and electronic equipment
CN113450046A (en) * 2020-03-27 2021-09-28 阿里巴巴集团控股有限公司 Article management method, information processing method, device and electronic equipment
CN111343576B (en) * 2020-04-20 2021-06-25 广州掌淘网络科技有限公司 Indoor positioning method and equipment
CN113806340B (en) * 2020-06-15 2022-12-20 北京三快在线科技有限公司 Store arrival determination method and device, storage medium and electronic equipment
CN113873444B (en) * 2020-06-30 2023-03-10 华为技术有限公司 Positioning method and electronic equipment
CN114466308B (en) * 2020-10-22 2023-10-10 华为技术有限公司 Positioning method and electronic equipment
CN116782122A (en) * 2022-03-11 2023-09-19 华为技术有限公司 Positioning method, positioning system and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009044309A (en) * 2007-08-07 2009-02-26 Panasonic Corp Radio communication terminal and its radio communication method
CN105992319A (en) * 2015-02-07 2016-10-05 深圳市龙域通信科技有限公司 Low-power-consumption mobile terminal positioning device and method
CN106102005A (en) * 2016-06-16 2016-11-09 惠州Tcl移动通信有限公司 A kind of method and system reducing location mobile device power consumption
CN107063293A (en) * 2017-04-24 2017-08-18 深圳市沃特沃德股份有限公司 Reporting position method and apparatus
CN107613552A (en) * 2017-10-31 2018-01-19 广东小天才科技有限公司 A kind of localization method and mobile terminal based on mobile terminal
CN110505572A (en) * 2019-06-27 2019-11-26 华为技术有限公司 A kind of indoor orientation method and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104125021B (en) * 2013-04-28 2016-12-28 华为技术有限公司 A kind of method of kinestate identifying mobile terminal and mobile terminal
CN104684072B (en) * 2013-11-26 2018-03-16 华为技术有限公司 Method, apparatus, AP and the terminal positioned in real time
CN106304325B (en) * 2015-05-26 2020-03-13 中移(杭州)信息技术有限公司 Positioning method, positioning device and positioning terminal
CN106792522B (en) * 2016-12-09 2019-10-29 北京羲和科技有限公司 A kind of fingerprint base localization method and system based on access point AP
CN108449707B (en) * 2018-03-08 2021-08-17 深圳市沃特沃德股份有限公司 Wearable device and positioning method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009044309A (en) * 2007-08-07 2009-02-26 Panasonic Corp Radio communication terminal and its radio communication method
CN105992319A (en) * 2015-02-07 2016-10-05 深圳市龙域通信科技有限公司 Low-power-consumption mobile terminal positioning device and method
CN106102005A (en) * 2016-06-16 2016-11-09 惠州Tcl移动通信有限公司 A kind of method and system reducing location mobile device power consumption
CN107063293A (en) * 2017-04-24 2017-08-18 深圳市沃特沃德股份有限公司 Reporting position method and apparatus
CN107613552A (en) * 2017-10-31 2018-01-19 广东小天才科技有限公司 A kind of localization method and mobile terminal based on mobile terminal
CN110505572A (en) * 2019-06-27 2019-11-26 华为技术有限公司 A kind of indoor orientation method and electronic equipment

Also Published As

Publication number Publication date
CN110505572A (en) 2019-11-26
CN110505572B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
WO2020259529A1 (en) Indoor location method and electronic device
CN111316333B (en) Information prompting method and electronic equipment
WO2020191598A1 (en) Method for determining that terminal device is located inside geofence, and terminal device
WO2021218494A1 (en) Dual-card-based network type switching method and terminal device
CN114466102B (en) Method for displaying application interface, related device and traffic information display system
WO2021244458A1 (en) Network search method and related apparatus
WO2022213753A1 (en) Wireless charging alignment detection method and electronic device
CN116156417A (en) Equipment positioning method and related equipment thereof
WO2021147419A1 (en) Data transmission method, electronic device and storage medium
WO2022257665A1 (en) Device tracking detection method and electronic device
US20230379408A1 (en) Positioning Method and Electronic Device
US20230388832A1 (en) Method for detecting video surveillance device and electronic device
WO2023179751A1 (en) Object searching method, system and electronic device
CN113643403A (en) Method for determining target communication device, terminal and computer readable storage medium
CN111241035A (en) Application management method and device and terminal equipment
WO2022228059A1 (en) Positioning method and apparatus
WO2022068626A1 (en) Track correction method and system
WO2024001742A1 (en) Parking-space addressing method, parking-space marking method and terminal device
CN116033333B (en) Method for determining position information, electronic device and readable storage medium
CN116056003B (en) Geofence triggering method and related electronic equipment
WO2023051098A1 (en) Device search method, electronic device, and system
CN116723460B (en) Method for creating personal geofence and related equipment thereof
US20240187992A1 (en) Bluetooth connection method and device
WO2023169487A1 (en) Positioning method and system, and related apparatus
WO2022088919A1 (en) Interface display method and electronic device

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: 20831543

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20831543

Country of ref document: EP

Kind code of ref document: A1