Background
The economy of China is always in a state of high-speed development after reform is opened, the living quality of people is improved day by day, cars are driven into the gates of households, great convenience is brought to people's traveling, and meanwhile, the problems of car parking and parking lot management are severe day by day.
As a main place for urban parking, a parking lot is a key breakthrough for solving the problem of urban parking difficulty. The construction of a large number of the parking lots is promoted, enough parking spaces are provided for parking demanders, the problem of difficulty in parking can be effectively solved, however, the parking resources cannot be fully and effectively utilized due to the fact that the parking management technology of the parking lots is restricted, and the difficulty in expanding the parking lots is greatly increased.
on the other hand, in the aspect of parking space detection, a detection module is arranged on each parking space at present, so that the difficulty is increased on the cost ② the construction complexity of the parking space, ② the accurate position of a user in the parking space cannot be provided for the user in the current urban parking space, so that the user can conveniently find the optimal parking space, ② unnecessary resource consumption is increased.
The intelligent parking lot parking guidance system has the advantages that the problems of improving the operation efficiency and the parking space utilization rate of the urban parking lot, relieving the problems of road congestion, parking difficulty, high parking lot construction and management cost and the like in the automobile development socialization process are solved, a key effect is achieved, and the step of researching and developing the intelligent parking lot parking guidance system is promoted.
In the aspect of parking stall detection, the following several technologies are mainly used in the present parking lot:
1) induction coil detection technique
The principle is that a voltage is added to the coil to generate corresponding current, a magnetic field is generated through the current, when a vehicle passes through, metal parts of a vehicle body can interfere the magnetic field to cause the inductance change of the coil, and finally the electronic equipment is used for detecting the change of the parking space state, and the system can realize the update of the parking space state according to the detection result. The technology is also applied to vehicle detection at present, and can identify the vehicle type[3]. This technique, while reliable and inexpensive, can disrupt the road surface during construction and affect traffic.
2) Ultrasonic testing technique
The technology is that an ultrasonic detector is arranged at the top of each parking space, and the duty information of the parking spaces is measured by measuring the transmitted waves. The detector transmits ultrasonic waves in a directional mode, part of transmitted energy of the ultrasonic waves meets the road surface and the surface of the vehicle body and is reflected to the receiving end of the detector, and the state information of the parking space can be obtained after processing. When the vehicle enters the ultrasonic wave transmitting range, the ultrasonic wave is reflected to the receiver from the top of the vehicle, and the distance between the ultrasonic wave and the receiver transmitted from the ground is inconsistent, so that a signal for detecting the vehicle entering the garage is generated.
3) Infrared detection technology
The infrared detection technology is divided into an active infrared detection technology and a passive infrared detection technology. The active infrared detection technology is similar to the ultrasonic detection technology, an infrared light source is adopted to emit infrared rays to a measuring parking space, and when the infrared rays meet a vehicle, a part of energy can be reflected to a receiver, so that the state information of the parking space can be provided. The passive infrared detection technology is used for judging the duty information of the parking space by detecting the difference between the infrared radiation of the external environment and the infrared radiation of an automobile engine through a detector, and the detection effect of the detection technology is not ideal.
4) Geomagnetic sensing detection technology
The geomagnetic sensing technology is used for detecting parking space duty information by using the change of a geomagnetic field when a ferromagnet (an iron and steel part of an automobile) passes through, and a geomagnetic sensor can accurately detect the change of the strength and the direction of the geomagnetic field of 1/10000. The intensity of the geomagnetic field before and after parking of the parking space is different, so the geomagnetic sensor can detect the state information of the parking space. The detection technology is not influenced by weather, is convenient to install and maintain, does not need to seal a lane and damage the road surface, and only needs to provide a support to be installed at the top of a parking space.
Since the geomagnetic sensor is very sensitive to the variation of the geomagnetic field intensity and is not easily affected by the environment (such as rain, snow, wind fog, etc.), it is recently widely used in parking detection. E.sifuents, o.casas, r.pallas-Areny, etc. propose and realize a method for detecting a parking space using a wireless sensor network node of a wake-up mechanism, the wireless sensor network node used by them is composed of a geomagnetic sensor and an optical remote sensor, the optical remote sensor can detect the reduction of illumination caused by the arrival of a vehicle or other objects, once an object approaches, the optical remote sensor can wake up the geomagnetic sensor to detect the parking space, and the consumption of electric energy of the node can be further reduced by adopting the method. Xiangke Guan, Zusheng Zhang et al propose a relative extreme value parking stall detection algorithm based on wireless magnetic sensor network, this is proposed on the basis of extremely small algorithm, their detecting system through half a year of test, the probability of successful detection can reach 98.8%.
At present, the geomagnetic sensor is used for detecting the parking spaces, so that a node needs to be arranged in each parking space, and cost is undoubtedly not considered fully.
In the current intelligent parking lot guidance system, a user positioning function is not provided, and an indoor positioning technology is not applied to the intelligent parking lot guidance system. At present, the WiFi position fingerprint indoor positioning method based on the received signal strength is widely applied to indoor positioning, and a lot of scholars also do a lot of research on the WiFi position fingerprint indoor positioning algorithm based on the received signal strength.
In 2000, microsoft proposed an indoor positioning system called RADAR, which was the earliest positioning system using WiFi signals as the basis for positioning. The system collects the received signal strength values of all WiFi nodes at certain reference position points in the WiFi signal coverage range, the reference node coordinates and all the received signal strength values form a fingerprint, and finally a plurality of fingerprints are stored in a database to form a fingerprint database. After the fingerprint database is built, in an online positioning stage, a terminal to be positioned collects received signal strength values of surrounding visible WiFi nodes to form a group of associated signal observation values. And finally, matching the data in the fingerprint database by using an NN algorithm, and selecting the most matched estimated position, namely the positioning position.
At present, algorithms applied to WiFi position fingerprint indoor positioning based on received signal strength mainly comprise NN and KNN algorithms. In the positioning process, the WiFi signal strength of the reference node is sampled and a fingerprint database is established in an off-line stage, and then position matching is performed in an on-line stage. The NN algorithm (nearest neighbor algorithm) selects the matching result with the minimum Euclidean distance as the positioning result, and the KNN algorithm (K-nearest neighbor algorithm) selects the K matching results with the minimum Euclidean distance, and then uses the centroid algorithm to find the centroid of the K matching results as the final positioning result. Zhang Xiaoliang, Zhao Ping et al propose an optimized KNN algorithm, which can effectively reduce the calculation amount in the positioning process on the premise of ensuring the accuracy of indoor positioning of the position fingerprint. Luchanghui, Liuxingchua, Zhanghuan, Linxiakang and the like compare WiFi positioning based on a triangle and a position fingerprint identification algorithm, and research results show that compared with WiFi positioning based on a triangle algorithm, WiFi positioning based on a position fingerprint identification algorithm has the advantages of being high in usability and improving positioning accuracy greatly, and under the experimental environment, the positioning accuracy can be improved by 92.08% to the maximum extent. In the future, an indoor positioning technology based on WiFi is applied to the museum, so that audiences can control the visiting rhythm by themselves, the defects of the traditional manual explanation mode of the museum are overcome, the contradiction between the protection and the display of the museum with the preserved goods for a long time is solved, the informatization management of other services of the museum is driven, and the working efficiency is improved. At present, the WiFi indoor positioning technology can only ensure that 50% -60% of possible errors are within 2m, the accuracy is still to be improved, and the defect of large errors exists.
Disclosure of Invention
The technical problem to be solved by the invention is to overcome the defects of the prior art and provide an indoor parking lot navigation method based on the fusion of WiFi and sensor network technologies.
The invention adopts the following technical scheme for solving the technical problems:
according to the indoor parking lot navigation method based on the fusion of the WiFi and the sensor network technology, the indoor parking navigation is carried out by combining the parking space state information detection and the user positioning, wherein:
the parking space state information detection steps are as follows:
step one, arranging n geomagnetic sensor nodes in a parking lot, arranging a geomagnetic sensor node between every two adjacent parking places, wherein the adjacent parking places on two sides of a qth geomagnetic sensor node are a qth parking place and a qth +1 parking place respectively; wherein q is an integer and is more than or equal to 1 and less than or equal to n, and the direction of the parking space pointing to the center of the ground is set as l1The direction of the q +1 th parking space pointing to the q th parking space is l2Direction;
step two, setting l for the positions of the n geomagnetic sensor nodes in advance respectively1Threshold value a of directional geomagnetic field intensityq、l2Threshold value b of directional geomagnetic field strengthq;
Step three, initialization, wherein each geomagnetic sensor node respectively detects l2Intensity of directional geomagnetic fieldl1Intensity of directional geomagnetic field
Step four, each geomagnetic sensor node respectively detects current l1Directional geomagnetic field intensity value ZMagqCalculating current and initialized l1The difference in the strength of the directional earth magnetic field is
Step 401: if it is notEntering the step five;
step 402: if it is notEntering a sixth step;
step five, each geomagnetic sensor node respectively detects current l2Directional geomagnetic field intensity value YMagqCalculating current and initialized l2The difference in the strength of the directional earth magnetic field is
Step 501: if it is notIf so, the vehicle enters the q-th parking space, and the q-th parking space is parked; returning to the third step;
step 502: if it is notIf so, a vehicle enters the (q + 1) th parking space, and the (q + 1) th parking space is parked; returning to the third step;
step six, respectively detecting current l by adopting each geomagnetic sensor node2Directional geomagnetic field intensity value YMagqCalculating current and initialized l2The difference in the strength of the directional earth magnetic field is
Step 601: if it is notIf so, the vehicle leaves the q-th parking space, and the q-th parking space is empty; returning to the third step;
step 602: if it is notIf so, the vehicle leaves the (q + 1) th parking space, and the (q + 1) th parking space is empty; returning to the third step;
the user positioning steps are as follows:
step A, setting n geomagnetic sensor nodes in a parking lot, and setting a geomagnetic sensor node between every two adjacent parking spaces;
b, establishing a position fingerprint database in an off-line training stage; the method comprises the following specific steps: in the parking lot, setting positions at intervals of a preset distance as reference positions, traversing the reference positions, simultaneously collecting WiFi position fingerprint characteristics at each reference position, and storing the WiFi position fingerprint characteristics into a position fingerprint database; partitioning the position fingerprint database according to the area detected by the geomagnetic sensor node;
step C, in an online positioning stage, firstly, WiFi information of the position of the user is collected, then, data collected by the geomagnetic sensor node are analyzed to detect the area of the user, a position fingerprint database of the area corresponding to the area of the user is matched with the collected WiFi information, and the initial position of the user is calculated by adopting a nearest neighbor algorithm or a K nearest neighbor algorithm;
and D, correcting the initial position to the specific direction of the lane where the vehicle is located by adopting a projection principle, and feeding back the projection serving as a final positioning position to the user.
As a further optimization scheme of the indoor parking lot navigation method based on the fusion of WiFi and sensor network technologies, the inventionZMagi、YMagiThe image de-jittering processing is achieved through a smooth filtering mode.
As a further optimization scheme of the indoor parking lot navigation method based on the fusion of WiFi and sensor network technologies, the WiFi position fingerprint characteristics comprise the MAC address of a WiFi node, a received signal strength value and position coordinate information of a reference point.
As a further optimization scheme of the indoor parking lot navigation method based on the fusion of the WiFi and the sensor network technology, the preset distance in the step B is 1 meter.
As a further optimization scheme of the indoor parking lot navigation method based on the fusion of WiFi and sensor network technologies, the geomagnetic sensor node is an HMC584 geomagnetic sensor.
Compared with the prior art, the invention adopting the technical scheme has the following technical effects: the parking space detection part of the system detects the state of the parking space by adopting the geomagnetic sensor node, and compared with the traditional detection method, the parking space detection method has the advantages of low cost, simplicity in installation and the like. The integration positioning part adopts the integration positioning technology based on the geomagnetic sensor node and WiFi, can utilize the existing geomagnetic sensor resource in the parking lot to carry out the integration positioning, greatly improves the positioning precision, provides the accurate position of the vehicle in the parking lot, and can help the user to park quickly by combining the empty parking space information provided by the parking space detection technology.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the attached drawings:
the system structure of the invention is shown in fig. 1, and comprises a parking space detection module and a fusion positioning module. The parking space detection module is responsible for collecting parking space information and providing empty parking space information for a user; the fusion positioning module is responsible for providing a vehicle positioning function, providing specific positions of the user in the parking lot for the user, and facilitating the user to find the best parking space.
The parking space detection module of the invention adopts the geomagnetic sensor to detect the duty information of the parking space, wherein, taking the detection of two adjacent parking spaces by a single node as an example, the nodes of the geomagnetic sensor are deployed as shown in fig. 3. In the detection process, firstly, data collected by each geomagnetic sensor node are preprocessed, when a vehicle stops in a parking space or leaves the parking space, the geomagnetic field intensity in the region is affected, the geomagnetic sensor nodes are used for detecting the geomagnetic field intensity, and the parking space detection algorithm designed by the invention is used for detecting the state information of the parking space. According to the deployment direction of the geomagnetic sensor nodes in the parking space detection algorithm, the parking space is detected by adopting the corresponding uniaxial geomagnetic field strength.
The fusion positioning module uses a fusion indoor positioning algorithm based on a geomagnetic sensor and WiFi for positioning, the algorithm uses a WiFi position fingerprint indoor positioning method for preliminary positioning, and the existing geomagnetic sensor network is used for optimizing the preliminary positioning result of the WiFi position fingerprint indoor positioning method so as to further improve the positioning precision.
The data collected by the geomagnetic sensor nodes are subjected to debouncing processing, the data collected by each geomagnetic sensor node is the geomagnetic field intensity in the three-axis direction at the position where the geomagnetic sensor node is located, and as shown in fig. 2, the unit of the geomagnetic field intensity collected by the nodes is mcause. The intensity of the geomagnetic field isWherein XMag, YMag, ZMAG are the magnetic field intensity on the X-axis, Y-axis and Z-axis respectively. This value will fluctuate due to the influence of environmental noise, and in order to prevent detection errors caused by jitter, a smoothing filtering method is used to remove jitter. The geomagnetic intensity after each smoothing is:
where i is 1,2,3 …, which is the number of times the geomagnetic sensor collects the geomagnetic field intensity, G (i) is the geomagnetic field intensity value collected by the geomagnetic sensor at the ith time, L is the window width of the smoothing filter, and a (i) is the magnetic field intensity value after the debounce process.
In the setting of the parking space detection threshold value, the geomagnetic field strength value at each position in the parking lot is different, so that an empirical value cannot be obtained as the threshold value, and after the difference of the geomagnetic field strength before and after the parking of the node is analyzed, the threshold value is set by taking the difference of the geomagnetic field strength values before and after the parking of the detection area of each node as a reference. In the system, the parking spaces are detected in the corresponding axial direction according to the placement position of the geomagnetic sensor nodes. Here, taking the location of the geomagnetic sensor node shown in fig. 3 as an example, the change in the geomagnetic field intensity in the Z-axis direction is used to determine whether the vehicle is parked or leaving the parking space. Here, a threshold value is needed to be set for judging the change of the intensity of the Z-axis geomagnetic field and eliminating the influence of noise. Here, the change in the geomagnetic field intensity in the Y axis direction is used to determine whether the vehicle is parked (or separated) at the node to the left (space 1) or the right (space 2). Also here, a threshold value is set for determining the change of the intensity of the earth magnetic field in the Y-axis direction, so as to eliminate the influence of noise.
The parking space detection algorithm adopts a mode of detecting the intensity of a Y-axis geomagnetic field and the intensity of a Z-axis geomagnetic field (specifically, the intensity of a certain axial geomagnetic field is used for parking space detection and is related to node arrangement, as shown in fig. 3), the intensity of the Y-axis geomagnetic field is used for distinguishing the leaving and parking of a vehicle, the intensity of the Z-axis geomagnetic field is used for leaving (parking) a left parking space or a right parking space of the vehicle, a threshold value is required to be set when the intensities of the two axial geomagnetic fields are detected, and a corresponding action is indicated when the intensities of the two axial geomagnetic fields exceed the threshold values. Here, the threshold value for detecting the magnetic field intensity of the Z-axis is a, the threshold value for detecting the magnetic field intensity of the Y-axis is b, and the detection algorithm comprises the following steps:
step 1: initializing, detecting Y, Z axial geomagnetic field intensity, recording Y-axis magnetic field intensity Mean value YMag _ Mean, recording Z-axis magnetic field intensity Mean value ZMag _ Mean, and entering step 2;
step 2: detecting the current Z-axis magnetic field intensity value ZMAG, and calculating ZMAG-ZMAG _ Mean;
step 201: if ZMAG-YMag _ Mean > a, a vehicle enters a parking space, and the step 3 is carried out;
step 202: if the ZMAG-YMag _ Mean is less than a, a vehicle leaves the parking space, and the step 4 is carried out;
and step 3: detecting the current Y-axis magnetic field intensity value YMag, and calculating YMag-YMag _ Mean;
step 301: if YMag-YMag _ Mean < b, the vehicle enters the parking space 1, the step 1 is carried out, and the parking space information is returned to the user;
step 302: if YMag-YMag _ Mean > b, the vehicle enters the parking space 2, the step 1 is carried out, and the parking space information is returned to the user;
and 4, step 4: detecting the current Y-axis magnetic field intensity value YMag, and calculating YMag-YMag _ Mean;
step 401: if YMag-YMag _ Mean > b, the vehicle leaves the parking space 1, enters the step 1 and returns the parking space information to the user;
step 402: if YMag-YMag _ Mean < b, the vehicle leaves the parking space 2, enters the step 1 and returns the parking space information to the user;
according to the peak value detection algorithm, when a vehicle bypasses a node, the intensity of the geomagnetic field at the node is shaken strongly once, and an obvious peak can be seen in an oscilloscope. In the algorithm, firstly, the original data is subjected to de-jitter processing, the waveform is smoothed, and then the peak value is judged, wherein 2 times of the influence of noise in the environment on the geomagnetic field intensity is taken as a threshold value for peak value detection, namely all peak values are higher than an average value, and the difference value is the threshold value. Due to the limitation of the length and the speed of the vehicle, only one vehicle passes through the 1s at most, so that only one peak can be generated, and therefore, in the data collected for the 1s in the algorithm, if a plurality of peaks occur, only the largest one is taken. When a vehicle passes through a certain node, the passing of the vehicle can be detected by adopting a peak detection algorithm, and the area where the vehicle is located can be known according to the deployment position of the node. In this scheme, the geomagnetic sensor nodes are distributed on two sides of the two lanes, as shown in fig. 10, the numbers of the nodes close to the left lane are odd numbers, the numbers of the nodes close to the right lane are even numbers, and when the vehicle passes through the geomagnetic sensor, the lane where the vehicle is located can be judged according to the numbers of the nodes. In the fusion positioning stage, a corresponding fingerprint library can be selected according to the area where the vehicle is located to perform position matching, and the matching result is corrected according to the lane where the vehicle runs, so that the positioning accuracy is improved.
The fusion indoor positioning algorithm based on the geomagnetic sensor and the WiFi is based on the WiFi position fingerprint indoor positioning method, and fusion is carried out by utilizing the existing geomagnetic sensor network of the parking lot parking space detection module. The WiFi position fingerprint indoor positioning method comprises two stages, namely an off-line training stage and an on-line positioning stage.
Off-line training phase
The purpose of this stage is to establish a location fingerprint database in the server, in the parking lot, every other meter location is set as a reference location, traverse these reference locations and collect the received signal strength value from the existing WiFi node at each reference location, and form an associated triple data of the MAC address, the received signal strength value and the location coordinate information of the reference point of each WiFi node into a location fingerprint database. The position fingerprint database is partitioned according to the area detected by the geomagnetic sensor, and the size of the partition unit is the size of the lane area shown in fig. 3.
On-line positioning stage
The corresponding position fingerprint library provided by the geomagnetic sensor is based on that when the vehicle passes by the geomagnetic sensor, the geomagnetic field intensity at the geomagnetic sensor has an obvious jitter. Therefore, by adopting a peak detection algorithm, the geomagnetic sensor can detect the passing of the vehicle in real time, so that the area where the vehicle is located is obtained, and the position fingerprint library area matching of the corresponding area is adopted during online matching. The lane where the vehicle is located can be judged according to the number of the node where the vehicle passes, the position of the matching result can be corrected according to the lane where the known vehicle runs, and the position where the vehicle is located is finally obtained.
In a positioning area, a user needing positioning uses an android mobile phone provided with positioning software of the system to acquire received signal strength values of all WiFi nodes in real time, an MAC address and the received signal strength values form a binary group which is used as input data of a position matching algorithm, the specific matching algorithm is matched with a corresponding position fingerprint database provided by a geomagnetic sensor to estimate the initial position of the user, and an NN (nearest neighbor algorithm) algorithm or a KNN (K-nearest neighbor algorithm) algorithm is adopted.
The lanes are dual lanes, and the vehicle may travel in the left lane and the right lane, and in order to improve the positioning accuracy, the lane on which the vehicle travels needs to be detected for further position correction. In the scheme, the lane on which the vehicle runs is determined according to the number of the vehicle passing node. The algorithm steps are as follows:
step 1: initializing a system;
step 2: waiting for a positioning request;
step 201: receiving a positioning service request of a user, and entering step 3;
step 202: if the positioning service request of the user is not received, entering the step 2;
and step 3: acquiring a binary group consisting of the MAC address of each WiFi node scanned by a user and a received signal strength value, and entering the step 4;
and 4, step 4: detecting the area of the vehicle by the geomagnetic sensor network, acquiring a corresponding position fingerprint database, matching the binary groups with position fingerprints in the position fingerprint database, estimating the initial position of the user by adopting an NN (neural network) algorithm or a KNN (K nearest neighbor) algorithm, and entering step 5;
and 5: searching information of vehicle passing nodes in the geomagnetic sensor network, detecting geomagnetic intensity change of an X-axis direction (determined according to the arrangement position of the geomagnetic sensor) of a geomagnetic sensor in a region where the vehicle is located, detecting passing of the vehicle through a peak detection algorithm, judging whether the number of the passing nodes is used for obtaining a specific direction (a left lane or a right lane) of a lane where the vehicle is located, and entering step 6;
step 6: correcting the initial position to the specific direction of the lane where the vehicle is located by adopting a projection principle, feeding back the projection as a final positioning position to a user, and entering the step 2;
the indoor parking lot navigation system with the WiFi and sensor network technology integrated mainly comprises a parking space detection module and an integrated positioning module, data collected by a geomagnetic sensor are transmitted through ZigBee and transmitted to a server through a serial port, and the server processes the collected data to update parking space duty information. The user acquires parking space information and position information by installing client software on an android smart phone carried by the user. In the positioning stage, a user scans MAC addresses and received signal strength values of all WiFi nodes around through a mobile phone, scanning information is formed into a binary group and is sent to a server through a WiFi network, the server calculates the position of a vehicle according to the information and a fusion positioning algorithm of the invention and feeds the position back to the user, the user checks the position of the vehicle through the mobile phone and finds an optimal parking space according to the position, and the structure diagram of the system is shown in figure 1.
The type of the geomagnetic sensor adopted by the geomagnetic sensor node is HMC584, the geomagnetic sensor is a triaxial geomagnetic sensor and can detect the change of the intensity and the direction of the earth magnetic field 1/10000, and the numerical unit is mGause. The sampling rate of the geomagnetic sensor in the present system is 10 hz. Fig. 4 shows the magnitude change of the noise influence of the geomagnetic field intensity and the geomagnetic field intensity triaxial data acquired by the geomagnetic sensor in the real environment. It can be seen that there is a jitter of ± 10, which has a certain error effect in the parking space detection, so that the jitter is removed by using a preprocessing method of smoothing filtering, as shown in formula (1), where L is 50. The effect after pretreatment is shown in fig. 5.
Actually, the width of each parking space is measured to be 2.5m, the length is measured to be 5m, the lane is a double lane, and the lane width is measured to be about 6 m. The parking space detection module of the system judges the state information of the parking space (whether the parking space has a car) through the geomagnetic field intensity change of the parking space before and after the parking is carried out at the parking space. Here, the geomagnetic sensor node is deployed in the middle of two adjacent parking spaces in the parking lot, as shown in fig. 3, a single geomagnetic sensor node is used for monitoring the states of the two parking spaces, and therefore the node consumption cost is reduced. In the actual test, the geomagnetic field intensity before and after two adjacent parking spaces are parked is analyzed, and an analysis result graph is shown in fig. 6. Multiple times of experimental data show that the intensity of the geomagnetic field in the Z axial direction can be influenced when the vehicle is parked in a garage or leaves the parking space. Here, by adopting the node placement mode shown in fig. 3, the intensity of the Z-axis geomagnetic field is increased when the vehicle is parked and stored, and the intensity of the Z-axis geomagnetic field is decreased when the vehicle leaves a parking space. Therefore, a threshold value a is set, i.e. the difference between the magnetic field intensity of the Z-axis after parking and before parking (before leaving the parking space and after leaving the parking space) exceeds the threshold value, so that it can be determined that a vehicle is parked (a vehicle leaves). When the vehicle is parked in the parking space 1 shown in fig. 3, the geomagnetic field intensity value in the Y axis direction is increased, and when the vehicle is parked in the parking space 2, the geomagnetic field intensity value in the Y axis direction is decreased, so that the situation of leaving the parking space is opposite, and the actual data analysis is shown in fig. 7. Therefore, a threshold value b is also set here to determine whether the vehicle is parked (leaving) in space 1 or space 2.
The invention combines parking space state information detection and user positioning to carry out indoor parking navigation, and can generate a navigation path according to the parking space state information and the user positioning information to carry out indoor parking navigation.
In the system, the parking space information is displayed on the mobile phone client in real time through the WiFi network of the parking lot and is used for searching for an empty parking space. And the parking space information is stored in a MySQL database.
The node for detecting two parking spaces is deployed at the front end part in the middle of the two parking spaces, as shown in fig. 3. The parking lot is provided with a plurality of adjacent parking units shown in fig. 3, and the storage mode of each unit in the database is shown in table 1 and comprises a unit number, a node number, a parking space 1 state, a parking space 2 number and a parking space 2 state. Similar to six-stall detection, the threshold values a and b are analyzed and obtained in actual data.
TABLE 1
In the actual test, the measurement of the detection error was performed twice depending on the difference in the air temperature, and the measurement results are shown in table 2.
TABLE 2
Air temperature |
Number of actual stops |
Number of correct detections |
Accuracy rate |
18 degree centigrade |
300 |
294 |
98% |
-4 degrees Celsius |
215 |
212 |
98.6% |
In the invention, a convergence indoor positioning method of a geomagnetic sensor and WiFi is adopted in a convergence positioning module, the WiFi network used for establishing the WiFi fingerprint database is the existing WiFi node, and the WiFi network used for the communication between the client and the server in the on-line positioning stage is used.
The off-line training stage server adopts a MySql database to store and manage a WiFi fingerprint database, a Java language is used for writing a data operation program of the WiFi fingerprint database of the server, a millet 1S (android4.0) mobile phone is used for collecting the fingerprints of the WiFi positions, and the size of a parking lot is 40m x 80 m. When the fingerprint database is established, every 1m of places in the parking lot are used as reference positions, position fingerprint data are collected at each reference position and stored in the fingerprint database. The data format consists of the MAC address of each WiFi node, the received signal strength value, and the location coordinate information of the reference point. The received signal strength values of all WiFi nodes are collected every 2s at each reference position, due to the instability of WiFi signals, the WiFi nodes which are far away from the reference position and have weak signals cannot be collected every time, therefore, the WiFi nodes which are collected for 10 times and have the collection times less than 7 times are eliminated, finally, the received signal strength values of the WiFi nodes which are not eliminated are averaged, and the average value is used as the received signal strength value of the WiFi node and is stored in a fingerprint database.
And in the online positioning stage, the server side writes a positioning service program by using java language, and a user uses an android mobile phone provided with a client side to collect the received signal strength values of all WiFi nodes in a parking lot in real time and sends a binary group consisting of the MAC address and the received signal strength values to the server. The server acquires the area of the vehicle through the detection information of the geomagnetic sensor network, and matches the binary group by adopting a corresponding position fingerprint database to obtain a preliminary estimated position. And acquiring a lane where the vehicle runs according to the detection information of the geomagnetic sensor, and correcting the preliminary estimated position by using a projection method, as shown in fig. 10, to obtain the exact position of the user vehicle and feed back the exact position to the user. The fusion positioning method comprises an off-line stage and an on-line stage, and the schematic diagrams are shown in fig. 8 and fig. 9.
The user vehicle position is initially located by using a nearest neighbor and K-nearest neighbor position matching algorithm, and the nearest neighbor position matching algorithm (NN) is the most basic deterministic position fingerprint matching algorithm and is firstly proposed in the RADAR location system of Microsoft. The method is a matching method based on analogy learning, and similarity matching is carried out by using a sampling sample in an online positioning stage and a sampling sample in an offline training stage. And (3) the mean value of the received signal strength in the training stage is called as a position fingerprint, the Euclidean distance is used for describing the similarity between the positioning fingerprint and the position fingerprint, and finally, the position fingerprint with the highest similarity is taken as an estimated position.
Defining the measurement vector of the on-line received signal strength value at the time t as RtAnd the fingerprint vector at the reference point j in the fingerprint databaseThe Euclidean distance (c) is shown in formula (2):
wherein, and representing the average value of the received signal strength from the n WiFi nodes at the reference point j in the WiFi fingerprint database. Finally, the estimated position is the point with the minimum Euclidean distance, as shown in formula (3):
meanwhile, due to the fact that a plurality of interference factors of the environment have large influence on the received signal strength value of the WiFi node, a K neighbor algorithm (KNN) is provided, K reference points with small distance in a formula (4) are selected, the mean value of K reference position coordinates is obtained, and the mean value is used as the final estimated position;
Locationjand matching the jth position of the K Euclidean distance minimum positions for the K neighbor algorithm.
In the geomagnetic sensor network, the position coordinates of each geomagnetic sensor in the parking lot are known, and when the user drives through the geomagnetic sensors, the geomagnetic field intensities at the geomagnetic sensors vary as shown in fig. 11. The intensity of the geomagnetic field on the X axis is detected through a peak detection algorithm, the fact that the user vehicle passes through the node can be judged in real time, the area where the user vehicle is located can be detected in real time, and the position fingerprint database of the corresponding area is selected to match position information, so that a primary positioning result of fusion positioning is obtained. In the embodiment of the scheme, the geomagnetic sensors are numbered according to the node positions of the geomagnetic sensors, so that the vehicle can be detected only by the nodes numbered with odd numbers when running on a left lane, and similarly, the vehicle can be detected only by the nodes numbered with even numbers when running on a right lane, and therefore, the lane on which the vehicle runs can be detected in this way. When the specific direction of the lane where the vehicle is located is detected, the preliminary positioning result of the fusion positioning method can be corrected and projected to the specific direction of the lane in a projection manner, as shown in fig. 12 (it is assumed that the vehicle is detected to pass through the middle of the lane).
Let the coordinates of both ends of the lane where the vehicle is located be (x)1,y1)、(x2,y2) The initial positioning position of the fusion positioning method is (x)3,y3) And the final positioning result of the fusion positioning method is to project the initial positioning result to a projection point on the specific direction of the lane where the vehicle is located, and the result is set as (x, y), which can be solved by the following equation system:
in the invention, the NN algorithm and the KNN algorithm are respectively compared with the fusion indoor positioning algorithm based on the geomagnetic sensor and the WiFi in an actual scene, and in the analysis of 189 positioning results, the positioning scheme fused by the geomagnetic sensor and the WiFi position fingerprint positioning method can greatly improve the positioning accuracy, and the positioning effect is shown in fig. 12 and 13.
The foregoing has described only preferred embodiments of the present invention. Other advantages and modifications will readily occur to those skilled in the art from the foregoing description. Therefore, the present invention is not limited to the above embodiments, and one aspect of the present invention will be described in detail and exemplarily by way of example only. General changes and substitutions by those skilled in the art within the technical scope of the present invention are included within the scope of the present invention within the scope not departing from the gist of the present invention.