Background
At present, the positioning technologies in the world mainly comprise GPS positioning, Wi-Fi positioning, Bluetooth positioning and the like, the GPS positioning is mainly applied to the outdoors, and the Wi-Fi and Bluetooth positioning can be used indoors and outdoors. As Wi-Fi positioning is relatively mature, details of the present invention are described below in the context of Wi-Fi positioning technology. With the popularization of wireless routers, most public areas have achieved dozens of or even dozens of WiFi signal coverage at present, and the routers continuously transmit information such as physical addresses, signal strength and the like while spreading WiFi signals to the periphery, and the information can be obtained even if the passwords of Wi-Fi are unknown within the signal coverage range.
The general WiFi indoor positioning technology is mostly the signal strength positioning technology of a Wireless Local Area Network (WLAN) based on the IEEE802.11b/g protocol. The basic principle of the positioning technology based on signal strength is to calculate the distance between a signal receiver and a signal source according to the strength of a received signal, and the positioning technology is mainly divided into two types: a triangle intensity algorithm and a location fingerprinting algorithm. The triangular strength algorithm has low precision and is difficult to meet the indoor positioning requirement; the common fingerprint identification algorithm has the defect that the received signals have errors due to different receiving devices.
Disclosure of Invention
In order to solve the technical problems, the invention provides a WiFi positioning method and a server, which are used for realizing WiFi positioning based on a deep neural network by acquiring signal intensity data corresponding to each wireless access point and received by each antenna of a client to be detected and inputting the signal intensity data into the deep neural network.
The technical scheme provided by the invention is as follows:
the invention discloses a WiFi positioning method, which comprises the following steps: s100, collecting antenna signal intensity data of signals sent by each antenna of a client to be detected and received by each wireless access point in a detection area; s200, preprocessing the acquired antenna signal intensity data; s300, inputting the processed antenna signal intensity data into an input data layer of the trained positioning model respectively; s400, calculating the antenna signal intensity data corresponding to each wireless access point based on the network layer of the trained positioning model, and determining the position of the client to be detected according to the output result of the output layer.
Further preferably, the step S200 further includes: when the client to be detected comprises a plurality of antennas, and the number of antenna signal intensity data of each wireless access point for receiving signals sent by each antenna of the client to be detected is multiple, the wireless access point does not process the signals; when the client to be detected only has one antenna and the number of the antenna signal intensity data of each wireless access point for receiving the signal sent by each antenna of the client to be detected is one, the antenna signal intensity data is equally divided into a plurality of antenna signal intensity data.
Further preferably, the step S100 further comprises, before the step S: and S000, training a deep neural network in advance, and taking the trained deep neural network as the positioning model.
Further preferably, the step S000 further comprises the steps of: s001, presetting a training position label; s002, respectively acquiring signal intensity data of a plurality of antennas of each wireless access point receiving training terminal in a detection area where each training position label sends out signals; generating training sample data according to a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal in a detection area of each training position tag, generating a training data set by all the training sample data, and sending the training data set into a deep neural network; s003, defining an input data layer of the deep neural network as a multi-channel data layer, wherein the number of channels of the multi-channel data layer is the same as the number of antennas of a training terminal, and nodes of the multi-channel data layer correspond to each wireless access point; respectively inputting a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal received by each wireless access point in each training sample data into a plurality of channels of the corresponding node according to a mode that the nodes of a multi-channel data layer correspond to the wireless access points, and outputting a training result corresponding to the training position label in the training sample data through the deep neural network; and S004, sequentially comparing the output training result with the training position labels corresponding to the output training result, training the deep neural network according to the comparison result, and taking the trained deep neural network as the positioning model.
The invention also discloses a WiFi positioning server, which comprises: the data acquisition module is used for acquiring antenna signal intensity data of signals sent by each antenna of the client to be detected and received by each wireless access point in the detection area; the preprocessing module is used for preprocessing the acquired antenna signal intensity data; and the positioning module is used for respectively inputting the processed antenna signal intensity data into an input data layer of the trained positioning model, calculating the antenna signal intensity data corresponding to each wireless access point based on a network layer of the positioning model, and determining the position of the client to be detected according to the output result of the output layer.
Preferably, the preprocessing module is further configured to not process the signal strength data of the plurality of antennas when the client to be detected includes the plurality of antennas and the plurality of antenna signal strength data of the signals sent by each antenna of the client to be detected are received by each wireless access point; when the client to be detected only has one antenna and the number of the antenna signal intensity data of each wireless access point for receiving the signal sent by each antenna of the client to be detected is one, the antenna signal intensity data is equally divided into a plurality of antenna signal intensity data.
Further preferably, the method further comprises the following steps: and the training module is used for training the deep neural network in advance and taking the trained deep neural network as the positioning model.
Further preferably, the training module further comprises: the label presetting submodule is used for presetting a training position label for training; the training data set generation submodule is used for respectively acquiring a plurality of antenna signal intensity data of a plurality of antennas of each wireless access point receiving training terminal, wherein the antennas send signals in the detection area at each training position label; generating training sample data according to a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal in a detection area of each training position tag, generating a training data set by all the training sample data, and sending the training data set into a deep neural network; the input data layer definition submodule is used for defining an input data layer of the deep neural network as a multi-channel data layer, the number of channels of the multi-channel data layer is the same as the number of antennas of the training terminal, and nodes of the multi-channel data layer correspond to each wireless access point; and the training prediction submodule is used for respectively inputting a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal received by each wireless access point in each training sample data into a plurality of channels of corresponding nodes according to the mode that the nodes of a multi-channel data layer correspond to the wireless access points, outputting a training result corresponding to the training position label in the training sample data through the deep neural network, sequentially comparing the output training result with the corresponding training position label, training the deep neural network according to the comparison result, and taking the trained deep neural network as the positioning model.
Compared with the prior art, the WiFi positioning method and the server provided by the invention have the advantages that the position of the client to be tested can be determined by collecting the antenna signal intensity data of the signals sent by each antenna of the client to be tested and received by each wireless access point and inputting the trained positioning model, and the antenna signal intensity data of a plurality of antennas are used as the input of the deep neural network, so that the positioning accuracy of the terminals with different antenna numbers is improved.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
Fig. 1 is a schematic diagram of main steps of a WiFi positioning method of the present invention, and as shown in fig. 1, the WiFi positioning method includes the steps of: s100, collecting antenna signal intensity data of signals sent by each antenna of a client to be detected and received by each wireless access point in a detection area; s200, preprocessing the acquired antenna signal intensity data; s300, inputting the processed antenna signal intensity data into an input data layer of the trained positioning model respectively; s400, calculating the antenna signal intensity data corresponding to each wireless access point based on the network layer of the trained positioning model, and determining the position of the client to be detected according to the output result of the output layer.
Specifically, the client (hereinafter referred to as STA) to be detected uses an intelligent terminal device such as a smart phone, a notebook computer, or a personal tablet computer as a carrier.
In this embodiment, the format of the antenna signal strength data of the signal sent by each antenna of the client to be detected and received by each wireless access point in the detection area is < RSSI1, RSSI2, RSSI3, RSSI4, RSSI5>, wherein RSSI1 is the RSSI of the STA received by AP1, RSSI2 is the RSSI of the STA received by AP2, and so on.
Specifically, the RSSI of the STA is generally obtained by the AP as the raw input data for positioning, and there is usually a factor not to be considered: a plurality of antennas. For example, a cellular phone is generally a 1x1 antenna, a part of the cellular phone is 2x2 for iphone6s, and a notebook computer is generally 2x 2. Since the power of the 2x2 antenna is theoretically 3dB greater than that of the 1x1 antenna. Therefore, if the number of antennas is not considered in data collection, a certain error is caused. If the data conversion is performed by subtracting 3dB from 2x2 antenna data, the effect is better than not considering the number of antennas at all, but the effect is not accurate enough. Because two antennas of the 2x2 antenna are at different positions in space, the characteristics of the spatial channels are different, and the intensity of the radio wave is the same as the wave fluctuation on the sea surface, and often one antenna is at the wave peak and the other antenna is at the wave trough, so that the 3dB reduction processing cannot be simply carried out.
The invention records the RSSI of each AP received by all the antennas under the condition of multiple antennas independently, and inputs the RSSI of each antenna as a channel of a data layer into a deep learning neural network independently. Therefore, when the training of the neural network is deeply learned, the network can be adaptively adjusted to synthesize the information of all the antennas, and finally, more accurate fitting is achieved, and the WIFI positioning accuracy is improved.
The following describes that each antenna at the position of the client to be detected, which is acquired in the invention, receives signal intensity data of each wireless access point, which corresponds to each wireless access point.
1. Suppose that there are AP1, AP2, and AP3 monitoring STA1 to be detected, and AP1 and AP2 are 2 antennas and AP3 is 1 antenna. STA1 is a2 antenna.
Watch 1
|
AP1
|
AP2
|
AP3
|
STA1
|
-32dBm;-30dBm
|
-52dBm;-40dBm
|
-60dBm |
As shown in table one, the signal strength data collected when the client to be detected is 2 × 2 antenna.
2. Suppose that there are AP1, AP2, and AP3 monitoring STA2 to be detected, and AP1 and AP2 are 2 antennas and AP3 is 1 antenna. STA2 is a1 antenna.
Watch two
|
AP1
|
AP2
|
AP3
|
STA2
|
-20dBm
|
-30dBm
|
-40dBm |
As shown in table two, the signal strength data collected when the client to be detected is 1 × 1 antenna.
Specifically, in the above example, since the antennas of the client to be detected are uncertain, and may be 1x1 antennas or 2x2 antennas, when the channel of the input data layer of the positioning model is defined, it is defined as a multi-channel data layer. In order to make the signal strength data collected by the 1x1 antenna satisfy the multi-channel data layer, the signal strength data collected by the 1x1 antenna needs to be preprocessed to process the data into data based on the multi-channel data layer.
Preferably, the step S200 further includes: when the client to be detected comprises a plurality of antennas, and the number of antenna signal intensity data of each wireless access point for receiving signals sent by each antenna of the client to be detected is multiple, the wireless access point does not process the signals; when the client to be detected only has one antenna and the number of the antenna signal intensity data of each wireless access point for receiving the signal sent by each antenna of the client to be detected is one, the antenna signal intensity data is equally divided into a plurality of antenna signal intensity data.
The data collected by the invention is based on multiple antennas, namely when the client to be detected is a 1x1 antenna, the collected antenna signal intensity data is processed. The specific processing method is that the antenna signal strength data of each wireless access point received by the 1x1 antenna is equally divided into a plurality of parts with the same number as the channels of the input data layer of the positioning model.
In the present invention, a 2x2 antenna is taken as an example, the signal data strength of one channel of 1x1 is divided by 2, and the data is expanded into two channels of data, for example, if the AP1 and the STA2 are-20 dBm, the power is divided by 2 (logarithmically, minus 3dB), which is-23 dBm.
The data after preprocessing is represented as table three:
watch III
|
AP1
|
AP2
|
AP3
|
STA1
|
-32dBm:-30dBm
|
-52dBm:-40dBm
|
-63dBm:-63dBm
|
STA2
|
-23dBm:-23dBm
|
-33dBm:-33dBm
|
-43dBm:-43dBm |
Preferably, the step S100 further includes, before the step S: and S000, training a deep neural network in advance, and taking the trained deep neural network as the positioning model.
Specifically, the method can include two specific implementation modes according to different output results obtained by positioning, wherein the mode is to output a certain preset classification probability value of the position of the client to be detected through the deep neural network as a positioning model, and the mode is to directly output the preset position coordinate of the position of the client to be detected through the deep neural network as the positioning model. The present invention is not limited to the specific training mode.
The invention adopts a supervised global parameter training method: knowing the actual position of the received signal strength data, the output of the network layer of the deep neural network is made to be the same as the true result by continuously adjusting the network parameters.
Fig. 2 is a schematic diagram of a procedure of training a deep neural network according to a WiFi positioning method of the present invention. Preferably, as shown in fig. 2, the step S000 further includes the steps of: s001, presetting a training position label; s002, respectively acquiring signal intensity data of a plurality of antennas of each wireless access point receiving training terminal in a detection area where each training position label sends out signals; generating training sample data according to a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal in a detection area of each training position tag, generating a training data set by all the training sample data, and sending the training data set into a deep neural network; s003, defining an input data layer of the deep neural network as a multi-channel data layer, wherein the number of channels of the multi-channel data layer is the same as the number of antennas of a training terminal, and nodes of the multi-channel data layer correspond to each wireless access point; respectively inputting a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal received by each wireless access point in each training sample data into a plurality of channels of the corresponding node according to a mode that the nodes of a multi-channel data layer correspond to the wireless access points, and outputting a training result corresponding to the training position label in the training sample data through the deep neural network; and S004, sequentially comparing the output training result with the training position labels corresponding to the output training result, training the deep neural network according to the comparison result, and taking the trained deep neural network as the positioning model.
Specifically, in this embodiment, the signal strength data is multi-dimensional data corresponding to the wireless access points, which is received by multiple antennas, of each wireless access point, so that the input data layer of the deep neural network used as the positioning model is defined as a multi-channel data layer.
In the following, the process of training the deep neural network according to the present invention is specifically described by taking the first example of outputting the probability value of a certain preset classification to which the position of the client to be detected belongs through the deep neural network as a positioning model.
1. During training, firstly, a plurality of antenna signal intensity data of signals sent by a plurality of antennas of the training terminal at the corresponding position of each training position label in the detection area are respectively collected by each wireless access point. In this embodiment, the preset training position labels are defined by themselves, specifically, the detection area may be divided by grids, the detection area may be divided into a preset number of grid classes, each grid class is assigned with a corresponding preset training position label, or a planar rectangular coordinate system may be established in the detection area, and corresponding position coordinates are set in the coordinate system as the preset training position labels, respectively. In this embodiment, by way of example, the signal strength data corresponding to each wireless access point received by each antenna at the position corresponding to each preset training position tag collected in the present invention is explained with actual data.
Assuming that the training terminal is a 2x2 antenna, the signal strength data of the antenna signaled by each antenna of the training terminal at the position of one of the preset training position tags is collected as follows:
<(-32,-30),(-52,-40),(-63,-63),34>
represents:
RSSI 1-32 dBm (antenna 1), -30dBm (antenna 2)
RSSI 2-52 dBm (antenna 1), -40dBm (antenna 2)
RSSI3 ═ 63dBm (antenna 1), -63dBm (antenna 2)
label 34, which represents the training position label, and represents the position of the grid identified as 34 in the detection area.
And sequentially acquiring antenna signal intensity data of signals, which are sent by a plurality of antennas of the training terminal on each preset training position label, received by each wireless access point to form training sample data.
2. And training the deep neural network by training sample data in sequence.
Because the acquired raw data is multidimensional data, an input data layer of the deep neural network used as a positioning model is also defined as a multi-channel data layer, and nodes of the multi-channel data layer correspond to the wireless access points. Inputting antenna signal intensity data, which is sent by a plurality of antennas of a training terminal and received by each wireless access point in each training sample data, into a plurality of channels of the corresponding node according to a mode that the node of a multi-channel data layer corresponds to the wireless access point, and inputting acquired original data into the two-channel data layer by taking the antenna signal intensity data, which is sent by two antennas of the training terminal at the position of a training position label, of each wireless access point as an example, wherein the data input by each channel is as shown in table four:
watch four
|
1 channel
|
2 channel
|
AP1
|
-32
|
-30
|
AP2
|
-52
|
-40
|
AP3
|
-63
|
-63 |
As shown in table four, the channel 1 represents the signal strength data corresponding to each wireless access point collected by the antenna 1 of the training terminal, and the unit is DB, and the channel 2 represents the signal strength data corresponding to each wireless access point collected by the antenna 2 of the training terminal.
And sending training sample data corresponding to each preset training position label to two channels of a two-channel data layer of the deep neural network in sequence, outputting errors between a training result and the training position label, and finally enabling the Loss, namely the error, of the whole network to be minimum by adjusting parameters in the deep neural network.
It should be noted that no specific parameters are indicated in the entire deep neural network, because these parameters are related to specific spaces and the number of APs, and are not within the scope of this patent.
Fig. 3 is a schematic diagram of main components of a WiFi positioning server of the present invention, and as shown in fig. 3, a WiFi positioning server includes: the data acquisition module 100 is configured to acquire antenna signal strength data of signals sent by each antenna of the client to be detected and received by each wireless access point in the detection area; the preprocessing module 200 is configured to preprocess the acquired antenna signal strength data; and the positioning module 300 is configured to input the processed antenna signal strength data into an input data layer of the trained positioning model, calculate the antenna signal strength data based on a network layer of the positioning model, and determine the position of the client to be detected according to an output result of the output layer.
Specifically, the client (hereinafter referred to as STA) to be detected uses an intelligent terminal device such as a smart phone, a notebook computer, or a personal tablet computer as a carrier.
In this embodiment, the format of the antenna signal strength data of the signal sent by each antenna of the client to be detected and received by each wireless access point in the detection area is < RSSI1, RSSI2, RSSI3, RSSI4, RSSI5>, wherein RSSI1 is the RSSI of the STA received by AP1, RSSI2 is the RSSI of the STA received by AP2, and so on.
Specifically, the RSSI of the STA is generally obtained by the AP as the raw input data for positioning, and there is usually a factor not to be considered: a plurality of antennas. For example, a cellular phone is generally a 1x1 antenna, a part of the cellular phone is 2x2 for iphone6s, and a notebook computer is generally 2x 2. Since the power of the 2x2 antenna is theoretically 3dB greater than that of the 1x1 antenna. Therefore, if the number of antennas is not considered in data collection, a certain error is caused. If the data conversion is performed by subtracting 3dB from 2x2 antenna data, the effect is better than not considering the number of antennas at all, but the effect is not accurate enough. Because two antennas of the 2x2 antenna are at different positions in space, the characteristics of the spatial channels are different, and the intensity of the radio wave is the same as the wave fluctuation on the sea surface, and often one antenna is at the wave peak and the other antenna is at the wave trough, so that the 3dB reduction processing cannot be simply carried out.
The invention records the RSSI of each AP received by all the antennas under the condition of multiple antennas independently, and inputs the RSSI of each antenna as a channel of a data layer into a deep learning neural network independently. Therefore, when the training of the neural network is deeply learned, the network can be adaptively adjusted to synthesize the information of all the antennas, and finally, more accurate fitting is achieved, and the WIFI positioning accuracy is improved.
Preferably, the preprocessing module 200 is further configured to not process the signal when the client to be detected includes multiple antennas, and each wireless access point receives multiple antenna signal strength data of a signal sent by each antenna of the client to be detected; when the client to be detected only has one antenna and the number of the antenna signal intensity data of each wireless access point for receiving the signal sent by each antenna of the client to be detected is one, the antenna signal intensity data is equally divided into a plurality of antenna signal intensity data.
The data collected by the invention is based on multiple antennas, namely when the client to be detected is a 1x1 antenna, the collected antenna signal intensity data is processed. The specific processing method is that the antenna signal strength data of each wireless access point received by the 1x1 antenna is equally divided into a plurality of parts with the same number as the channels of the input data layer of the positioning model.
In the present invention, a 2x2 antenna is taken as an example, the signal data strength of one channel of 1x1 is divided by 2, and the data is expanded into two channels of data, for example, if the AP1 and the STA2 are-20 dBm, the power is divided by 2 (logarithmically, minus 3dB), which is-23 dBm.
Fig. 4 is a schematic diagram of a WiFi positioning server according to the present invention. As shown in fig. 4, preferably, as shown in fig. 4, the method further includes: the training module 400 is configured to train a deep neural network in advance, and use the trained deep neural network as the positioning model.
Specifically, the method can include two specific implementation modes according to different output results obtained by positioning, wherein the mode is to output a certain preset classification probability value of the position of the client to be detected through the deep neural network as a positioning model, and the mode is to directly output the preset position coordinate of the position of the client to be detected through the deep neural network as the positioning model. The present invention is not limited to the specific training mode.
The invention adopts a supervised global parameter training method: knowing that the actual position of the signal intensity data corresponding to each wireless access point belongs to a certain preset training position label, the output of the network layer of the deep neural network is the same as the real result by continuously adjusting the network parameters.
Preferably, the training module 400 further comprises: a label presetting submodule 411 for presetting a training position label for training; a training data set generation submodule 412, configured to respectively acquire data of signal strengths of multiple antennas of each wireless access point receiving a signal sent by a training terminal in a detection area at each training position tag; generating training sample data according to a plurality of antenna signal intensity data of signals sent by a plurality of antennas of a training terminal in a detection area of each training position tag, generating a training data set by all the training sample data, and sending the training data set into a deep neural network; the data input layer defining submodule 413 is used for defining an input data layer of the deep neural network as a multi-channel data layer, the number of channels of the multi-channel data layer is the same as the number of antennas of the training terminal, and nodes of the multi-channel data layer correspond to each wireless access point; a training prediction submodule 414, configured to input, into multiple channels of a corresponding node, multiple antenna signal strength data, which is signaled by multiple antennas of a training terminal, received by each wireless access point in each training sample data, according to a manner that a node of a multi-channel data layer corresponds to a wireless access point, output a training result corresponding to the training position label in the training sample data through the deep neural network, sequentially compare the output training result with the corresponding training position label, train the deep neural network according to the comparison result, and use the trained deep neural network as the positioning model.
It should be noted that, for the above-mentioned training process of the training module 400, the method of the present invention is explained in part for training the deep neural network, and will not be repeated here. The information interaction, execution process and other contents between the modules in the server are based on the same concept as the method embodiment, and specific contents can be referred to the description in the method embodiment of the present invention, and are not described herein again.
The information interaction, execution process and other contents between the modules in the server are based on the same concept as the method embodiment, and specific contents can be referred to the description in the method embodiment of the present invention, and are not described herein again.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.