CN113934539A - Construction method of geographic information service system based on micro-service architecture - Google Patents

Construction method of geographic information service system based on micro-service architecture Download PDF

Info

Publication number
CN113934539A
CN113934539A CN202111196973.3A CN202111196973A CN113934539A CN 113934539 A CN113934539 A CN 113934539A CN 202111196973 A CN202111196973 A CN 202111196973A CN 113934539 A CN113934539 A CN 113934539A
Authority
CN
China
Prior art keywords
service
map
services
center
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111196973.3A
Other languages
Chinese (zh)
Other versions
CN113934539B (en
Inventor
蒉露超
占伟伟
何建清
张一鸣
周传龙
牟苏斌
刘青峰
陈巍然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CETC 28 Research Institute
Original Assignee
CETC 28 Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CETC 28 Research Institute filed Critical CETC 28 Research Institute
Priority to CN202111196973.3A priority Critical patent/CN113934539B/en
Publication of CN113934539A publication Critical patent/CN113934539A/en
Application granted granted Critical
Publication of CN113934539B publication Critical patent/CN113934539B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Abstract

The invention discloses a construction method of a geographic information service system based on a micro-service architecture, which comprises the following steps: step 1, constructing a service center; step 2, constructing a configuration center; step 3, constructing gateway service; step 4, constructing service monitoring and statistics; step 5, building a map service based on tiles; step 6, constructing an image data service; step 7, constructing a model service; step 8, constructing a meteorological hydrological data service, and dividing the meteorological hydrological data service into more than two services based on a spatial grid splitting method to realize distributed cluster deployment of the meteorological hydrological data service; and 9, constructing the micro-service by using Docker. The invention provides the service management capability, all the services are managed uniformly and are placed in the service center, so that the cluster deployment of the single service is better realized.

Description

Construction method of geographic information service system based on micro-service architecture
Technical Field
The invention belongs to the technical field of electronic information, and particularly relates to a construction method of a geographic information service system based on a micro-service architecture.
Background
With the rapid development of a geographic information system (GIS for short), more and more contents need to be displayed in a geographic information system scene in an actual project, more and more types of managed data are provided, the scene display precision is higher and higher, the processed data volume is larger and larger, and the processed concurrency is larger and larger. The traditional approach is to integrate these new presentations in an existing system, optimize the data processing logic, deploy clusters to improve concurrency handling. However, with the increasing functional requirements of the market on the geographic information service system, integrating new functions and processing a large amount of data on a single geographic information system will result in an increasing volume of the system and an increasing complexity of internal logic. The cluster service expanded for processing multiple concurrency problems is difficult to quickly know that a certain service in a cluster is down due to lack of unified management and monitoring of the service, and cannot quickly troubleshoot and solve the problems. The addition is always performed in the original system, and even the system is finally disabled in serious cases.
The single application has more and more codes, and when the dependent resources are more and more, the compiling, packaging and deploying of the application are very time-consuming once. The system has poor high availability, resources cannot be isolated, each functional module of the whole single system depends on the same resources such as a database, a memory and the like, and once a certain functional module improperly uses the resources, the whole system is dragged down. When the data volume and the access volume of the single system are larger and larger, the response speed of the map data service is reduced, and the service is blocked or even killed after the access volume reaches a certain threshold value. The single system can be expanded horizontally and deployed on a plurality of machines to form a cluster, but the expansion is not flexible expansion, the request for a certain function is highly concurrent, the whole system is required to be clustered frequently, the expansion as required cannot be realized, and the clusters do not have unified management and monitoring.
In order to solve the problems that the geographic data single service is bloated when facing more and more functions, complex, large in data size, large in access amount, low in response efficiency of map service, and capable of causing blocking and even dead of the service after the access amount reaches a certain threshold, and the single service level expansion is inflexible, a new construction method based on micro service is urgently needed.
Disclosure of Invention
The purpose of the invention is as follows: the technical problem to be solved by the invention is to provide a method for constructing a geographic information service system based on a micro-service architecture aiming at the defects of the prior art, wherein the micro-service architecture can quickly respond to increasing requirements in the geographic information system, the micro-service architecture splits services based on a domain model, and one micro-service only focuses on one specific service function, so that the services are clear, and the development and maintenance are simple with less codes; local repair is easy; the system has service management and is easy to manage and monitor service; the technology stack is not limited, each micro service can select different technical routes, data management is not redundant, and each micro service is provided with a corresponding database. Meanwhile, the micro-service based on certain service data can be subdivided based on the concept of space grid subdivision, so that the big data processing capacity and the high concurrent request response capacity of the geographic information service system are improved, the geographic information service system is convenient to expand and is easy to deploy to a cloud server.
In order to achieve the purpose, the invention discloses a method for constructing a geographic information service system based on a micro-service architecture, which comprises a service center, a configuration center, a gateway service, a service monitoring and statistical service for constructing a map service, an image data service, a model service, a meteorological hydrological data service and a micro-service framework module for providing service management after the geographic information service system is split.
In order to improve the large data processing capacity and the easy expansion capacity of the geographic information service system, the geographic information service system is divided into a map service, an image data service, a model service and a meteorological hydrological data service according to the heterogeneous characteristics of data sources. And in the later stage, if other service data (such as satellite orbit) needs to be processed in the system, a micro-service module can be developed and registered in a service center. All micro services are uniformly registered in a service center, a gateway acquires corresponding service names in the service center according to requests of users, each service can register a plurality of map services in the service center, for example, the map services are distributed in a plurality of servers because a map scene is the basis of a geographic information service system, the access amount is large, the map services can be deployed in the servers and then are uniformly registered in the service center, the gateway distributes the requests of different users to different map services in the service center according to a space grid subdivision method and a load balancing strategy, and when a certain map service fails due to other reasons, service monitoring can be detected at the first time and reported to a system administrator. The high concurrent response speed and the unified management of the service of the geographic information system are realized.
The invention comprises the following steps:
step 1, constructing a service center;
creating a service center application that adds dependencies on Eureka (a component of the microservice framework that provides service registration and service discovery capabilities) in a configuration file to create a service center microservice; adding annotations @ EnableEurekaServer and @ EnableDiscoveryClient into the starting class code of the service center engineering, and directly operating a main (program starting entry) method of the starting class of the engineering, namely starting the service end of the service center;
adding service registration dependence in configuration center service, gateway service, service monitoring and statistical service, map service, image data service, model service and meteorological watermark data service, then adding annotation @ EnableDiscoveryClient in application (program starting main class), adding configuration information about service registration in configuration file, and finally starting service, namely registering to the service center.
The service center is used for registering and discovering all the micro services, and the service center can request all the micro services registered in the service center at regular intervals through a heartbeat mechanism to detect whether the registered micro services are normal or not.
Step 2, constructing a configuration center;
a configuration center application is created that adds dependencies on configuration center modules in a configuration file to create a configuration center microservice.
Adding annotation @ EnableConfigServer to the entry class of the configuration center microservice, and starting the function of the configuration server; configuring a local folder path in a configuration file of a program for storing a warehouse of the configuration file;
adding configuration center dependence in configuration center microservices, adding related information about the configuration center in configuration files bootstrap.
The configuration center mainly provides dynamic configuration of each micro service, and updates configuration information in the service without restarting the service, such as updating a data path.
Step 3, constructing gateway service;
creating a gateway application, and adding a dependency about a gateway in a configuration file to create a gateway service;
adding annotation @ EnablZuuyProxy in a starting class of gateway service, and starting a gateway routing function;
and adding gateway related content in the configuration file, and routing the request to a specific micro service by the gateway according to the request path, the load balancing strategy and the space P subdivision rule.
The gateway intercepts all user requests, acquires corresponding services in the service center for processing according to the request path and the load balancing strategy, and returns the processing result. The distributed cluster deployment and load balance of the service are realized through the gateway and the service center, and the processing capacity and the high-concurrency response capacity of big data are improved.
Step 4, constructing service monitoring and statistics;
and 5, constructing a map service, dividing the map service into more than two services based on a space grid subdivision method (dividing the world into four map services according to the longitude and latitude, wherein the four map services are respectively responsible for quartering the west longitude 180 degrees and the north latitude 90 degrees to 0 longitude 0 latitude, the west longitude 180 degrees and the south latitude 90 degrees to 0 longitude 0 latitude, the east longitude 180 degrees and the north latitude 90 degrees to 0 longitude 0 latitude, and the east longitude 180 degrees and the south latitude 90 degrees to 0 longitude 0 latitude), and respectively deploying a plurality of map services in each area to realize distributed cluster deployment of the map service.
The Map service is based on tiles, common Map Tile data comprises hash Tile files in picture formats such as Jpeg and png and compressed Tile files in bundle formats produced by an ArcGIS Server, no matter which Map Tile data is used as a direct data source of WMTS (Web Map Tile service), and the Map Tile service acquires data corresponding to one by one through the Map Tile level, the row number and the column number and provides the Tile data service through a WMTS service interface. The Map Service based on the tile data is a tile data Service which is in accordance with Service interface specifications of WMTS (Web Map Service) and WMS (Web Map Service) and the like and is provided to the outside by carrying out logic operation and graphic recombination and integration on the acquired tile data on the basis of using Map tiles as a direct data source of the WMTS Service. In the prior art, each map service needs to search and recombine the local map tile file, so that the efficiency is low and the speed is low. The invention provides tile data cache, load balance, distributed cluster access of tiles and distributed cluster calculation through a micro-service framework, when a user accesses a map service of a certain area, a gateway load is balanced to one map service or a plurality of map services of a corresponding area, the map service firstly searches in a cache database, if not, the tiles are quickly searched, positioned and scheduled through a grid index, the tiles at the junction are fused on line, the searched tile maps are aggregated, and the map requested this time is cached in a memory cache database. And improving the access speed of the same map service next time. The map tiles formed by overlapping the map services from a plurality of regions can be obtained when a user accesses one aggregated service at the client, the network and client operation pressure generated by a large number of access tiles of the user is reduced, and the aggregated access efficiency of the map services is improved.
Step 6, constructing an image data service, and dividing the image data service into more than two services based on a spatial grid splitting method to realize distributed cluster deployment and parallel computation of the image data service;
and performing parallel slicing and storage on the image data and the elevation data according to a defined tile slicing rule based on the image data service of distributed computation. A common image slicing rule is google slicing rule, which is a rule that a map is divided into four parts at a first level based on Web mercator projection. The other type is a rule that divides a map into two at a first level based on the WGS84 coordinate system, represented by a sky-earth map slicing rule. And performing distributed computation on the slicing tasks according to the slicing rules based on the distributed computation-based image data service, and uniformly storing the slicing tasks into a database. The existing image data processing technology is usually multi-thread blocking processing, a plurality of threads are started to process data one level at one level according to a slicing rule, and the data processing of the next level is usually dependent on the data processing result of the previous level. When the image data service based on the micro-service architecture is used for processing data, the gateway balances the load of the image data into one or more image data services according to the image range, the image service cluster simultaneously processes the 0-level to 10-level data of the image in parallel, the data processing is independent of each other and is distributed on different servers, and the rapid processing and storage of the data are achieved.
Step 7, constructing a model service;
step 8, constructing a meteorological hydrological data service, and dividing the meteorological hydrological data service into more than two services based on a spatial grid splitting method to realize distributed cluster deployment of the meteorological hydrological data service;
and 9, constructing the micro-service by using Docker.
In step 1, the service center provides a service registration and service discovery function to realize load balancing and fault transfer of the intermediate layer server, a service provider (here, a service registered to the service center) sends service information to the service center after starting, the service center writes the service information into a registry after receiving the service information, and then, the service center synchronously (asynchronously) guarantees data consistency for all service centers in the cluster;
the provider of the service (here, the service registered to the service center) contracts for the service by sending a heartbeat (per 30 seconds by default) to the service center; if the client continues to fail to make a reservation, the service center will remove it from the server's registry in about 90 seconds; the registration information and the renewal are copied to all nodes of the service center in the cluster; therefore, the current service is ensured to be in a running state and can be called.
When a service needs to call a map service or a model service, the map service or the model service information of the service center is pulled after a client (here, the service registered to the service center) is started, and when the service needs to be called, the information is acquired in a local cache of the client to call the service.
In a distributed development architecture, services of any single point cannot be guaranteed not to be interrupted, so a service registration discovery mechanism is needed, and after a certain node is interrupted, a service consumer can timely sense that high availability of the services is guaranteed.
In step 2, the configuration center provides a global configuration and configuration hot update function, so as to realize the configuration concentration and hot update of the system (under the condition of not restarting other services, the configuration in the service is updated); the process of updating the configuration through the configuration center comprises the following steps:
when the map data path configured in the map service is changed, a user only needs to change a local configuration file in the lower configuration center, modify the data path of the map service into the latest data path in the configuration file, and call a refresh interface, so that the data paths of all the map services in the whole system can be updated successfully.
In step 3, the gateway service provides a request routing and load balancing function to realize a high concurrent service response speed, and the service request flow through the gateway service includes:
based on the concept of space grid subdivision, the world is divided into four parts along the longitude and latitude directions to obtain map services with the same four areas, for the first area, namely the first area, a user requests the map services, a gateway can find node information of the map services from a service center, if the node information of the map services is found, a load balancer can judge whether the map services in charge of the area are available, then the map services capable of processing the current request are selected preferentially, if one map service in charge of the area is processing the request, the load balancer can then find other map services in charge of the area until the map services in the area with processing capacity are found, the gateway can send the request to the found map services, and after the map service request is successful, the successful information can be fed back to the user, so that the load balance of the services is realized.
Step 4 comprises the following steps: a service monitoring and statistics application is created, and dependencies on service monitoring are added to create a service monitoring microservice in a configuration file.
And adding an annotation @ EnablAdminserver in a service monitoring engineering starting class, and starting a service monitoring function.
Other micro services introduce the dependence of service monitoring, expose the monitoring interface to the outside for service monitoring and statistical service, monitor the interface exposed to the outside of each micro service by the service monitoring and statistical service, monitor the working state (including the running memory condition, the database connection condition, etc.) of each micro service, and realize the unified management of the micro services.
The step 5 comprises the following steps: creating a map service application program, adding a third party dependence required by a map service in a configuration file, performing quartering two-dimensional subdivision on the whole world along the longitude and latitude directions based on the concept of spatial grid subdivision to obtain the map service with four identical regions, taking the obtained map service as a spatial subdivision basis, performing quartering tree subdivision on data fineness according to user access amount (quartering the whole world along the longitude and latitude directions based on the concept of spatial grid subdivision to obtain the map service with four identical regions, taking a first region as an example for explanation, if the user access amount of the first region is large (generally the default access amount exceeds 5000 can be judged to be large, the user can also define the upper limit of the access amount), the data fineness is high (generally the resolution of the region is used for judging the data fineness), performing quartering again on the region along the longitude and latitude directions, and so on), the map service is realized.
The Map service is based on tiles, common Map Tile data comprises hash Tile files in picture formats such as Jpeg and png and compressed Tile files in bundle formats produced by an ArcGIS Server, no matter which Map Tile data is used as a direct data source of WMTS (Web Map Tile service), and the Map Tile service acquires data corresponding to one by one through the Map Tile level, the row number and the column number and provides the Tile data service through a WMTS service interface. The Map Service based on the tile data is a tile data Service which is in accordance with Service interface specifications of WMTS (Web Map Service) and WMS (Web Map Service) and the like and is provided to the outside by carrying out logic operation and graphic recombination and integration on the acquired tile data on the basis of using Map tiles as a direct data source of the WMTS Service. In the prior art, each map service needs to search and recombine the local map tile file, so that the efficiency is low and the speed is low. The invention provides tile data cache, load balance, distributed cluster access of tiles and distributed cluster calculation through a micro-service framework, when a user accesses a map service of a certain area, a gateway load is balanced to one map service or a plurality of map services of a corresponding area, the map service firstly searches in a cache database, if not, the tiles are quickly searched, positioned and scheduled through a grid index, the tiles at the junction are fused on line, the searched tile maps are aggregated, and the map requested this time is cached in a memory cache database. And improving the access speed of the same map service next time. The map tiles formed by overlapping the map services from a plurality of regions can be obtained when a user accesses one aggregated service at the client, the network and client operation pressure generated by a large number of access tiles of the user is reduced, and the aggregated access efficiency of the map services is improved.
The step 6 comprises the following steps: creating an image data service application program, adding a third party dependence required by an image data service in a configuration file, carrying out quartering two-dimensional subdivision on the whole world along the longitude and latitude directions based on the concept of space grid subdivision, obtaining the image data service with the same four areas, taking the obtained image data service as a space subdivision basis, carrying out quartering tree subdivision according to the user access amount and the data fineness (quartering the whole world along the longitude and latitude directions based on the concept of space grid subdivision, obtaining the image data service with the same four areas, taking a first area as an example for explanation, if the user access amount of the first area is large (the user can define the upper limit of the access amount to be large and the user can define the upper limit of the access amount) and the data fineness is high (the data fineness is generally determined by the resolution of the area), carrying out quartering again on the area along the longitude and latitude directions, and so on) to realize the image data service.
The image data service is based on distributed computing and provides image slicing and image correction services. The image slice is used for slicing and storing the image data and the elevation data according to the defined tile slice rule. A common image slicing rule is google slicing rule, which is a rule that a map is divided into four parts at a first level based on Web mercator projection. The other type is a rule that divides a map into two at a first level based on the WGS84 coordinate system, represented by a sky-earth map slicing rule. And performing distributed computation on the slicing tasks according to the slicing rules based on the distributed computation-based image data service, and uniformly storing the slicing tasks into a database. The existing image data processing technology is usually multi-thread blocking processing, a plurality of threads are started to process data level by level according to a slicing rule, and the data processing of the next level is usually dependent on the data processing result of the previous level. When the image data service based on the micro-service architecture is used for processing data, the gateway balances the load of the image data into one or more image data services according to the image range, the image service cluster simultaneously processes the 0-level to 10-level data of the image in parallel, the data processing is independent of each other and is distributed on different servers, and the rapid processing and storage of the data are achieved. The image data correction is generally a multi-thread one-time processing in the prior art. The invention loads data into one or more image data services through the gateway, and the image data clusters parallelly correct the image data and merge the corrected images.
The step 7 comprises the following steps: and creating a model service application program, and adding third party dependence required by the model service in a configuration file to realize the model service. The model service provides functions of analyzing model data and issuing the model data to the outside, and the model is convenient to increase in scenes.
The step 8 comprises the following steps: creating a meteorological hydrological data service application program, adding a third-party dependence required by meteorological hydrological data services into a configuration file, carrying out quartering two-dimensional subdivision on the globe along the longitude and latitude directions based on the concept of spatial grid subdivision, obtaining the meteorological hydrological data services with the same four areas, taking the obtained meteorological hydrological data services as a spatial subdivision basis, carrying out quartering tree subdivision according to user access amount (quartering the globe along the longitude and latitude directions based on the concept of spatial grid subdivision, obtaining the meteorological hydrological data services with the same four areas, taking the first area as an example for explanation, if the user access amount of the first area is large (generally, the default access amount exceeds 5000, the user can judge that the access amount is large, the user can also define the upper limit of the access amount), carrying out quartering again on the area along the longitude and latitude directions, and so on), the meteorological hydrological data service is realized, and the response capability and the data processing capability of the meteorological hydrological data service are improved. The meteorological hydrological data service provides functions of analyzing, storing, searching, analyzing and the like of meteorological hydrological data externally.
Step 9 comprises:
adding a docker dependency in a dependency management configuration file in the built micro-service module program, writing a docker File file and executing a maven mirror image for creating the docker mirror image.
Through the load balancing and space grid splitting method, the servers can be guaranteed to respond quickly even under the condition of heavy load, and the service can not be interrupted when one or more servers are unavailable. The invention improves the high concurrency response speed and the data processing capacity of the geographic information service system.
The invention divides the whole geographic information service system into a plurality of different micro services, such as map service, model service, image data service, meteorological hydrology service and the like, according to the heterogeneous characteristics of geographic data sources. And simultaneously, dividing each micro service into a plurality of regional service bodies according to a space grid splitting method. According to the request amount and the processing data amount, each micro-service can select a cluster to be deployed to different servers, so that the processing pressure of a single server is relieved. Meanwhile, the integrated management capability of each micro service after splitting is provided, and monitoring and statistics of services are carried out through a service center, a configuration center, a gateway service and the like. And uniformly managing and scheduling the split service. The large data processing capacity and the high concurrent request response capacity of the geographic information service system are improved, so that the geographic information service system is convenient to expand and easy to deploy to a cloud server.
The invention has achieved the decentralized data management based on the architecture method of the microservice, in the geographic information system, the most important module is the management of the geographic data, we will have different business data according to the difference of the business, and different business data have own peculiar data attribute, in order to can meet these requirements, when the monomer is applied to the implementation, often adopt the database design to include all business data attributes, such database design has very large data redundancy, the data handling efficiency will be very low naturally, and the microservice architecture method, every microservice can have independent databases, every microservice like this, according to the characteristic of database access, the data bulk characteristic, the business data characteristic processed can choose different database management systems. The data processing is specific and accurate, so the data processing efficiency is greatly improved.
The micro-service-based architecture method achieves service management, and the micro-service not only simply divides applications, but also comprises service registration/discovery, a configuration center, a gateway, service fusing, overload protection and the like, so that management and monitoring of each micro-service can be managed in real time and rapid cluster management of a certain micro-service can be achieved.
The split services are respectively deployed to different servers, and are registered to a service center together with gateway services, configuration center services, service monitoring and statistical services, and are managed by the service center. When a user requests service, the request firstly reaches the gateway service, the gateway service goes to the service center to obtain all available microservices at present, then the request is routed to the corresponding service according to a load balancing strategy (the load balancing strategy has a weight strategy and a polling strategy, if a certain service in the service center has a plurality of services, if the map service registers five services in the service center, the polling strategy can circularly distribute the request of the user to the five services according to the sequence, and the weight strategy preferentially distributes the request of the user to the service with large weight according to the weight of the service) and a space partitioning method, so that the high concurrent response capability of the geographic information service system is improved. The configuration center provides hot update of configuration information (i.e. update of configuration information in a micro service is realized without restarting the micro service, such as update of data storage path information in an image data service). The service monitoring and counting service acquires all current services registered in the service center according to the service discovery capability provided by the service center, monitors the health state of all micro services through a heartbeat mechanism (calling each micro service interface at a certain time interval and checking whether the service has a response), and counts the access amount of each micro service according to log information. The invention realizes the distributed cluster deployment and the management of the whole life cycle of the geographic information service system, improves the big data processing capability and the high concurrent request response capability of the geographic information service system, facilitates the expansion of the geographic information service system and is easy to deploy on a cloud server.
The invention uses Spring Boot (Spring Boot is a frame, a brand new programming specification, and simplifies the use of the frame) to develop the application microservice.
The invention has the beneficial effects that:
1. the loading efficiency of the map and the data processing capacity are improved under the high concurrency condition.
2. Flexible distributed cluster deployment and load balancing of services can be achieved.
3. The service management capability is provided, all the services are managed uniformly and are placed in the service center, and therefore cluster deployment of single service is achieved better.
4. Enabling rapid deployment of services onto cloud servers.
Drawings
The above and other advantages of the present invention will become more apparent from the following detailed description of the invention when taken in conjunction with the accompanying drawings.
FIG. 1 is a flow chart of the present invention.
FIG. 2 is a deployment architecture diagram of the present invention.
Detailed Description
As shown in fig. 1 and fig. 2, the present invention uses Spring Boot (Spring Boot is a framework, a new programming specification, which simplifies the use of the framework) to develop application micro-services, and implements functions of service center, configuration center, gateway service, service monitoring and statistics, map service, model service, image data service, weather and hydrologic data, etc., the service center performs fine management on complex and diversified service modules, the gateway service provides intelligent routing and load balancing, the configuration center provides a centralized external configuration for all environments of each application, so that the maintenance is more convenient and simple, the monitoring and statistics of the service implements monitoring management of service states and statistics of access volumes, so that users can know the operation states and access volumes of each service, the image data service, and the weather and hydrologic data service are mainly a whole set of business processing micro-services developed based on micro-service architecture, the map service provides web service of vector and raster data, realizes the publishing function of shape files and image files, and provides standard web service of OGC to the outside.
The principle of the invention is as follows: the construction method of the geographic information service system based on the micro-service architecture comprises a service center, a configuration center, a gateway service, service monitoring and statistics, a map service, a model service, an image data service, a meteorological hydrological data service and the like.
The mutual linkage of the services can be used for processing the functions of service issuing, obtaining, management and the like based on geographic information data when a user uses the system at ordinary times, the running state of each service can be monitored in real time in the using process, the service of the OGC standard can be issued by the system to be called by other clients, and the monitoring and the management of the service can also be realized.
The construction method comprises the following steps:
service center
The service discovery is one of key principles in a micro-service architecture, the service center provides discovery and registration functions of services, and the service center can be quickly and conveniently realized by using the Eureka.
The specific service discovery and registration implementation steps are as follows:
(1) a service center application is created that introduces the relevant dependencies of eureka in the configuration file.
(2) Adding annotation @ EnableEurekaServer @ EnableDiscoveryClient to the start class of the service center service, and directly running a main method in the start class of the service center service to start the service center service. In other services, firstly adding a service registration dependency in a dependency configuration file, secondly adding an annotation @ EnableDiscoveryClient in an application main class, secondly adding configuration information about service registration in the configuration file, and finally starting the service, wherein the EurekaClient can automatically register the service to a service center. The service instance registered online can be observed when the browser opens the address of the registered service center.
Second, start the service of the configuration center
The configuration center provides external configuration support for the system, so that the system can update the configuration under the condition of not shutting down, and the hot update of the configuration is realized. The configuration center service can be quickly and simply realized by using the Config, and the specific realization steps are as follows:
(1) and creating a configuration center application program, and introducing related dependence of the configuration center service Config into a dependence configuration file.
(2) Adding @ EnableConfigServer annotation to an entry class of the configuration center microservice, and starting the function of the configuration center server; configuration center information, such as a warehouse address of the configuration file, an address of a message service (Rabbitmq information middleware) and the like, is added to the configuration file of the program.
(3) Adding a configuration center dependence in a target program needing a configuration center, adding related information about the configuration center in a configuration file boot.
(4) Adding @ EnableDiscoveryClient annotation to the starting class of the configuration center service, and running the main method of the starting class can start the configuration center service and register the configuration center service to the service center.
Third, start gateway service
Gateway services are an integral part of the micro-service framework; the gateway can provide REST API to an external system in a unified mode, provides functions of dynamic routing, monitoring, rollback, safety and the like, does not depend on a service center, and can run in a mode of being separated from the service center.
The specific gateway service implementation steps are as follows:
(1) create a gateway service application, introduce the relevant dependencies of the gateway service in the pom.
(2) Adding a note for opening the gateway and an @ EnableDiscoveryclient (discovered by a service center) note to the starting class of the gateway service, starting the gateway service, configuring related information (a routing address, a service port and a service center address) of the gateway service in a configuration file, and directly operating a main method in the starting class of the gateway service to start the gateway service.
(3) Load balancing, forwarding function through gateway, load balancing strategy, and service discovery function of service center. The two are combined to distribute the request of the front end to the cluster of the requested service according to the load balancing strategy.
Fourth, service monitoring and statistics
And monitoring and counting services, so that monitoring of all micro services and use counting conditions of externally provided services of each service are realized. And monitoring the externally exposed end points of each service by adopting a Springboot Admin to monitor the service running state, so as to quickly know the service state. And counting the use condition of each micro service through the log.
The concrete implementation is as follows:
(1) a service monitoring and statistics application is created. The relevant dependence of service monitoring and statistics is introduced in the pom file of the service monitoring and statistics application.
(2) Adding @ EnableAdminserve and @ EnableDiscoveryClient notes in a service monitoring and statistical engineering starting class, and starting service monitoring. And adding relevant configuration of service monitoring in the configuration file, wherein the relevant configuration comprises information such as a service center address, a configuration center address, configuration management of an externally exposed port and the like. And (5) operating a main method of service monitoring and statistics to start service monitoring service.
Model service
The model service is a functional module of the geographic information service system. The model service provides functions of analyzing model data and issuing the model data to the outside, and the model is convenient to increase in scenes. .
The concrete implementation steps of the model micro-service cluster are as follows:
(1) create a model service application, introduce the relevant dependencies of the service center, model processing, etc. in the program's pom.
(2) Adding @ EnableDiscoveryClient annotation to the starting class of the model service, registering the service to a service center, and running a main method of the starting class, namely starting the model service. And deploying the service cluster, modifying the port number of the service, and issuing the service into a jar packet by using maven to form the model service cluster. Or the services are deployed to different IP hosts to form a cluster.
Map service
The map service is the foundation and the basic function of a geographic information service system, and provides vector and grid data web services. The distribution function of shape files and image files is realized, and standard web service of OGC is provided for the outside. The geographic information system is enabled to have basic scenes. The method comprises the following concrete steps:
(1) a map service application is created, and dependencies required by the map service are added to the pom file of the application.
(2) Yml adds relevant configuration, such as service center address, and exposes interface configuration and other information, and writes space mesh generation rule corresponding to map service configuration file in configuration center.
(3) Adding @ EnableDiscoveryClient to the starting class of the service, starting the map service and registering the map service to the service center. And packaging the services into jar by using a maven tool during deployment, and selecting cluster deployment according to requirements.
Seventh, image data service
And creating an image data service application program, adding a third party dependence required by the image data service in a configuration file, and compiling a spatial mesh generation rule corresponding to the image data service configuration file in a configuration center. And realizing image data service. The image data service performs processing on externally provided image data, such as correction of original images of satellites, slicing of the image data, re-projection of the image data, and the like.
Eighthly, meteorological hydrological data service
And creating a meteorological hydrological data service application program, adding a third party dependence required by the meteorological hydrological data service in a configuration file, and compiling a space mesh generation rule corresponding to the meteorological hydrological data service configuration file in a configuration center. And realizing meteorological hydrological data service. The meteorological hydrological data service provides functions of analyzing, storing, searching, analyzing and the like of meteorological hydrological data externally.
Constructing microservices using Docker
Adding a docker dependency in a dependency management configuration file in the built micro-service module program, writing a docker File file and executing a maven mirror image for creating the docker mirror image.
When building a cluster of microservices, we are forced to face the ultimate consistency problem of the data, since the consistency of the data is critical because each microservice will process the data and change it.
The consistency of data is processed, for structural data, data are uniformly stored in a database, all the same micro services uniformly operate the same database, the consistency of the data is kept, for map service data, the consistency of the data is kept through a message middleware, when a certain service changes the data, other services are informed through a RabbitMq message middleware, and the data of the map service are updated through interfaces by other services, so that the data of all the map micro services are kept consistent.
In order to optimize the implementation steps, the specific measures adopted further comprise:
the service center provides a service registration and service discovery function to realize load balancing and fault transfer of the middle-layer server, a service provider (here, a service registered to the service center) sends service information to the service center after starting, and the service center writes the service information into a registry after receiving the service information, and then synchronously (asynchronously) ensures data consistency to other nodes.
The provider of the service (here, the service registered with the service center) contracts for the service by sending a heartbeat (per 30 seconds by default) to the service center. If the client persists without a renewal, the service center will be deleted from the server registry in about 90 seconds. The registration information and renewal are replicated to all nodes of the service center in the cluster. Therefore, the current service is ensured to be in a running state and can be called.
When a service needs to invoke other services. After a client (here, a service registered in a service center) is started, other service information of the service center is pulled, and when calling is needed, the information is acquired in a local cache of the client to call the service.
In a distributed development architecture, services of any single point cannot be guaranteed not to be interrupted, so a service registration discovery mechanism is needed, and after a certain node is interrupted, a service consumer can timely sense that high availability of the services is guaranteed.
Further illustrating the service request flow through the service center and gateway as follows:
the user requests the service A (such as the meteorological hydrological data service), the gateway can find the node information of the service A (such as the meteorological hydrological data service) from the service center, if the node information of the service A (such as the meteorological hydrological data service) is found, the load balancer can judge that the service A (such as the meteorological hydrological data service) can process the current request, if a certain service A (such as the meteorological hydrological data service) is processing the request, the load balancer can then find other services A (such as the meteorological hydrological data service) until the service A (such as the meteorological hydrological data service) with processing capacity is found, the gateway can send the request to the found service A (such as the meteorological hydrological data service), and the successful information can be fed back to the user after the service A (such as the meteorological hydrological data service) is successfully requested, so that the load balancing of the service is realized.
Load balancing ensures that servers respond quickly even when heavily loaded and that service is not interrupted when one or more of the servers are unavailable.
Further performing functional verification:
load balancing test
And modifying the image data service port numbers to 8090, 8099 and 8088, and respectively packaging and issuing by using maven to form three image data micro-service application programs.
And sequentially starting the service center, the configuration center, the gateway service and the image data micro-service cluster. Inputting the address of the service center, and checking that three image data micro-services exist in the current service center. And accessing the same interface of the image data micro-service, and finding out that the started image data micro-services with three different port numbers are executed alternately.
Second, performance test
Using the map service microservice system, the following experiments were performed:
1. publishing map data services and loading published map services
2. The effect is obvious by zooming the map, the average request time of the response speed after the front and back comparison of the single service is 526.25 milliseconds, and the average request time after the cluster deployment is 160.6 milliseconds.
The invention provides a geographic information system construction method based on a micro service architecture, and a plurality of methods and ways for implementing the technical scheme, and the above description is only a preferred embodiment of the invention, and it should be noted that, for those skilled in the art, a plurality of improvements and embellishments can be made without departing from the principle of the invention, and these improvements and embellishments should also be regarded as the protection scope of the invention. All the components not specified in the present embodiment can be realized by the prior art.

Claims (10)

1. A construction method of a geographic information service system based on a micro-service architecture is characterized by comprising the following steps:
step 1, constructing a service center: creating a service center application program, and adding dependency about Eureka in a configuration file to create a service center micro-service;
step 2, constructing a configuration center: creating a configuration center application program, and adding the dependence on a configuration center module in a configuration file to create a configuration center microservice;
step 3, constructing gateway service: creating a gateway application, and adding a dependency about a gateway in a configuration file to create a gateway service;
step 4, constructing service monitoring and statistics;
step 5, constructing a map service, and dividing the map service into more than two services based on a spatial grid splitting method to realize distributed cluster deployment of the map service;
step 6, constructing an image data service, and dividing the image data service into more than two services based on a spatial grid splitting method to realize distributed cluster deployment of the image data service;
step 7, constructing a model service;
step 8, constructing a meteorological hydrological data service, and dividing the meteorological hydrological data service into more than two services based on a spatial grid splitting method to realize distributed cluster deployment of the meteorological hydrological data service;
and 9, constructing the micro-service by using Docker.
2. The method according to claim 1, wherein in step 1, the service center provides a function of service registration and service discovery to achieve load balancing and failover of the intermediate layer server, the service provider sends service information to the service center after starting, the service center writes the service information into a registry after receiving the service information, and then synchronizes all service centers in the cluster to ensure data consistency;
the provider of the service continues the service by sending a heartbeat to the service center; if the client side can not continue to make a continuous offer, the service center removes the client side from the registry of the server; the registration information and renewal are replicated to all nodes of the service center in the cluster.
3. The method according to claim 2, wherein in step 1, when a service needs to call a map service or a model service, the map service or the model service information of the service center is pulled after the client is started, and when the service needs to be called, the information is obtained in the local cache of the client to call the service.
4. The method according to claim 3, wherein in step 2, the configuration center provides a global configuration and configuration hot-update function, so as to realize configuration centralization and hot-update of the system; the process of updating the configuration through the configuration center comprises the following steps:
when the map data path configured in the map service is changed, a user only needs to change a local configuration file in the lower configuration center, modify the data path of the map service into the latest data path in the configuration file, and call a refresh interface, so that the data paths of all the map services in the whole system can be updated successfully.
5. The method of claim 4, wherein in step 3, the gateway service provides a request routing and load balancing function, and the request service flow through the gateway service comprises:
the method comprises the steps that the world is divided into four parts along the longitude and latitude directions based on the concept of space grid subdivision, map services with the same four areas are obtained, for the first area, a user requests the map services, a gateway can go to a service center to find node information of the map services, if the node information of the map services is found, a load balancer can judge whether the map services in charge of the area are available, then the map services capable of processing the current request are selected preferentially, if one map service in charge of the area is processing the request, the load balancer can then find other map services in charge of the area until the map services in the area with processing capacity are found, the gateway can send the request to the found map services, and after the map service request is successful, the successful information is fed back to the user, so that the load balance of the services is achieved.
6. The method of claim 5, wherein step 4 comprises: a service monitoring and statistics application is created, and dependencies on service monitoring are added to create service monitoring and statistics microservices in a configuration file.
7. The method of claim 6, wherein step 5 comprises: the map service application program is created, third party dependence required by map service is added in a configuration file, and meanwhile, based on the concept of space grid subdivision, the four-equal-division two-dimensional subdivision is carried out on the world along the directions of longitude and latitude lines to obtain the map service with the same four areas, the obtained map service is used as a space subdivision basis, and the quad-tree subdivision is carried out according to the user access amount and the data fineness to realize the map service.
8. The method of claim 7, wherein step 6 comprises: creating an image data service application program, adding a third party dependence required by an image data service in a configuration file, carrying out quartering two-dimensional subdivision on the whole world along the directions of longitude and latitude lines based on the concept of space grid subdivision, obtaining image data services with the same four areas, taking the obtained image data services as a space subdivision basis, carrying out quartering tree subdivision according to user access amount and data fineness, and realizing the image data service.
9. The method of claim 8, wherein step 7 comprises: and creating a model service application program, and adding third party dependence required by the model service in a configuration file to realize the model service.
10. The method of claim 9, wherein step 8 comprises: establishing a meteorological hydrological data service application program, adding a third-party dependence required by meteorological hydrological data services into a configuration file, carrying out quartering two-dimensional subdivision on the globe along the directions of longitude and latitude lines based on the concept of space grid subdivision, obtaining the meteorological hydrological data services with the same four areas, taking the obtained meteorological hydrological data services as a space subdivision basis, and carrying out quadtree subdivision according to user access quantity to realize the meteorological hydrological data services;
step 9 comprises: adding a docker dependency in a dependency management configuration file in the built micro-service application program, writing a docker File file and executing a maven mirror image for creating the docker mirror image.
CN202111196973.3A 2021-10-14 2021-10-14 Construction method of geographic information service system based on micro-service architecture Active CN113934539B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111196973.3A CN113934539B (en) 2021-10-14 2021-10-14 Construction method of geographic information service system based on micro-service architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111196973.3A CN113934539B (en) 2021-10-14 2021-10-14 Construction method of geographic information service system based on micro-service architecture

Publications (2)

Publication Number Publication Date
CN113934539A true CN113934539A (en) 2022-01-14
CN113934539B CN113934539B (en) 2023-03-03

Family

ID=79279315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111196973.3A Active CN113934539B (en) 2021-10-14 2021-10-14 Construction method of geographic information service system based on micro-service architecture

Country Status (1)

Country Link
CN (1) CN113934539B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710494A (en) * 2022-04-22 2022-07-05 中国工商银行股份有限公司 Application management method, device and storage medium
CN115361277A (en) * 2022-07-08 2022-11-18 天津车之家软件有限公司 Universal cluster system deployment method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108011768A (en) * 2017-12-26 2018-05-08 杭州电子科技大学 A kind of aop intercept types HBase data store micro services framework construction method
CN110149396A (en) * 2019-05-20 2019-08-20 华南理工大学 A kind of platform of internet of things construction method based on micro services framework
CN112000448A (en) * 2020-07-17 2020-11-27 北京计算机技术及应用研究所 Micro-service architecture-based application management method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108011768A (en) * 2017-12-26 2018-05-08 杭州电子科技大学 A kind of aop intercept types HBase data store micro services framework construction method
CN110149396A (en) * 2019-05-20 2019-08-20 华南理工大学 A kind of platform of internet of things construction method based on micro services framework
CN112000448A (en) * 2020-07-17 2020-11-27 北京计算机技术及应用研究所 Micro-service architecture-based application management method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710494A (en) * 2022-04-22 2022-07-05 中国工商银行股份有限公司 Application management method, device and storage medium
CN115361277A (en) * 2022-07-08 2022-11-18 天津车之家软件有限公司 Universal cluster system deployment method, device, equipment and medium
CN115361277B (en) * 2022-07-08 2023-06-20 天津车之家软件有限公司 Method, device, equipment and medium for deploying general cluster system

Also Published As

Publication number Publication date
CN113934539B (en) 2023-03-03

Similar Documents

Publication Publication Date Title
EP3340055B1 (en) Communicating state information in distributed operating systems
CN106506605B (en) SaaS application construction method based on micro-service architecture
Sonbol et al. EdgeKV: Decentralized, scalable, and consistent storage for the edge
CN109344000B (en) Block chain network service platform, recovery tool, fault processing method thereof and storage medium
CN113934539B (en) Construction method of geographic information service system based on micro-service architecture
CN109189334B (en) Block chain network service platform, capacity expansion method thereof and storage medium
US20160259811A1 (en) Method and system for metadata synchronization
CN103473696A (en) Method and system for collecting, analyzing and distributing internet business information
US11240139B2 (en) Generating a minimum-cost circulation topology in a microservice mesh network
CN106210151A (en) A kind of zedis distributed caching and server cluster monitoring method
US11095742B2 (en) Query proxy for delivery of dynamic system state
CN111680033A (en) High-performance GIS platform
CN114301972B (en) Hierarchical deployment method and system for blockchain nodes based on cloud edge cooperation
US20220263772A1 (en) Metadata driven static determination of controller availability
Maghraoui et al. The internet operating system: Middleware for adaptive distributed computing
CN111274002A (en) Construction method and device for supporting PAAS platform, computer equipment and storage medium
Tiwari et al. Reconfigurable streaming for the mobile edge
KR20220052654A (en) High availability distribution intelligence system using message transmission bus and intelligence cluster system
CN114448983A (en) ZooKeeper-based distributed data exchange method
CN113127526A (en) Distributed data storage and retrieval system based on Kubernetes
Oliveira et al. P 3: Parallel Peer to Peer An Internet Parallel Programming Environment
Ramachandran et al. Elevating the edge to be a peer of the cloud
CN114615268B (en) Service network, monitoring node, container node and equipment based on Kubernetes cluster
Carlini et al. Service and resource discovery supports over p2p overlays
WO2022220830A1 (en) Geographically dispersed hybrid cloud cluster

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant