Research on Heterogeneous Digital Map Resource Query Algorithm Based on Web Services

. Based on the current situation of digital map resource interconnection and mutual inspection, this paper studies three modes of unified retrieval of traditional guided data sources, and proposes a digital map resource retrieval model based on Web Services. This paper also designs digital map resources unified retrieval result fusion algorithm and metadata update algorithm based on Web Services in detail, which can be used for the development of digital map resource unified retrieval system.


Introduction
In the network environment, digital map resources are growing rapidly. There are more and more map database management systems with map query function for these digital map resources. However, these map database management systems are independent of each other, resulting in lack of necessary links among various database management systems and causing the phenomenon of "information islands" [1] , which makes it takes a lot of time and effort for users to perform map query, and the precision and recall rate are not high. The unified query system of heterogeneous data sources solves the query problem of distributed heterogeneous data sources to a certain extent. It can integrate the query function of each map database management system, provide users with a unified map query interface, and send the user's map query request to each map database management system, and it can also invoke query function of the system, and present the map query results of each system to the user in a unified format. The unified query system of heterogeneous data sources does not require users to frequently log in to all map database management systems, thereby saving a lot of time and effort and effectively improving the efficiency of map query.

Analysis of unified query algorithm for traditional heterogeneous data sources
At present, the unified query mode of heterogeneous data sources mainly includes middleware mode, metadata integration mode and web query proxy mode [2] .

Middleware mode analysis
The middleware mode first uses the middleware technology [3] to decompose the user's query request into independent query requests of each data source, access the data sources in real time through the standard query interface, and then return the query results through the unified query system of heterogeneous data source to the user after unified processing. This mode has the characteristics of good real-time performance, and the user can retrieve the latest data of the data source; the user's data query is implemented directly through the middleware, so the data source does not need to release a dedicated service to the user. However, each data source terminal must provide a standard query interface, and the query speed of each data source is different, thereby affecting the query efficiency of the user; in addition, the integration technology and middleware development technology of each data source query result need reasonable planning. Therefore, the middleware mode is suitable for heterogeneous data sources with standard data access interfaces.

Metadata integration mode analysis
The metadata integration mode is widely used in the current unified query system of heterogeneous data sources. After indexing each data source according to a certain standard, a metadata set usually stored in a database is formed, and then communicated with the client through a publishing system [4] . The information obtained by the heterogeneous data source query system using the mode integration is the metadata description information for each data source. The user retrieves information directly from each data source through a specific connection. This mode is characterized by the query method and speed are not affected by the original data source, metadata query and data acquisition are implemented through separate services, but the synchronization between the metadata and each data source is poor, and the index of the mode and organizing metadata will consume more resources. Therefore, the metadata integration mode is suitable for data sources that do not change frequently or data sources that have high consistency of metadata.

Web query proxy mode analysis
The application premise of the web query proxy mode is that each data source should have web publishing and information query functions, but these data sources generally only provide less metadata information, and rarely provide a standard query interface. The mode obtains the metadata information through distributed webpage query proxy simulating the user sending request to the website of each data source, and returns to users after integrating all the acquired metadata information. This mode is characterized by highgranularity, real-time query of many online resources, thus greatly improving the user's precision; However, in order to obtain more metadata information, the Web structure hierarchy and data organization mode of each data source must be analyzed in detail, and different query requests need to be converted in order to meet the interaction requirements of each data source. In addition, unified metadata standards, data integration mechanisms and publish results mechanisms shall be formulated.

Design of digital map resource query mode based on web services
Through the introduction of the three modes of unified query of traditional heterogeneous data sources in the previous section, it can be seen that there will occur various problems for the application of digital map resource publishing and query systems for any of these three modes. Such as metadata standards, query interface standards, data integration, and poor maintainability. Therefore, these three modes cannot effectively and completely solve the platform heterogeneity, data heterogeneity, protocol heterogeneity and data integration and other key problems of the digital map resource publishing and query system thus it cannot meet the needs of users.
Through the analysis of the unified query mode of traditional heterogeneous data sources, the digital map resource publishing and query system based on Web Services will adopt a combination of middleware mode and metadata integration mode, namely map query service query and local meta-database query. The map query service query is a method in the middleware mode, and local spatial metabase query is a method of metadata integration mode. The query principle of this mode is: When the user inputs a keyword for map query, the local spatial metabase of the system is first queried. If the keyword exists in the spatial metabase, the local spatial metabase database is directly used for map query, otherwise the map query service is used for map query, and store the query results in the system's local spatial metabase. Through the combination of such map query service query and local spatial metabase query, the spatial metabase of the system will be continuously enriched, so the more query times of the system, the more perfect the spatial metabase will be. This effectively solves the problem of poor consistency of metadata of each data source in the metadata integration mode. When the keyword exists in the metabase, the system uses the local spatial metabase for map query, which also avoids the defect of the middleware mode. Therefore, the combination of map query service query and local spatial meta-database query avoids the shortcomings of these two modes and integrates the advantages of the two modes, effectively improving the efficiency of map query and enriching the spatial metadatabase of the system. It broadens the scope of application of the system, so that the system has the advantages of good consistency, real-time and synergy.

Research on unified query algorithm of digital map resources
The digital map resource unified query algorithm runs through the entire process from the user sending the query request to displaying the query result. After the user inputs the query keyword and sends the query request, the system first sends the request to the local data source of the digital map resource publishing and query system, and then the digital map resource publishing and query system will judge whether there is a user requested query in the database. Whether there is a keyword input by the user in the query service and spatial metabase requested by the user in the database, and then performing different operations according to different judgment results. This judgment has four different results: (1) The query service exists in the database and the query keyword exists in the spatial metabase. In this case, the digital map resource directly returns the corresponding metadata in the spatial metabase of the local data source.
(2) The query service does not exist in the database and the query keyword exists in the spatial metabase. In this case, it is the same as the execution result of the first case.
(3) The query service exists in the database and the query keyword does not exist in the spatial metabase. In this case, the digital map resource is directly called to query the query service of the local data source.
(4) The query service does not exist in the database and the query keyword does not exist in the spatial metabase. This situation can be realized by calling the query service of each digital map resource. The system firstly follows the provisions of the digital map resource publishing and query protocol to process the request, and then forward the processed request to each digital map resource, and recall the respective query services uniformly, and return the query results in the format specified by the digital map resource publishing and query protocol respectively, and finally merge all the query results, and return to the digital map resource publishing and query platform in the format required by the digital map resource publishing and query platform. The specific design of the unified query algorithm flow chart is shown in Figure 1.

Research on the fusion algorithm of unified query results of digital map resources
It can be seen from the workflow of digital map resource publishing and query system based on Web Services that the unified query result fusion of digital map resources is an important part of the system, mainly including map resource query result format verification, map resource query result merging, deduplication of map resource query results, and map resource query result format conversion.

Map resource query result format verification
Since the query result returned by the calling query service is a string in XML format, the format verification of the map resource query result can be completed by XML Schema, thereby converting the format verification of the query result into verification of single XML document, and verifying conditions are defined in an XML Schema document.
The process of the query result format verification is as follows: (1)Obtain the location of the XML Schema document schemaUrl; (2)Verify whether the format of the resultXml document is valid by using an XML Schema document; (3)If valid, the query result string tempResultXml, the query keyword, and the query service name are all encapsulated into the query result object queryResultWrapper, and the queryResultWrapper is added to the query result object list resultsWrapperList; if invalid, return the result that verification is invalid.

Merging of map resource query results
The merging of the query results of the map resources is to encapsulate all the verified query results returned by the digital map resources into an XML document with unified format, which not only completes the unified merging of the query results, but also facilitates subsequent deduplication and format conversion. The flow chart of the map resource query result merging algorithm is shown in Figure 2.

Map resource query results deduplication
For the digital map resource publishing and query system, since the databases of the respective digital map resources are independent, the construction of their metabases is also completely independent, so when the query results are returned from the respective digital map resources, these results inevitably contain a large number of duplicate records. In order to remove these duplicate records, the paper designs the corresponding deduplication algorithm. The paper adopts XSLT technology to perform deduplication operation for query results. The XSLT document defines the conditions for deduplication and the elements and order in the XML document after deduplication. If different digital map resources return the same query record, the query record of the digital map resource with the highest level of duplicate record retention of the digital map resource of the lower level is removed.
The flow of the map resources query result deduplication algorithm is as follows: (1) Process deduplication to resultXML according to the condition of xslUrl; (2)Construct the query result XML object resultUltimaXML after deduplication; (3) Save the deduplicated XML document into the resultUltimaXML object; (4) Return the deduplicated query result XML document resultUltimaXML.

Map resource query results format conversion
The map resource query result format conversion is a form in which the deduplicated query result is converted into a collection list, which facilitates subsequent sorting and page binding work. The flow chart of the map resource query result format conversion algorithm is shown in Figure 3.

Research on spatial metadata updating algorithm
When the system performs the local spatial metadata update operation, it will simulate the map query request, call the Web service query of each digital map resource and the local spatial metabase, and return the query results. It will also retain the same part of query results in the local metabase and the called Web service of each digital map resource and then delete the different part of query results in the local metabase and the called Web service of each digital map resource, and finally it will add the part of the spatial metabase query result of digital map resource publishing and query system local data source that is different from the Web service query result of called digital map resource to the local spatial metabase.
The local spatial metadata update algorithm flow is as follows: (1)Construct a query keyword object QueryWord and query service object MapQuery, and assign them corresponding values; (2)Call the Web query service of each digital map resource, and save the result to the WebServicesResultList; (3)Call the local spatial metabase query service and save the result to the LocaleResultList; (4)Retain the same part of LocaleResultList and WebServicesResultList in the local spatial metabase; (5)Delete the different part of LocaleResultList and WebServicesResultList in the local spatial metabase; (6)Add the different part of the WebServicesResultList from the LocaleResultList to the local spatial metabase.

Conclusion
With the rapid development of network technology and the promotion of information construction, the application and interaction requirements of electronic maps continue to deepen, and more and more users hope to obtain convenient electronic map services through the network. The heterogeneous digital map resource query technology studied by the thesis can provide users with automatic discovery and active service functions; the proposed unified query mode of digital map resources based on Web Services not only solves the defects of traditional heterogeneous data source query mode, but also integrates the advantages of map query service query and local spatial meta-database query. The designed digital map resource query result fusion algorithm and metadata update algorithm improve the query efficiency of digital map resources, realize the great sharing of digital map resources, expand the use of digital map resources, and promote the development of the networkization, informatization, commercialization and socialization of digital maps.