A Mechanism of Initiative Transmission to Send Message on WEBGIS

The paper researched and realized the initiative message transmission mechanism of WEBGIS server based on the N layer architecture of Internet. According to WEBGIS application long business operation as well as server information visualized in client side in real-time features, this article uses the Socket communication and the client side with JAVA Applet to realize that the WEB server can send message initiative to the client. It comes up and realizes a concrete plan of initiative transmission mechanism in WEBGIS. We run the realization plan based on Winsock through the project practice of Guangzhou cable TV network security monitoring and alarm system. The system operation has been verified in system running. The combination of this mechanism with conventional WEBGIS can greatly improve the performance and the usability of WEBGIS.


Introduction
With the increasing development of Internet technology and people's demand for GIS, it is becoming an inevitable trend to publish spatial data on the web using the Internet, to provide spatial data browsing, query and analysis functions for users; At the same time, the combination between WEBGIS and some new fields such as control systems, mobile location-based services, real-time information exchange and so on are more and more close.According to statistics, 80 % of the information has something to do with the location; it usually takes people a lot of energy in order to search for a person, a place.So, with the development of society, the accelerated pace of life, saving time, improving the efficiency has become a universal pursuit, thus location information also becomes one of the most desired information for people.In addition, with the increasing development of industrial automation, WEBGIS also participates in real-time control system, which put forward a challenge to the traditional WEBGIS information interactivity way, and it also put forward higher requirements to the real-time, security, quickness of WEBGIS information interactivity.
At present, WEBGIS has been well embodied in the function of GIS in the Internet, in addition to realizing the basic display, basic query, it is needed to do long transaction operation such as spatial analysis.But because of the own reasons of the HTTP protocol, the WEB server can only passively provide information browsing, there is no way for the WEB server to send a request to the client initiatively, which determines that conventional WEBGIS is not very good to support a long transaction operation.WEBGIS has become the developing trend of GIS; it can be well embodied in the functions of GIS in the Internet.Among the operations which it has provided to the public, in addition to the basic map operation, there are other operations such as bus transfer, place names inquiry, guiding services and so on.Judging from the interactivity ways of customers, there are two kinds of interactivity ways: 1) Clients make a request, the server receives and processes it, the results are returned to the clients, this method is commonly used in functions of basic map operations like zoom, roaming.
2) Clients make a request; the server receives it and feedbacks the valid data, Clients timely process the data and the server displays the results to the users, this method is mainly used in part of the space analysis process.
However, the method used by the vast majority of customer interaction system on WEBGIS is relatively passive, only when the users make a request, WEBGIS server get a request to respond to it and process the data for the request, and the result will be sent back to the clients, the clients see the results map or outcome data through the browser.For example, when the users want to get the bus routes from A to B, after users input a query condition, the information from A to B will be sent to the server after proper disposal at the clients, the server processes the information accordingly based on information transmitted from the clients, obtains corresponding data from the database, these data will be fed back to the clients through the server, the clients can show text, or more intuitive icons to the users according to the information.

Proposal of Message Active Transmission mechanism on WEBGIS
WEBGIS has been widely recognized for its interactive way that user can conveniently operate through browser.While in the light of these interactive ways, there is one thing in common, namely one requirement gets one result, which means users can't contact server for a long time, reducing the real -time performance of WEBGIS.
With the development of techniques such as computer, communication, GIS, GPS, and WEBGIS gains great development.Users are not only just satisfied with simply viewing map but more interested in the real-time geographic data.Users want to get the former or present geographic data.For example, if they need know the location on the road through cell phone or WiFi , they have to send a requirement to the server and the server just sends the present or former location back to users in one time through the present interactive way of WEBGIS.In this way, users have to constantly send requirements to know their location timely, reducing the users' operation, increasing the burden on the user, so we need to propose a better solution.
Communication between the server and the client would be disconnected after every connection because of its own disadvantages of HTTP.We use Socket to achieve our goal to change this communication method during the research and realization of mechanism of message active transmission.During connection between users and server, the server sends the latest information to users at any time and receives requirements from users.We could make full use of WEBGIS if we combine this mechanism with WEBGIS.
Mobile communication and Internet are two hot spot in the development of today's information industry.They are integrated into mobile wireless Internet, and its application will certainly become an important development direction for information industry.In recent years, mobile phone users in China rank first in the world.With the development of WEBGIS technology, mobile phone value-added services based on WEBGIS technology are applied widely in tourism, transportation, medical treatment, public security and other fields, and become a part in people's lives.
At present, people's demand for information becomes stronger and stronger.According to statistics, 80 % of information is related to the location.People often spend a lot of energy to find a person or a place.Along with social development and acceleration of life pace, therefore, saving time and improving efficiency have become a universal pursuit.So location information becomes one of information people are eager to most.On the other hand, the rapid development of spatial location technology and mobile communication technology also make possible fast delivery of people's geographical location.Under the dual drive of market and technology, the LBS (Location-Based Service) has developed subsequently.LBS, namely, Locationbased Service, refers to through cooperation of mobile terminal and wireless network, determining the actual geographical location of mobile users, so as to provide information services related to location which the users need.Location-based service, meanwhile, has become a research focus in the academic circles.
LBS defines the blueprint of spatial information service and mobile location service in the future, namely, when the users interact with a model in the real world, the model can provide different information to different users dynamically in different time and places.When mobile users interact with the model, the users' views will be changed along with the changes of user role and environmental [4].The development and integration of spatial information technology, especially, GIS, GPS, RS, VR and computer graphics effectively bring spatial information and people's life closer.The carrier which can meet the demand for further socialization and popularization of spatial information is consistent with the development of mobile services, so the dynamic integration of spatial information technology and mobile communication technology will accelerate the process of socialization of spatial information, so LBS has the technical source.
The message active transmission mechanism combines with the traditional WEBGIS, catering to the requirements of LBS data real-time communication, and plays a linking role in data communication.Based on the information active transmission mechanism, the stream socket applied depends on TCP protocol, so that the information can arrive at the destination accurately, so as to ensure data integrity and security.The paper solves this problem: WEB server can take the initiative to send information to the client-side on the WEBGIS.To combine the mechanism with normal WEBGIS can better give play to the role of WEBGIS.

Key Technology of Message Active Transmission Mechanism
Based on the message active transmission mechanism system in the paper, the server shortrange order is implemented through using VC++, but the client program is through Java.Under this premise, Socket communication between VC++ and Java will be introduced as follows.
The operation mode of Applet and Socket server is similar to a typical client server mode.The server-side should be connected to a third party's server, so VC++ is applied for programming.The Applet uses Java, so Java's IDE can be used programming.The steps for Applet and Socket work process are as follows: The server should create a socket for listening, and create a new thread to listen to customer requests after assigning a port to this socket.The client creates the socket used to connect to the server, then calls connection function, and requests the connection with the server.After listening to the client's request for connection, the server socket calls the receiver function to create a socket for connection.Through the server's connection Socket and the client's Socket, the data can be transmitted between the Socket server and the client browser's Applet.After appropriately processing data which are acquired through data acquisition control card and video acquisition card, the server transmits the data to the client, and the client Applet displays the processed data on the client browser.Meanwhile, the Applet transmits the client's control command to the server, and the server sends instructions to output port of data acquisition control card to change the operation condition of the controlled object according to the corresponding control strategy.After the client completes the task, the client calls the close function to close the socket, and the server also calls the close function to close the socket which is connected to the Applet.

Service-side Design
When the main server listens to the client's connection request, and creates a thread to ensure the independent communication with multiple clients and the accuracy of data, according to different needs of users in each thread, put forward different requests to a third-party server, to get different data.If the users want to acquire the current geographic information, the main server will only send the geographical data transmitted by a third party's servicer to the user for one time.After accepting the information, the user may not disconnect with the main server, but need to send a new request to get a new service.However, when the users want to know their mobile location in the process of driving, after the users send the request to the main server, the main server will interact with a third party's server, a third-party's server will send the geographic information of the user in the location moving process to the main server at a certain time, and then the server sends the information to the user.This is the purpose of the main server in message active transmission mechanism.
Why multi-thread is created to maintain communication with multiple clients.Thus, in order to receive the information sent by the client-side and to send the data to the client in real time, two nested loops are used for programming design.The first loop is used to receive user information in real time, the second loop is used to send information and accept the data transmitted by the third party's server in real time.In the meanwhile, the markup is used to judge the user's requirement type, and different information transmit modes are adopted.
In the design, the server-side programs are required to ensure successful completion of the following functions: a) Multiple clients' effective connection can be guaranteed.
b) The client-side data can be received timely and effectively.
c) The client-side data information can be transferred to a third party's server accurately and fast.d) When the main server and the client are connected, the information uploaded by the clientside can be accepted at any time, and information can be sent to the client at any time.
e) The information transmitted by the third party's server can be accepted simultaneously and fed back to the client timely.f) In case the third-party's server is closed because of accident, the users can be notified in a timely manner.
The structure chart below describes the overall work process of the server-side, the Socket communication is a means of communication we use.In the face of specific operational process, a detailed plan must be made.What is described in Fig. 2 is the main working process of the server-side.

Client-side Design
After the client Socket is created successfully, the user selects the required service, in accordance with the type of service, the client programs send service request to the server.In order not to affect the basic operation of WEBGIS map, long-time data receiving takes up the main thread, so it is required to create a sub-thread responsible for receiving data.The realtime data information receiving process is continuous, so here the loop receiving mechanism is applied, to ensure that each data can be accurately received.
In the design, the client programs are required to implement the following functions: a) Enable the programs connected with the main server at any time, and terminate communication with the server.b) In the communication process with the main server, any abnormality can be found and the user will be informed timely.c) In the communication process, the user can implement other client-side operation at will, for example, zoom in and zoom out the map, roaming, etc. d) Data information transmitted by the main server can be received in real time; e) Determine whether the main server is disconnected, and the abnormal results can be returned to the user.
If the users want to get data they want, the first step is, of course, to start the connection with the main server.The connection between the customer services is implemented through the Socket communication, so at first it is required to build the Socket communication mechanism.

Concrete Realization and Application
In the above sections, more detailed researches have been done on the technology of message active transmission mechanism on the WEBGIS, analyzing the development of Internet communication program under the Windows system.Next, the abovementioned remote control software platform based on TCP/IP protocol and Guangzhou cable TV network security monitoring alarm system developed by us will be introduced.
Fig. 3 shows the structure drawing for remote control system based on TCP/IP protocol developed by us.The main functions of Ts communication server in the system are: communication with information transit server, log management, server address settings, GSM port settings, etc.The SOCKET is applied in the communication between Ts communication server and information transfer server.VC is used for programming the information transit server, to achieve the real-time message receiving and sending, to save and distinguish the client-side connected, to save the information of every login client-side, to set up the port and IP address for communication interface, to ensure the practicality of real-time communication interface.
After receiving the information sent by Ts communication server, according to the Specification for GIS Communication Message, the messages are analyzed.Through the analysis of messages, the message type can be known.When receiving the alarm message, the message's alarm monitor number and alarm information such as time, type, channel, are analyzed, and alarm information is filled in the current alarm data sheet and history alarm data sheet.When receiving the alarm reset message, the corresponding alarm information in the current alarm data sheet is deleted.When receiving the alarm message and alarm reset message, each client is informed to read the current alarm data sheet and to update alarm display.

Conclusions
The key technology based on network communication is discussed in the paper.Through the analysis of the discussed key technology, the concrete scheme is put forward to achieve message active transmission mechanism on WEBGIS.Through the Guangzhou cable TV network security monitoring alarm system, the engineering practice is developed, and the implementation scheme based on the designed Winsock is attempted actually.According to the actual system operation, this scheme is feasible.
In the paper, theoretical and practical discussions are conducted from the following aspects: 1) The WEBGIS application and development trend are introduced in detail, and the WEBGIS will become the inevitable trend of GIS development.To combine the message active transmission mechanism with normal WEBGIS can better give play to the role of WEBGIS.
2) The Socket communication mechanism's principle and communication implementation process are introduced in detail.
3) The system framework and working process of message active transmission mechanism in the WEBGIS system are analyzed in detail, and the particular design scheme is proposed.
4) The server and client coding work of message active transmission mechanism are realized, to ensure the information's timely interaction.
5) The study is applied to the practice project, and has achieved success.
Due to the limitation of time, only the communication mechanism in the message active transmission mechanism has been studied, and the information interaction is achieved through simulation.However, how to combine it with the normal WEBGIS and how to display in the way of electronic map are not realized specifically, which needs to be improved.In addition, the transmitted data are not involved in complex data transmission security problem, so there is something missing in data security.An in-depth research will be made to these questions in the future work and study.The idea of message active transmission mechanism has been applied and some successful cases have been achieved, but there are some aspects needing to be improved.Along with the continuous improvement of science and technology, there is every reason to believe that we can do better.