ACCURATE GUIDANCE METHOD AND APP DEVELOPMENT FOR ASSIGNING PARKING SPACES BASED ON INDOOR WI-FI

Existing parking guidance systems only provide road guidance outside the parking lot but do not provide accurate guidance to specific parking spaces inside the parking lot. By using a Kalman filter, the Grubbs test, and a neural network algorithm to improve the RSSI-based location fingerprint identification technology, an accurate location method based on indoor Wi-Fi is obtained, which implements precise route guidance and a reverse search function for parking spaces. We utilize Beidou positioning to develop a Gaode map for outdoor navigation and use an integrated system of ultrasonic detector/ indicators and ground locks to manage parking spaces. Through the secondary development of an Android system and the application of a MySql database, an app for precise parking guidance was developed. The system makes full use of the Internet and parking information, eliminates information asymmetry, improves the utilization ratio of the urban static traffic resources, allocates parking spaces in real-time, breaks information islands, provides parking search and recommendation functions for users, achieves parking information-sharing, and effectively improves parking efficiency and the parking utilization ratio.


INTRODUCTION
Since the introduction of the automobile, the efficiency and quality of life have been greatly improved. Therefore, the automobile industry has boomed worldwide. According to the statistics from the World Automobile Organization (OICA), in 2005, the number of vehicles in use in the world was 890 million, and this number increased to 1.097 billion in 2010. By 2015, the number of vehicles in use in the world had grown to 1.282 billion. In recent years, the number of motor vehicles has increased rapidly in some developing countries. For example, with the rapid development of China's economy and the acceleration of the urbanization process, the number of motor vehicles in China reached 327 million by the end of 2018, 240 million of which were automobiles. According to the experience of the international urban construction, cloud-based smart vehicle parking system (SVPS) that provided intelligent parking guidance for vehicles on ubiquitous VANETs. According to the scheduling factor of the SVPS algorithm, two kinds of parking performance functions, namely, reservation and recommendation, were implemented, and parking induction was realized by these parking performance functions [8]. Thomas and Kovoor proposed an intelligent vehicle self-parking system based on a genetic algorithm, which improved the parking efficiency of a shopping center, reduced the waiting time, and alleviated the problem of parking space scarcity and vehicle scheduling [9]. Jin and Monica proposed a method based on the probability theory and a macro parking model to evaluate the time saved by parking using an intelligent parking service. To illustrate the method, an example of a parking application in the urban area of Zurich, Switzerland, was provided. Smart parking services could save up to 15.6 hours of parking time during a typical working day [10]. Geng and Cassandras proposed a real-time parking space monitoring system. After receiving a parking request, the system searched for the nearest parking space by analyzing the images collected by a traffic recorder and then returned the location to the driver who had issued the parking request. The vehicle navigated to the available parking space through the built-in Google Maps software [11]. Yu proposed a design scheme for an intelligent parking lot system based on the iBeacon technology [12]. Yue and Jin used an Android smartphone as the client, using the Wi-Fi and Dijkstra shortest path algorithm to realize route guidance in an indoor parking lot [13]. Jiang et al. designed a reverse search system for large underground parking lots with AR technology using a video image recognition technology and a Wi-Fi positioning technology [14]. There are similar apps in multiple countries, including Parking PepsiCo, Parkeme, etc., but existing parking apps only focus on area guidance outside the parking lot and do not focus on precise guidance inside the parking lot. Therefore, this paper proposes a precise Wi-Fibased parking space guidance method. Based on the precise positioning method studied, the "parking space precise guidance" app is developed, which makes full use of intelligent parking equipment to provide users with parking space searches and recommendations, share parking information, and effectively improve the utilization rate of parking facilities.
the number of parking spaces should be increased. The number of vehicles owned is 1.1 to 1.2 times the number of parking spaces [1]. If the number of vehicles owned is estimated as 1.1, the theoretical demand for parking spaces in China is expected to reach 30.936 million by 2020.
To increase the number of parking spaces, indoor parking lots in many large shopping malls often have several floors, which makes it difficult to find parking spaces indoors, leading to chaos in the parking lot [2]. An intelligent and accurate parking guidance system integrated into the Internet is an important measure to solve the low utilization rate of parking spaces and the difficulty of finding parking spaces. Leephakpreeda proposed a decision-making method of parking guidance based on fuzzy knowledge. The characteristics of parking spaces were defined by a fuzzy language set, and the optimal characteristics for guiding drivers into parking spaces were determined by an orderly weighted average to find the best parking spaces [3]. Diana and João proposed a parking system for assigning parking spaces to cars in line, which effectively eliminated cruising for parking, eased traffic congestion, and reduced pollutant emissions [4]. Shin et al. proposed a predictive control method based on a neural network. A utility function composed of several factors related to parking choice behavior was used as the criterion to evaluate parking lots. The utility function was expressed as the weighted sum of several factors, and the relative importance of the factors was adjusted by the weights assigned to the factors [5]. The proposed method could dynamically find the appropriate weights of multiple factors so that the intelligent parking guidance system could perform at its best. Using wireless sensor network technology, Tu proposed an intelligent parking lot implementation scheme combining real-time data and a microprocessor; through multiple parking space sensing devices, processing devices, databases, signal transmission devices, and mobile communication devices, it could clearly provide the number of parking spaces nearby and parking lots with available spaces [6]. Horng proposed a parking space search system that could detect roadside parking spaces by ultrasonic sensors installed on taxis, public vehicles, and other street vehicles and transmit the detected information to nearby roadside unit (RSU) hotspots. The data transmitted included the availability, location, and direction of parking spaces, which reduced the search time and improved the success rate [7]. Safi et al. proposed a new parking lot, the app guides the driver to the reserved parking space. When the user completes their work and returns to the parking lot, they can search for the car in reverse. The system functions are shown in The implementation of the app is mainly divided into three parts, namely, the foreground, server, and database, as shown in Figure 2. The foreground is used to interact with the user; the server implements the user's request to operate with the data in the database; and the database is used to store user information, parking space information, and other data.

OVERALL DESIGN OF THE SYSTEM
This study proposes an intelligent navigation method based on the Android system, which is divided into three modules: outdoor navigation, precise parking space guidance, and reverse car search. After entering the destination, the user uses a Gaode map for outdoor navigation. Gaode Map is a frequently used map software in China, with navigation, location search, and other functions, and the system allocates and reserves a parking space 5 minutes before the user arrives at the destination. Upon reaching the  for 10 minutes and opens the personal credit scoring system. If "no", the app only provides the outdoor navigation function. The personal credit scoring system initializes a creditworthiness score of 100 for users. If the user arrives at the parking space within the reserved time or cancels the reservation, there is no penalty. If the reserved time is exceeded, the app uses an exponential model to deduct points. When a single deduction score increases to the upper limit of 10 minutes, the reservation is automatically cancelled. If the user's credit score remains unchanged within a month, the system will add 10 points until the upper limit of 100 points is reached.

Precise guidance to parking spaces
Because the Android operating system has a builtin location service, each Wi-Fi hotspot has a unique Mac address and SSID LAN name. When the device begins to use Wi-Fi, it can scan and collect the surrounding AP signals and obtain the Mac address of the AP. The device sends the AP identifier to the location server. The server chooses the appropriate signal strength range according to the strength of each signal, retrieves the fixed position of the AP corresponding to the signal strength value in the range, calculates the distance using the improved RSSI algorithm, and then determines the specific location of the device and returns it to the user equipment. The foreground uses the background to query the database to retrieve information, determine the location of the mobile phone and return it to the foreground precise parking guidance app. The background is constantly updated and supplemented with information from the database to ensure the accuracy of the data. The Wi-Fi positioning flowchart is shown in Figure 3.
The RSSI (received signal strength indication) is used to estimate the distance between nodes according to the received signal power and signal strength and further locate and analyze according to the obtained result [15]. Compared with the geometric method based on the propagation model, the location model based on the RSSI location fingerprint recognition has greater accuracy of positioning. Therefore, the system uses the indoor fingerprint location method inside the parking lot. The fingerprint location process is divided into two stages: the off-line training stage and the real-time positioning stage. In the off-line training stage, a fingerprint database is established by collecting the signal intensity values of all sampling points in the positioning area. In the

KEY TECHNOLIGY
This section will expand from three parts: outdoor navigation, precise guidance to parking space, and reverse car search. It mainly includes the components of outdoor navigation, the process and method of parking space precise guidance, and logical method of reverse car search.

Outdoor navigation
Outdoor navigation consists of two modules: path navigation and parking reservation. The combination of mobile terminals and parking lot guidance enables users with a mobile terminal to search nearby parking lots through the map embedded in the Android system and then accurately find the parking location based on Beidou positioning. At the same time, users can book paid parking spaces online or select parking spaces after arriving at the parking lot.
The navigation system in China has improved with the use of Baidu, Gaode and so on. This study develops a third-party software development kit (SDK) for a Gaode map, embeds it into the app, and links it to the map software for navigation. Based on the Dijkstra algorithm, this paper uses the A* algorithm to search the optimal path and optimizes the algorithm to ensure that it finds the optimal path as follows: when using the A* algorithm to find an "optimal path", the target point backtracking tree compares the found optimized path with other paths in the backtracking process and keeps the shortest path. In backtracking to the root of the tree, the algorithm can guarantee that the optimal path is found.
After entering the destination, the app provides a preselected parking lot, and the user starts outdoor navigation after selecting the parking lot. Navigation in the external area can provide users with the shortest path in time and distance. A large number of users use the app, which leads to the problems of time difference (the time when users will arrive at the parking lot is uncertain) and space difference (the location of users is inconsistent), so the online booking of paid parking spaces and on-site selection of parking spaces are adopted to solve these problems. Five minutes before the user arrives at the destination, the voice of the app asks whether to reserve the parking space. If yes, the system automatically allocates and reserves the parking space fingerprint information input in the online phase, and the corresponding position is estimated to reduce the error.

Off-line training stage
A location fingerprint identification database is established, and a reasonable distribution of reference points is selected to ensure that sufficient information can be provided for accurate location estimation in the positioning stage. Then, the RSSI values from different APs are measured at each reference point, and the corresponding MAC address and location information of reference points are recorded in the database until all the reference points in the area of interest have been traversed. The Grubbs criterion is used to eliminate the coarse error of the sampling point and to improve the accuracy of the data stored in the database, and then the Kalman filter is used to eliminate the random error. Under normal conditions, the noise signal obeys or approximates the normal distribution X~N (μ, σ 2 ). First, the average value μ of a certain set of measured values RSSI i (i=1,2,...,n) is calculated, with residual v i and standard deviation σ. If the i-th measurement satisfies: then it can be determined that there is a coarse error in the measured value, where k is the statistical critical coefficient. The Grubbs criterion is used to test the RSSI with a typical confidence level of 95%, real-time positioning stage, after a database is given, the AP (access point) and RSSI values received at the test point are matched with the existing data in the database to obtain an estimated position.
The accuracy of Wi-Fi positioning is determined by the stability of the RSSI value, and the main factors affecting the stability of the RSSI value are non-line-of-sight propagation, multipath propagation, and other interference. The errors of the RSSI measurement mainly consist of random errors, systematic errors, and gross errors. Random error is caused by small random fluctuations of the relevant factors in the measurement process, which exhibit a mutual cancellation error. Systematic errors refer to controllable errors such as those caused by the instruments and the environment. Gross errors refer to small probability errors in the course of the measurement, which are accidentally caused by abnormal factors. The gross errors are generally due to sudden interference, without any regularity, so the existence of gross errors seriously affects the final result.
In light of the shortcomings of the existing location fingerprint positioning technology, several improvements have been made, as shown in Figure 4. The location of an AP installation is calculated by the antenna gain so that Wi-Fi can fully cover the parking lot. The Kalman filter and Grubbs test are used to eliminate coarse and random errors in the offline training phase of position fingerprinting. A neural network algorithm is used to match the  The real-time positioning stage matches the signal intensity collected in real time with the data in the fingerprint map to obtain an estimated position. The system adopts the BP neural network algorithm, which includes an input layer, hidden layer, and output layer. The nodes between adjacent layers are fully connected by weights. The offline sampling data are matched with the real-time positioning data to obtain [MS1, MS2, …, MSN] T . The larger the matching value of each data point is, the more similar the position images of the two data are; the BP neural network algorithm is used for the network. The weights are repeatedly adjusted and trained so that the output vector is as close as possible to the expected vector. When the square of the error of the network output layer is smaller than the specified error, the training is completed, except for the weights of the network W 1 , W 2 , …, W N and the feedback error. It is best to take [MS1, MS2, …, MSN] T as the input and {0, 1} as the output values; "1" indicates that the match is successful, and "0" indicates failure.
The center points of the template fingerprint and input fingerprint are divided into P(x p , y p ) and Q(x q , y q ). Each feature point is represented by (x, y,  t, β), where x and y are coordinate values, t is the and only one outlier is allowed in the sample. The normal likelihood distribution is μ, and the maximum likelihood estimates of μ and σ 2 are First, the m APs that are normally distributed are measured n times, and the sample signal strengths RSSI 1m , RSSI 2m , …, RSSI nm signal strength values are arranged in ascending order, and the measurement accuracy is required to be the same. Then, the value k 0 of the critical coefficient k(m,n) is calculated, and the k 1m and k nm are found, respectively. , If k 1m ≥k nm and k 1m >k 0 , then RSSI 1m should be eliminated. If k nm ≥k 1m and k nm >k 0 , then RSSI nm should be eliminated. If k 1m <k nm and k nm <k 0 , then there is no outlier.
With the remaining measured value recalculation RSSI and standard deviation σ, the values of k 0 , k 1m , and k nm are determined; by repeating these steps, the RSSI coarse error is eliminated. The random error is filtered by Kalman filtering.

Figure 4 -Improved RSSI-based process of location fingerprinting
matching score is greater than the threshold, consider the input fingerprint to be integrated with the template fingerprint.
The system uses 5 APs for field inspection and measurement, and the average positioning error is 0.9 m~-1.1 m; the positioning error is greatly reduced, which makes accurate guidance possible.

Integrated system of an ultrasonic detector-indicator light and a ground lock
Through the mutual conversion of electrical signals and digital signals, mature ultrasonic detector/ indicator equipment and an intelligent ground lock are combined to realize the effective control of vacant parking spots [16][17][18]. The ultrasonic detector/ indicator ground lock integrated device is shown in After the user chooses a reserved parking space, the system binds the user to the ID of the reserved parking space lock. The SIM card of the mobile phone can directly communicate with the server, and the app sends an unlock command to the server. After receiving the unlock command, the server matches the corresponding ground lock according direction of the feature points, and β is the type of the feature points. A reference circle area is drawn with r as the radius. The template fingerprint and the feature points are arranged in the input fingerprint circle area according to the order of their distances from the center point, from small distance to large distance. The template fingerprint refers to the feature point P 1 with the smallest r p in the circular region, and it is compared with the feature point Q 1 with the smallest r q in the input fingerprint, as shown in Figure 5. If their distances to the center point are approximately equal, P 1 and Q 1 are chosen as reference points. Otherwise, P 1 is compared with the next feature point of the input fingerprint.
Specific algorithm: (1) Determine the area of the reference point, arrange the feature points according to their distances from the center point, and take the closest reference point; (2) Convert the feature point series into polar coordinates by using the reference point as the coordinate origin; (3) Construct a neural network input feature vector P using a feature point series, establish a neural network, and train the network; (4) After the reference point has been examined, go to the next stage.
Feature point matching stage (based on the input fingerprint): Steps 1, 2, and 3 are the same as above; (4) Construct N 4×1 input vectors Q i , which are sequentially input to the neural network, and record the output vector matching scores s[i] [j]; (5) If the score obtained in steps 1, 2, and 3 is greater than the threshold, the matching with the i-th template is successful; otherwise, input the vector to the next neural network, and record the matching score s[i][j+1]; (6) If the neural network of the template fingerprint has been examined, take a feature point as a reference point and go to step 3; (7) If all the feature points have been examined, take the maximum matching score as the matching score of the input fingerprint and the template fingerprint. If the associated with the user. The parking area is divided into two subareas: app-specific parking spaces and non-app parking spaces. If the non-app parking spaces are full, and the app parking space is free, a driver can scan the QR code to download the app and park in the app parking space.

Reverse car search
After the user stops, the voice of the app asks for the length of the parking time and asks the user whether the car will be picked on time by text message 30 minutes before the end of the time. The system records the remaining time for the user to pick up the vehicle, matches a user who is about to arrive at the parking lot, and uses the logic of the user's pick-up time and the time of arrival at the parking space to allocate and reserve the parking space for the next user in real time, as shown in Figure 8.
When the user uses the reverse car-search function of the app, the device automatically authorizes the Wi-Fi connection. The app accurately locates the car by finding the user's current location.

DEVELOPMENT OF THE APP
Based on the above method, this section will use the improved location fingerprint recognition technology to develop the parking space precise guidance APP. It will introduce the design of the interface and the realization of the server technology.

Interface
The interface of the developed app is simple and clear, so it is easy to clearly display information and interact with the user. The app homepage is divided into three functional modules: scan code payment; navigate, find a parking space, open the ground lock, and reverse search. These modules are shown in Figure 9.
to the user information and then sends an unlock command to the ground lock to accurately unlock one parking space.
An ultrasonic detector installed directly above each parking space calculates the distance from an object by transmitting a short wave and measuring the time from the emission of the light pulse to the reflection from the object. The distance of the measured echo is compared with a threshold, and it is determined whether the parking space is occupied. The berth distribution and channel distribution of the parking lot are shown on the parking lot floor plan and updated in real time on the app, and the information is fed back to the customer. Each parking space is equipped with a parking space indicator on the side closest to the traffic lane to indicate whether the parking space is occupied. Red indicates that the space is occupied. Yellow indicates that the space has been reserved, but the car has not yet arrived. Green indicates a free space, as shown in Figure 7. The local lock is turned on, and the signal light turns red. The detector senses when the user returns to the car and leaves the parking space, the ground lock pops up, and the indicator light turns green; the driver ends the reservation of the spot by changing the color of the parking space indicator.
Moreover, the vehicle information of the user is detected by the electronic tag of the automobile, and the interface of the corresponding parking space is After the car is picked up, assign and reserve parking space for the next user.

Figure 8 -Logic of car extraction and allocation
The user clicks on the navigation module to use the Gaode map for outdoor navigation after selecting a destination. As shown in Figure 10, the experimental test site of the developed app is in Qingdao, China, so the navigation picture displayed during the experiment is in Chinese. App function keys are displayed in English. Five minutes before the arrival at the destination, the Xunfei voice third-party SDK is used to produce a voice broadcast to ask whether to reserve a parking space.
After arriving at the parking lot, the user equipment is automatically authorized to connect to the parking lot indoor Wi-Fi and find the location of the car. The server returns the current parking lot plan and the optimal driving route to the parking space to the user, as shown in Figure 11.
The user arrives at the parking space and chooses to record the current location. When the user returns to the parking lot and clicks the reverse car finding module, the server returns the optimal path from the user's position to the parking space to the user.

Server technology implementation
The server consists of two parts: the program and the communication network port. Setting up a PHP to connect the MySql database facilitates the processing of data with complex structures and various contents and facilitates dynamic management; the system uses a PDO (PHP data object) interface to obtain data and executes query data through functions.
The PDO is extensible and provides a number of basic compatibility features to facilitate the creation of cross-database compatible applications [19,20]. The creation of PHP database drivers is simplified by combining the PDO with the code inside the PHP. This combined PDO supports tested stored procedures and large objects that not only work but are also very easy to use.
The database is used to store data information that is initialized or generated in the project for access by the server [21,22]. This study uses a well-migrated MySql database. MySql is an opensource relational database management system (RDBMS). The system uses the most commonly used database management language, the structured query language (SQL), which is written in C and C++, for database management, and uses multiple compilations. The device is tested to ensure the portability of the source code, supports a variety of operating systems, and provides an API be established before requesting data, and the client needs to send a request to the server before the server can reply with the data.

CASE ANALYSIS
In this study, 12 AP routers are installed in a parking lot with 100 parking spaces in a shopping mall in Huangdao District of Qingdao city, China. The locations of the AP routers are determined by the antenna gain covered by Wi-Fi signals, as shown in Figure 12. There are 46 retrofitted parking spaces, as shown in Figure 13. The AP router coordinate set P is {(x 1 , y 1 ),(x 2 , y 2 ),…,(x 12 , y 12 )}, the coordinates received by the user are (x, y), and the wireless AP point Wi-Fi signals measured by the app is RSSI h (h=1,2,…,12). The set of RSSI values is R={RSSI 1 ,RSSI 2 ,…,RSSI 12 }, and the distance between the receiver of the user and the AP location is d h (h=1,2,…,12), and the set is Q={d 1 ,d 2 ,…,d 12 That is, because AX=B, the ideal value of AX-B=0, but the actual error is ε=AX-B. Let F(x)=|ε| 2 =ε T ε=(AX-B) T (AX-B); the minimum value of ε can be obtained to more accurately find the actual position of the user, and the derivative of F(x) is taken to find the extreme value: (application programming interface) for a variety of programming languages, which is very convenient for users. MySql uses the standard SQL data language format and an improved SQL query algorithm that effectively improves the query speed. Most importantly, MySql is open-source. When designing the entities and contact tables in the database, we try to conform to the third paradigm, but sometimes for the convenience of access, part of the design is more closely tied to the second paradigm.
To ensure the security of the database, the database design uses a view and transaction mechanism to roll back unfinished transactions. The server is built by MyEclipse and Tomcat. The server is used to receive requests transmitted by the foreground, process the data interaction in the database, and return the result to the Android foreground [23]. MyEclipse is a powerful integrated development environment developed on the basis of Eclipse and its own plug-ins. MyEclipse is mainly used for the development of Java, Java EE, and mobile applications. MyEclipse is powerful and supports a wide range of applications, especially for open-source products. MyEclipse can greatly improve the efficiency of the integration of the database and application server. MyEclipse includes complete coding, debugging, testing, and publishing capabilities. MyEclipse provides a collection of private and open-source Java tools for Eclipse, addressing the inconsistencies, and shortcomings of various open-source tools.
The Tomcat server is an open-source server written in the Java language. The advanced technology, stable performance, and free availability of Tomcat make it a popular web application server. Tomcat is a lightweight application server that is commonly used in small and medium-sized systems and is the first choice for developing and debugging JSP programs.
The data transmission between the Android client and the server through web services and JSON ensures the data transfer size and speed. In the interaction between the Android mobile phone client and the PC server, it is necessary to meet the requirements of cross-platform communication, transmission data format standards, interactive parties, etc. and to communicate with the server in compliance with the HTTP protocol. HTTP connections use the "request-response" mode. The connections need to to achieve precise parking space guidance, and fill the blank of accurate guidance in the parking lot. On this basis, we cooperated with the parking lot of 100 parking spaces in a shopping mall in Huangdao District of Qingdao city to reconstruct the parking lot. After the transformation, the parking lot no longer needs manual guidance. Users can quickly and accurately find the remaining parking spaces and improve the parking efficiency. Positioning technology combined with the app can bring great

CONCLUSION
In this paper, an improved RSSI-based location fingerprint positioning technology is presented, and a Wi-Fi-based method for precise guidance to parking spaces is proposed. An app is developed that realizes precise route guidance to a parking space and a reverse search function. An integrated system of ultrasonic detector/indicators and ground locks is designed to effectively control empty parking spaces  convenience to users, ease traffic congestion, improve parking space utilization, reduce traffic accidents caused by congestion to a certain extent, and realize optimal allocation of limited parking resources.
The method proposed in this paper has certain limitations in practical applications. This method is derived from a secondary development of the Android system. Therefore, the app developed based on this method is only applicable to electronic devices that use the Android system. This method cannot be installed and used in other systems, such as the iOS system. To improve the application of this method, researchers can continue to develop it and apply it to electronic devices that use other systems.

ACKNOWLEDGEMENT
This study was supported by the Shandong Pro-