Smart Caching Based on Mobile Agent of Power WebGIS Platform

Power information construction is developing towards intensive, platform, distributed direction with the expansion of power grid and improvement of information technology. In order to meet the trend, power WebGIS was designed and developed. In this paper, we first discuss the architecture and functionality of power WebGIS, and then we study caching technology in detail, which contains dynamic display cache model, caching structure based on mobile agent, and cache data model. We have designed experiments of different data capacity to contrast performance between WebGIS with the proposed caching model and traditional WebGIS. The experimental results showed that, with the same hardware environment, the response time of WebGIS with and without caching model increased as data capacity growing, while the larger the data was, the higher the performance of WebGIS with proposed caching model improved.


Introduction
As the state grid corporation "three sets of five" (intensive management in human resources; financial resources; and material resources; large-scale movements in programming, construction, operation, overhaul, and production) system construction plan is put forward, the power information construction develops toward intensive, platform, distributed shared direction. As the foundation platform, GIS should be placed in the first place during information construction. And in order to realize spatial information sharing and interoperability, the demand of integrating WebGIS in power information system is increasingly urgent [1].
Power WebGIS platform could integrate all types of equipment belonging to power enterprise, which contains power equipment, substation, transmission and substation network, power users and power load, production and management, and other core business, and form composite management system to meet the requirements (safe, reliable, high-quality, efficient, and economic operation) of power enterprise and its customers. Plan and manage the power grid by using modern technology and management means; enhance power grid equipment asset management, operation management, and regulatory capacity; improve the power supply reliability and power quality; and provide high quality, efficient, and safe service for electricity customers timely [2].
The caching technology is a common mean to solve the WebGIS space data access efficiency. In WebGIS platform, the main impact of spatial data access efficiency consists of two parts: first, database access efficiency and second, the transmission efficiency of the network [3]. Therefore, considering from the two aspects: database and network, we designed dedicated power WebGIS sharing platform cache mode land; it can greatly improve the WebGIS platform transaction processing ability and the response speed of the map. Literature 4 addresses performance issues in a systematic manner from the aspects of architecture, bottlenecks and performance factors, performance improving techniques, and performance solutions [4]. Literature 5 proposed WebGIS framework based on multiagents and made a more extensive and in-depth research on related technical problems, which overcome the defect of the traditional WebGIS in Internet environment [5]. Luo et al. introduces a multilevel componentized WebGIS system, named Geo-Union, and designed 2 The Scientific World Journal the space cache framework. It is divided into three levels: spatial database caching and network spatial caching and spatial data proxy server [6]. Literature 7 proposed a prefetching algorithm called Retrospective Adaptive prefetching, which takes the former actions of the user into consideration, to reduce the user-perceived response time and to improve user's navigation efficiency [7].
To solve spatial data access, efficiency problem existed in the process of electric power construction of WebGIS; used to put forward spatial data accelerate engine in literature 8. The spatial data accelerate engine consists of spatial data model, spatial index method, and spatial index caching mechanism [8].
This paper is organized as follows: first it provides a brief description of independent research and development of electric power WebGIS platform architecture, and then it presents dynamic display cache model and agent-based dynamic display cache method, finally it verifies the proposed method; finally, conclusion and further research direction are given.

Power WebGIS Platform
Power WebGIS platform is designed based on SOA architecture and is aimed at achieving power enterprise labor and material resources intensive management and business centralized operation, using spatial data sharing and business systems integration as the starting point, to construct a service-oriented, comprehensive, and real time power system comprehensive information integration platform.
Besides the general function and the performance of WebGIS platform, Power WebGIS platform also needs to meet the requirement of electric power industry. Such as integrating electric power business data, providing power characteristic service and providing secondary development function to support related business systems integration at the same time; power WebGIS platform architecture is shown in Figure 1.
The data service layer is at the bottom of power WebGIS platform; it contains all kinds of data mentioned in the spatial data model such as spatial index for spatial data and databaseside vector data cache and the background map tile server.
The application services layer is the core of the power WebGIS platform. It contains most application logic of WebGIS and various types of data cache Web server for client service agent server spatial information server (SGA server), Various types of functions are provided as services for the client calls. Unlike general WebGIS, we establish three types of caching service at the layer of the application logic, consisting metadata cache, the permissions cache, and data cache (background map cache and vector graphics data cache). The cache uses a unique design and can greatly improve the speed of response of the WebGIS. The cached data can also be shared between agent server, coordinated distributed deployment servers, and clients.
Platform sharing layer interacts directly with the user, in order to enhance the human-computer interaction capacity of WebGIS and improve client's performance. On the basis of general browser, based on Flex RIA technologies, one can realize the map control and caching mechanism. At the same time in order to reduce the network load and customer service network latency and improve WebGIS strength and fault tolerance, designed multiagent structure in Flex RIA achieves synergies in the client and speed up map response.
By using Flex technology and agent technology, power WebGIS platform consummate power business integration application system, while improve the user experience at the same time. In addition, Power WebGIS platform establishs two types of cache: cache separately for user data (vector data cache and metadata cache) and background map tile cache at display interface layer, which completes the maps collaborative function and cache data sharing between clients by moving agent. User interface control layer functions involve map display, map edit, resources display, resource query, resource location, spatial analysis, thematic map display, and so on.

Caching Model and Its
Replacement Algorithm

Dynamic Display Caching
Model. Dynamic display cache model is a Caching model set up basing on power GIS spatial data model, making database, GIS server, the client as the research object and caching sharing data in the way of memory and file. Its goal is to improve the response speed of the power WebGIS sharing platform and speed up the map rendering efficiency, rich client space operation level. The formal description of the Dynamic Display Cache Model is as follows.
(1) Cache Directory (CD): CD = { , , }, where is a collection of metadata cache, is a collection of facilities feature cache, and is the set of topological relations cache, the CD is dynamic display cached content, and the following will descript the specific content of each directory in detail.   number, type is the type of relationship, 1 is the first facility number involved in the relationship, and 2 is second facility number involved in the relationship, if it is one-scale relationship, 2 = 0; (vi) Version ( ) is the metadata cached version.
(3) Facilities feature cache set Feature ( ): ∈ ∩ ⊙ , one of All facilities category, which means instance, the is an instance of FM. = { 0 , 1 , 2 , . . . , }, ∈ , is a concrete class facilities.  for level 1 cache, namely, database cache; cl 2 stand for the second level cache, namely, the GIS server cache; cl 3 stand for Level cache, namely, the client cache. where cm 1 stand for memory cache whose cache efficiency is high and is difficult to share and maintain; cm 2 stand for file cache which is difficult to share synchronized copy; cm 3 stand for memory file caching, has advantages of the two cache mentioned above, to maintain cache shared and cache consistency.
DDC model are defined as follows: The creation and updating of cache is closely related to the version number stored in the metadata, and low-level cache relies on high level cache, take level 3 caches for example, to demonstrate the process of cache updating if (CD(cl 3 ) is null), then create (CD , cl 3 , cm 1 ); else if ( (cl 3 ) = (cl 2 )), then updateCache (cl 3 ), else dropCache (cl 3 ), create (CD , cl 3 , cm 1 ), where CD(cl 3 ) represent the client cache directory, create (CD , cl 3 , cm 1 ) is to create the client cache directory, cache mode uses the memory cache, (cl 3 ) stand for the version number of the client cache, updateCache (cl 3 ) is to update the client cache, and dropCache (cl 3 ) is to empty the client cache. The Scientific World Journal Cache model creation and maintenance should ensure the integrity and consistency of cache. In order to realize the cache efficiency at the same time, some rules need to be followed.
Rule 1. CD must guarantee the integrity, convenient for local client to render graphics, and support simple topology analysis and spatial query.

Rule 2.
Cache level CL can support arbitrary combination, which contains eight kinds of state, but often maintain the whole cache state so as to ensure high efficiency of the system. Rule 3. CM only has single state, can only be one of the following states: memory cache, file cache, or memory file cache. Usually adhere to the following pattern: first carries on the memory cache, when the amount of cache increase to set limit, based on sliding window replacement strategy, transfer a part of the memory cache to memory file cache. When the client is closed, transferred into the file cache.

Caching Replacement Algorithm.
Caching replacement algorithm is established with space limitation and time limitation as theoretical basis. Space limitation behaved as if the most remote distance eliminated first, and time limitation behaved as if the longest time unvisited eliminated first. Comparing with the traditional FIFO, LRU, and LFU, we chose 2Q (two queues algorithm) to improve the efficiency of caching replacement.
2Q algorithm does not eliminate the page least visited from main cache but achieves through swapping with the page most visited. Similar with LRU/2 algorithm, 2Q distinguishes the pages with the time visited the second time, that is to say, 2Q puts the page first visited into a special cache called 1 queue, which is a FIFO queue, and move it to queue if the page is visited again in the life cycle, which is LRU, likewise, swap it out if it is not visited in the life cycle of 1 queue.
In 2Q algorithm, 1 queue exists as a filter, the data could swap to queue when it is visited again after entering the 1 out queue. Assuming miss rate is and 1 out queue space is , so the data could be swaped to queue if it is visited less than / after it entered the 1 out queue, we called the probability accept . Assuming the rate of object visited is , then the rate that it was swapped to from 1 out after the visited time is (1 − ) −1 , and accept could be achieved as accept is close to 1 as increased, while close to 0 as decreased, so 1 out plays a role of filtering the page least visited. We could define the cutoff hotness of 1 out filter as cutoff , in the case of accept = 1/2, the derivative of cutoff is very large, so the object with the visiting rate cutoff could be swapped into after it was visited the third time not the second time; the visiting rate could be achieved according to (3). If the and are given, cutoff could be expanded as (4) with Taylor series expansion: Formula (4) shows that 1 out filter could self-adjusted, accept will be relatively large when miss rate is large, so the process will swap the object most visited, while the object usual visited could be swapped in when miss rate is low. Assuming and are given, crit could be achieved in the condition of accept , as The established condition of (5) is ln(1 − ) ≈ − , and could be achieved when visited rate limit of queue is given. Assign the value of = approx , average visited object could be swapped into queue. If miss rate is and size of is , the average visited rate of object in the buffer is (1 − )/ , and formula (6) could be achieved when replacing crit with : The practical significance of (6) is limited as the miss rate need to be estimated, but it illustrates that the ratio of 1 out size and buffer size is . Simulation results showed that the ratio is 1/2 when the value of m is from 10% to 90%, and 1 out size is smaller if the m is smaller. Assuming as the whole data set and = , is part of , shown as (7), then the average visited rate of the object least visited is /(1 − ) . Assuming = / , the average visited rate of the object least visited is (1/(1 − )) , which is Because is very small, so (2 ln(2)/ ) ≫ 1/(1 − ). The object least visited could be filtered as long as is small enough with the condition = /2; moreover, approx / = 1/2 could result = 1/(1 + 2 ln(2)) ≈ 0.419. As long as is not large enough, the fluctuation of approx will not be large, so the algorithm is not sensitive to the setting of , and = /2 is always right.

Dynamic Display Cache Based on the Agent
Power GIS model has the following characteristics: complex, large amount of data, high real-time requirements, history play back, and real-time tracking operations. So multilevel cache on spatial data can effectively reduce the server pressure and network load, achieve efficient and real-time access to spatial data. It is also critical to improve the efficiency of the system and reduce the map response time [9].
In order to quickly and effectively deal with huge amounts of spatial data stored in the space database, we implement three-level cache in Power WebGIS platform including the database-side, server-side, and client. The platform dynamic cache model is shown in Figure 2. Create a spatial index and tile cache on database-side and improve query efficiency by querying attribute data instead of the space data. Through the management, the vector cache server, and the map tile server, server-side caches dynamic map layers vector data, user data and layer version data using high-speed dynamic display cache (DDC). Server-side also caches background map in the form of tile data cache. Through a distributed deployment strategy, it reduces network traffic, speeds up the access speed, greatly improves the concurrent user response ability, and realizes high stability of the cache. Through the intelligent agent technology, the client communicates with server-side cache by adopting asynchronous transfer technology, set different cache according to the access level and access frequency, realize sensitive interaction and rich operation experience, improve the efficiency of response.
Server-side dynamic display high-speed cache, and background map tiles cache can satisfy power facilities data realtime change and meet vector graphics rendering requirements. The system can quickly generate maps without query background database so it still has high efficiency while managing huge amounts of data at the same time. The flexible cache can be placed anywhere in the network, considering the system performance, storage space, and network traffic. Children · · · · · · · · · · · · · · · · · · · · · · · · Features Version Feature

Features
Cache  To meet the requirement of real-time updates, we use DELTA mechanism, update dynamic information through incremental form. Through the combination of DDC and DELTA, it can better support huge amounts of data, accelerate the access speed and ensure data correctness. The client cache is based on the following fact: in a period of time, user's inspection of the map and the retrieval of power facilities are concentrated in certain layer. According to the access frequency of the layer, the data is cached in the different levels of cache, when a user retrievals data start from the fastest cache. If does not exist, then retrievals in the next cache. Client local caching content includes all or part of the DDC, the background map tiles visited, all kinds of versions of space facilities data model, user permissions metadata, and others. When facilities updated, it realizes real-time requirements by the server-side DELTA mechanism.
By applying multiagent technology, the power WebGIS platform client provides basic maps show function, browse function, space analysis function, resources query localization function, local map cache data, and user data management function. In addition, each client registers a client agent, as the link between the clients completes the function of map synergy and cached data sharing between the clients by mobile agent.
Dynamic cache mechanism based on intelligent agent creates cache spaces on the server-side and the client-side, respectively. Server-side cache is maintained by multiple applications terminal jointing, while the client cache is maintained by each application terminal separately. The caching model adopts version-based caching strategy according to the layer version, the version of the spatial domain feature, and the version of cached data sheets. Due to the quadsplit, relationship exists between the spatial domains trellises coded, so when retrieving in the index tree, we can skip certain levels of spatial domain node and query directly to a leaf node. Cache model is shown in Figure 3.
LM represents the layer data block metadata; version is the number of the version for the cache layer elements sets; index Tree is the quad index tree for finding spatial elements, the type of each node of the index tree is domain metadata. A one-to-one relationship exists between each node and a quadsplit map (spatial domain). The maximum depth of the search tree equals to the zoom level supported by the platform.
DM represents spatial index tree node, version is the version number of cache space domain element sets; visit time represents the last access time of the spatial domain used in the LRU algorithm; extent represents the scope of the space domain used in priority replacement algorithm based on farthest distance; children represents the pointer pointing to the subspace domain; and features is used to save entry address of feature set in the region.
The feature collections are saved in the cache data sheet Buffer table. BT represents data sheet, featureColl is cached data collection, the features cached in the data table can be shared by all spatial domain.
FI represents cached feature items model, feature represents the cached elements; version represents the version of the cached feature items; and referenceCount stand for the times a feature is referenced. When the counter is 0, the occupied storage space can be recycled.
The Scientific World Journal 7 Based intelligent agent dynamic caching mechanism, where the power WebGIS platform is able to meet the efficient data access and real-time requirements, significantly improve the hit rate of the data and effectively accelerate the speed of data access and graphics rendering efficiency.

Experimental Results
According to the dynamic cache model proposed in this paper, we design the test for vector data cache. That is to say, the elements in the vector layer cache are to be tested. Database cache refers to the unique index created on the feature id field of feature table. Create cluster index so as to index features by spatial domain (tiles) id field. Server-side and client cached data means to establish the mapping between layer and space domain set in layer; the mapping between spatial domain and features set entry address buffered in spatial domain to improve features search efficiency.   Figure 4 showed the experimental results, from which we could conclude the following.
(1) The response time of the two ways was low with the smaller concurrent users, but the response time of noncaching mode was 2 times that of caching mode.  (2) The response time of the two ways both increased as the concurrent users added, but the response time of noncaching mode increased faster, and the response time of noncaching mode was 4.2 times than that of caching mode when the concurrent users reached 100.
(3) The response time could be lower obviously when the dynamic display caching model was used, while the advantage with caching mode was greater and greater as the concurrent users. Dynamic display caching could shorten the system response time by 2-4.2 times.

Conclusion
Aiming at the key problem affecting the power performance of WebGIS-caching mechanism, this paper presented a dynamic display cache model, which makes a research on dynamic display cache technology based on intelligent agent, designs the power WebGIS dynamic cache structure, and cached data model. The application of the intelligent caching technology can greatly improve the WebGIS graphics loading speed and the response efficiency when dealing huge amounts of data, improve user concurrent traffic, and balance the network load. But research is still insufficient; the future research direction is described below.
(1) Smart cache can improve the loading speed of vector graphics and meet the needs of two-dimensional GIS, but for Digital Elevation Model (DEM), aerial data, there are no efficient load acceleration solutions.

8
The Scientific World Journal (2) Mobile agent can improve the client cache sharing and improve the response speed of the map, but further study on cache data security and the mobile agent secure communications is needed.