Research and Implementation of Multi-User Location Sharing Method Based on LBS

In order to make up for the deficiency of the lack of the location interaction between users of most LBS based applications in the market, a multi-user location sharing method(MULS) is proposed. Starting from the applications such as ordering food in different places and collective travel, it shows that this method can provide the location interaction between users and improve the location service function of the application. Secondly, the feasibility of the method is illustrated by introducing the principle of MULS. Finally, on the IOS operating system, this method is gradually implemented from several aspects of location acquisition, sharing strategy, data exchange, and overall framework. Conclusions: The MULS method can be implemented on the basis of existing applications. This method can effectively provide the location sharing among users, so that it is possible to achieve the query and positioning of the real-time location of multiple people among team users, team collection progress, the location of non returned team members, so as to let LBS application bring greater convenience to people’s life.


INTRODUCTION
With the spread of smart mobile devices and the mobile Internet market, LBS based applications are becoming more and more extensive. LBS has gradually penetrated into people's leisure, entertainment, life service and social aspects [1] [8]. Mobile end applications that are familiar to people, such as "Amap", "Eleme", and "Tour pal", are all based on the support of LBS. With the support of LBS, such applications can provide location services for users while providing original services, and make original services more efficient based on location services. These LBS based applications are increasingly appearing in people's horizons.
Users are often in trouble when they make life easier with these applications insocial networking. For example, the "Amap" can provide all-around and thoughtful service for the solo travel, but it is impossible to achieve multi position tracking and data statistics in a multi-people trip. The food recommendation of "Eleme" is based on the location of the user (destination) and the permissible distance for the meal delivery, but the delivery place can not be set to the location information migrated from the Internet, and this application is unable to implement a meal recommendation in different places, for example, the children who are on a business trip order meals for the aged at home. For many tourist applications including the "Tour pal", although they can help users find the scenic spots accurately by positioning, they are easy to mislead tourists in remote areas lacking POI mark, let alone the accurate positioning of tourist location for tour guides or first aid workers when tourists get lost or are accidentally injured. With these problems, this paper proposes a LBS based multi-user location sharing method(MULS). The use of this method can help users quickly solve problems on these occasions.
LBS [2](Location Based Serivice)refers to providing the users with the corresponding service under the support of the GIS platform through mobile communication network(cellular site), or external location mode(GPS), or wireless local area network(WIFI). LBS is also called position service. LBS based applications often introduce POI(Point of Interest) [3]. By correlating the user's current location information to POI, these applications can provide users with services such as precise positioning, travel navigation, and interest recommendation.
MULS refers to sharing the current position of the mobile end between multiple users. The users can not only query their own current locations at the personal mobile end, but also can query the current position and the moving track of other people, so as to solve the difficult problem that the mutual position of the multi-people trip is difficult to determine. In such occasions as friends meeting, multi people party, business negotiation and tour guide leading a team, the query and positioning of the real-time location of multiple people among team users, team collection progress, and the location of non returned team members can be achieved. The MULS presented in this paper is not the same as the location sharing of some existing applications, which only displays the location text information of other people, or only uses geographic fence [3] to calculate the other user distance in the vicinity of the user. MULS can realize the location active sharing among multiusers, map multi user location marking, track record, multi location point data statistics and other functions.

MULS PRINCIPLE
The MULS is based on LBS. If the location is shared between two users A and B, the user A and B must first obtain their own current positions by the mobile end. Then the user A carries out the setting in order to share the current location to the user B. So the user A mobile end sends the location and the sharing target of the A to the server, and then the server forwards the location of the user A to the user B mobile terminal to share the location of the user A. At this time, the mobile terminal of the user B can see the location information of the user A and B at the same time. So when the number of users is n, by the same way, a user's mobile terminal can see the n-1's location information at most except for itself. The detailed UML activity is shown in Fig.1.
Multi-user location sharing makes it possible for a mobile terminal to obtain the location information of multiple mobile terminals.When two people agree to meet each other, the location, distance and moving direction of the two people can be fed back in real time through the location information sharing mobile terminal. With these real-time feedback, users can meet in the fastest time.
When people order a meal in different places(For example, the user A of the city a wants to order a meal for the user B who is in the city b), the user B mobile end only need to share the location to the user A. The user A gets the location of the user B and sets it to delivery place. In this way, the takeout ordering application will rebuild the geographical fence based on the location of B and the distance parameter of the meal delivery, and provide the optional takeout shop recommendation with POI. In a group trip example, if all the tourists in a tour group share their position with a tour guide (assuming one person), then in the wilderness areas, the lost tourists can take the location of the tour guide shared on their own mobile terminal as the navigation mark to find the correct road. If the tourist is accidentally injured and can't move, the tour guide can find the tourist quickly through the places shared by the injured tourist. On the premise that a tour group reaches a scenic spot and the tourists act freely, the tour guide can understand the distribution of the team at any time through the location information of all the tourists on the mobile terminal. At the time of the collection, the tour guide can also understand the return progress of the non returned team members in real time.
Therefore, the LBS based multi-user location sharing method (MULS) can effectively solve these problems in the existing location service applications.

IMPLEMENTATION OF MULS
MULS can be used in any mobile application [4][5]. At present, most mobile terminal operating systems are mainly IOS and android. This paper introduces the implementation of MULS in the IOS system.
Multi-user sharing is based on LBS, and the overall implementation of MULS includes four aspects: The first point is the acquisition of the user's own location information. The second point is to create a map view to mark and display the location. The third point is the setting of shared objects and the completion of the sharing. The fourth point is the overall framework of shared data forwarding and implementation. The implementation method of MULS will be introduced in detail based on these four points and some of the main codes are given.

The Information Acquisition of the User's Own Location
It takes two steps to get the user's current location information. First, the location of the current user is obtained by positioning, also called GPS Coordinate. This coordinate has two parameters: longitude and latitude. But the latitude and longitude are not enough to make the user fully understand. Second, GPS Coordinate anti geographically coding is carried out. The latitude and longitude are converted to the corresponding specific address, that is the current location information that the user can understand. This location information can include the following aspects of text content: the country, province, city, street, etc. The implementation of the above steps in IOS depends on theCoreLocation.frameworkframework[7] [10]. This framework is introduced into the development application, the CLLocationManagerDalegateis set as the agent of the corresponding class of the view control, and the following main code is implemented.
The first one is to create and initialize the current user location manager and the geographic encoderin the view loading method viewDidLoad.

myLocationManager = [[CLLocationManageralloc]init]; geoCoder = [[CLGeocoderalloc]init];
The second one is to create a trigger method to get geographical latitude and longitude, and begin to obtain geographic latitude and longitude in the method. The fourth point is to decompile the geo location code into specific address information. In the aforesaid proxy method, a geo encoder that has been created is used for anti coding. The parameter myNLocaiton in the method passes the geographical location code as the parameter to the anti coding method. This method initiates a request to a specific server and performs anti coding through the server. The parameter placemarks is used to receive the specific address information returned after the anti encoding. The parameter placemarks is used to receive the specific address information returned after the anti encoding.

Map Marker for the User's Current Location
When the user's current location information is obtained, it can be displayed in text form. However, this is not the most vivid expression. Usually, we will identify the current location with a map, that is, after obtaining the user's current location coordinates, on the one hand, the system needs to get the detailed text information of the location through reverse query, on the other hand, it also marks the geographical coordinates on the map and displays it to the users. The user's current location is described together by a map mark and a combination of text information.
The geographic coordinates should be turned into a mark on the map to display to the user, and the MapKit.framework framework needs to be depended on in IOS. In order to complete this function, this framework needs to be introduced into the development application and the following main codes are implemented.

3.3Setting up Sharing and Implementing Sharing
After completing the user's current position acquisition and display, the user can query his own current position through the mobile terminal, which is the prerequisite for the realization of MULS.The location information of the user belongs to the sensitive personal privacy [6], which can not be leaked at random, therefore, it is necessary to provide an autonomous operated switch for the user's location sharing, and have a shared operation setting for one or more other users. The shared setup operation can be realized with a friend list and a switch. The user ID is used to uniquely identify any user. By adding other users ID to their friends list, users can add other users as the friends. Each column in the list of friends is a ID user and displays a nickname with a head image, with a switch -sharing operation button next to it. The switch of this button determines whether the local user opens or closes the location sharing for the ID user.
When the user changes the sharing setting, the user will be prompted to save. Once saved, the sharing setting will be uploaded to the server. The server side stores all the friends ID that the user needs to share in a field. When this field is empty, the server does not forward the user location. When the field is not empty, the server reads the field content and parses all the friends ID. Once the user's current position changes, the server will forward the user's current location to the parsed each online friend mobile terminal that needs to share the location.
For users who receive the shared location of others, they can see which friends share their positions through a friend list, and can display or shield a friend's position for a single friend. The function of map display and marking position has been completed before, therefore, once a friend shares the location with the user, the user map view will refresh and increase the friend location mark and display the friend nickname and location text information. Through the location marking of the user and his friends on the map view, he can clearly understand the position and distance of his friend and himself. As the map will be updated at any time, when the location of friends and users changes, users can also see the direction of progress of the two sides from the map view, and save the mobile track.

Data Exchange and Its Overall Framework
In order to share the location information between multiple users, it is necessary to transmit it with the aid of the server. The data exchange between the server side and the user mobile end application can be realized through the JSON format data stream [9] (JavaScript Object Notation). The data exchange overall framework refers to Fig.2.
In the overall framework, the client side is an application on the IOS, and the server side uses the servlet Technology of J2EE.The client side uses the HTTP protocol to send the serialized JSON location sharing data stream to the server through the MULS. The server carries out the anti serialization analysis of the accepted JSON data stream, and gets multiple complete real data and stores it to the database. Then the data is processed according to the location sharing processing logic in the server side servlet, and then the data sequence is transformed into JSON data stream and forwarded to the sharing target friend.After receiving the JSON data stream, the friend's client application carries out the anti serialization for it to parse the user ID and nickname and the user location, then marks and displays through a map view.

CONCLUSIONS
LBS based multi-user location sharing method MULS migrates the location of mobile terminal to other mobile terminals through the Internet by sharing the current location information of their mobile terminals among multiple users in the application.This method allows a mobile terminal to view and process multi people location information at the same time through a map, and makes the multi people trip, such as friends meeting, multi people party, business negotiation and tour guide leading a team more convenient, so as to achieve the query and positioning of the real-time location of multiple people among team users, team collection progress, and the location of non returned team members.