Dynamic management method and device oriented to massive GIS (Geographic Information System) services
By dynamically managing massive GIS services, including building GIS services and dynamic assembly entity services, the problems of slow start and poor processing of GIS service nodes in the existing technology are solved, and more efficient and stable GIS service processing is achieved.
Patent Information
- Application Number
- CN202411582908.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, when multiple GIS server work nodes are started in a stand-alone environment to build a lightweight GIS service cluster, there are problems such as slow start of GIS service nodes, slow request processing response, high resource occupation, and unstable service nodes, resulting in GIS service. Poor treatment.
A dynamic management method for massive GIS services is proposed. By constructing GIS services, obtaining corresponding GIS service instances when responding to GIS service requests, and dynamically assemble physical services or directly process requests according to the instance type, optimizing resource utilization and requests Processing process.
Through dynamic management methods, virtual GIS services can be dynamically pulled up, reducing hardware resource usage, and improving the processing effect and stability of GIS services.
Smart Images

Figure CN119474242A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geographic information technology, and in particular to a method and device for dynamic management of massive GIS services. Background Art
[0002] The number of geographic information services (GIS services) that geographic information GIS systems need to carry has exploded, expanding from hundreds to tens of thousands, and in extreme cases, hundreds of thousands. In the prior art, in a single-machine environment, multiple GIS server working nodes (service nodes) are started to build a lightweight GIS service cluster (GIS cluster), and each service node carries a part of the GIS services. Limited by the limited hardware resources of a single machine, at most 10 to 15 service nodes can be started. When a GIS cluster carries hundreds of thousands of GIS services, each service node must carry at least tens of thousands of GIS services. The prior art has problems such as slow startup of GIS service nodes, slow response to processing requests, high GIS cluster resource usage, unstable GIS service nodes, and unstable GIS service nodes, resulting in poor GIS service processing effects.
[0003] In summary, how to improve the processing effect of GIS services is an urgent problem that technical personnel in this field need to solve. Summary of the invention
[0004] In view of this, the present application provides a method and device for dynamic management of massive GIS services, aiming to improve the processing effect of GIS services.
[0005] In the first aspect, the present application provides a method for dynamic management of massive GIS services, including:
[0006] Constructing a GIS service; the GIS service is a physical service or a virtual service;
[0007] In response to receiving the GIS service request, obtaining a GIS service instance corresponding to the GIS service request;
[0008] If the GIS service instance is a virtual service, dynamically assemble the entity service for the GIS service instance to obtain the entity service corresponding to the GIS service instance;
[0009] Processing the GIS service request using the entity service corresponding to the GIS service instance;
[0010] If the GIS service instance is a physical service, the GIS service request is processed using the GIS service instance.
[0011] Optionally, before constructing the GIS service, the method further includes:
[0012] Divide all GIS service configurations into multiple configuration blocks according to relevance;
[0013] Obtaining the loading weights corresponding to the multiple configuration blocks respectively;
[0014] Determining a loading order of the plurality of configuration blocks according to the loading weights respectively corresponding to the plurality of configuration blocks;
[0015] The construction of GIS service includes:
[0016] The multiple configuration blocks are loaded according to the loading order to complete the construction of the GIS service.
[0017] Optionally, the dynamically assembling entity services of the GIS service instance to obtain entity services corresponding to the GIS service instance includes:
[0018] Retrieving from the GIS service instance a bill of materials required for dynamically assembling the entity service corresponding to the GIS service instance;
[0019] Based on the bill of materials and the specification information of the GIS service instance, generating an assembly application form for the GIS service instance;
[0020] According to the assembly application form, the entity service corresponding to the GIS service instance is dynamically assembled to obtain the entity service corresponding to the GIS service instance.
[0021] Optionally, before dynamically assembling the entity service of the GIS service instance to obtain the entity service corresponding to the GIS service instance, the method further includes:
[0022] If the number of currently existing entity services exceeds the tolerance, an idle service synchronization cleanup instruction is issued;
[0023] In response to the idle service synchronization cleanup instruction, obtaining a GIS service instance in an idle state;
[0024] The idle GIS service instances are cleaned up.
[0025] Optionally, after dynamically assembling the entity service of the GIS service instance to obtain the entity service corresponding to the GIS service instance, the method further includes:
[0026] Performing quality verification on the entity service corresponding to the GIS service instance;
[0027] If the entity service quality corresponding to the GIS service instance does not meet the standard, a system error is thrown;
[0028] If the quality of the entity service corresponding to the GIS service instance meets the standard, the step of processing the GIS service request using the entity service corresponding to the GIS service instance is executed.
[0029] In the second aspect, the present application provides a dynamic management device for massive GIS services, including:
[0030] A construction module is used to construct a GIS service; the GIS service is a physical service or a virtual service;
[0031] A first acquisition module, configured to, in response to receiving a GIS service request, acquire a GIS service instance corresponding to the GIS service request;
[0032] An assembly module, for dynamically assembling a physical service for the GIS service instance if the GIS service instance is a virtual service, to obtain a physical service corresponding to the GIS service instance;
[0033] A first processing module, used to process the GIS service request using the entity service corresponding to the GIS service instance;
[0034] The second processing module is used to process the GIS service request using the GIS service instance if the GIS service instance is a physical service.
[0035] Optionally, the device further comprises:
[0036] The partitioning module is used to divide all GIS service configurations into multiple configuration blocks according to their relevance;
[0037] A second acquisition module is used to acquire the loading weights corresponding to the plurality of configuration blocks respectively;
[0038] A determination module, configured to determine a loading order of the plurality of configuration blocks according to the loading weights respectively corresponding to the plurality of configuration blocks;
[0039] The building blocks include:
[0040] The loading unit is used to load the multiple configuration blocks according to the loading order to complete the construction of the GIS service.
[0041] Optionally, the assembly module includes:
[0042] An extraction unit, used for extracting from the GIS service instance a bill of materials required for dynamically assembling the entity service corresponding to the GIS service instance;
[0043] A generating unit, configured to generate an assembly application form for the GIS service instance based on the bill of materials and the specification information of the GIS service instance;
[0044] The assembly unit is used to dynamically assemble the entity service corresponding to the GIS service instance according to the assembly application form to obtain the entity service corresponding to the GIS service instance.
[0045] Optionally, the device further comprises:
[0046] The instruction issuing module is used to issue an idle service synchronization cleanup instruction if the number of currently existing entity services exceeds the tolerance;
[0047] A third acquisition module is used to obtain a GIS service instance in an idle state in response to the idle service synchronization cleanup instruction;
[0048] The cleaning module is used to clean up the GIS service instances that are in an idle state.
[0049] Optionally, the device further comprises:
[0050] A verification module, used to verify the quality of the entity service corresponding to the GIS service instance;
[0051] A throwing module is used to throw a system error if the entity service quality corresponding to the GIS service instance does not meet the standard;
[0052] The execution module is used to execute the step of processing the GIS service request by using the entity service corresponding to the GIS service instance if the quality of the entity service corresponding to the GIS service instance meets the standard.
[0053] The present application provides a method for dynamic management of massive GIS services. When executing the method, the GIS service is first constructed, wherein the GIS service is a physical service or a virtual service. In response to receiving a GIS service request, the GIS service instance corresponding to the GIS service request is obtained. If the GIS service instance is a virtual service, the physical service is dynamically assembled on the GIS service instance to obtain the physical service corresponding to the GIS service instance; if the GIS service instance is a physical service, the GIS service instance is used to process the GIS service request. In this way, the GIS service is first constructed, and the virtual GIS service can also receive requests. When it receives a GIS request, it will be dynamically pulled up to reduce the occupation of hardware resources, thereby improving the processing effect of the GIS service. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A flowchart of a method for dynamic management of massive GIS services provided in an embodiment of the present application;
[0056] Figure 2 A structural diagram of a dynamic management device for massive GIS services provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. The present application provides a method and device for dynamic management of massive GIS services, which are used in the field of geographic information technology. The above is only an example and does not limit the application field of the method and device name provided by the present application.
[0058] The number of geographic information services (GIS services) that geographic information GIS systems need to carry has grown explosively, from hundreds to tens of thousands, and in extreme cases, hundreds of thousands.
[0059] In the prior art, in a single-machine environment, multiple GIS server working nodes (service nodes) are started to build a lightweight GIS service cluster (GIS cluster), and each service node carries a part of GIS services. Limited by the limited hardware resources of a single machine, at most 10 to 15 service nodes can be started. When the GIS cluster carries hundreds of thousands of GIS services, each service node must carry at least tens of thousands of GIS services. When starting a cluster, hundreds of thousands of GIS services need to be loaded separately. If it takes 300 to 500 milliseconds to load one service, it takes 2.5 to 4.1 hours for a service node to load 30,000 services. During this period, it cannot respond to user requests, resulting in slow startup of the GIS service node. Since 30,000 services require at least 30,000 service routes, accessing any GIS service requires dynamic retrieval from 30,000 routes, which has low retrieval efficiency, thereby reducing the efficiency of request processing and slow response to request processing. For example, loading one GIS service takes up 500KB of memory, and loading 300,000 services requires 146GB of memory, that is, the GIS cluster resource usage is high. After loading 300,000 GIS services, a large amount of memory and CPU resources have been occupied, and there are not enough remaining resources to process business requests. Due to insufficient idle resources, request processing fails and even service node crashes, resulting in instability of the GIS service node. Since the GIS cluster needs to be restarted after each shutdown to upgrade the GIS server program, all service nodes need to be restarted in sequence, and the service needs to be stopped for at least 2 hours, which makes it inconvenient to upgrade the GIS cluster. In summary, in the existing technology, various factors lead to poor processing effect of GIS services.
[0060] After research, the inventor proposed the technical solution of this application. First, the GIS service is constructed. The GIS service is a physical service or a virtual service. In response to receiving a GIS service request, the GIS service instance corresponding to the GIS service request is obtained. If the GIS service instance is a virtual service, the physical service is dynamically assembled on the GIS service instance to obtain the physical service corresponding to the GIS service instance; if the GIS service instance is a physical service, the GIS service instance is used to process the GIS service request. In this way, the GIS service is constructed first, and the virtual GIS service can also receive requests. When it receives a GIS request, it will be dynamically pulled up to reduce the occupation of hardware resources, thereby improving the processing effect of the GIS service.
[0061] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. It should be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0062] See also Figure 1 , Figure 1 A flowchart of a method for dynamic management of massive GIS services provided in an embodiment of the present application includes:
[0063] S101: Build GIS services.
[0064] There are a large number of GIS services in the GIS service configuration library that are closely related, such as multiple different types of GIS service configurations published by a "GIS workspace". First, all GIS service configurations are divided into N configuration blocks according to their relevance, where N is a positive integer. The specific method is as follows:
[0065] First, perform vector calculation on each GIS service configuration to obtain the vector value corresponding to each GIS service configuration. Among them, the parameters involved in the calculation include but are not limited to: GIS workspace path, GIS data source path or link information, and node flags of GIS services to be deployed. Then, sort all vectors to obtain the maximum vector Max and the minimum vector Min. Then use the approximate average principle to divide all service configurations into N vector segments, each segment corresponds to a Block, specifically: divide the vector interval (Max-Min) into n equal parts, n segments, where n is a positive integer. Then, count each segment to find all super-large segments, where the super-large segment is a segment with more than 3000 service configurations or more than 5MB of configuration content, and then divide the super-large segment into equal parts again according to the vector value until there is no super-large segment, and then merge all super-small segments in all segments to obtain N segments, where the super-small segment is a segment with less than 50 service configurations or less than 500KB of configuration content. Finally, each segment corresponds to a configuration block Block, and each configuration block Block is associated with a minimum vector value sMin and a maximum vector value sMax.
[0066] Secondly, the GIS service configuration library is divided into two storage areas, namely the service configuration storage area and the metadata storage area. All configuration blocks Block are stored in the service configuration storage area, and multiple GIS service configurations in each configuration block are stored sequentially. Each configuration block Block is associated with a Block metadata, which is stored in the metadata storage area. Among them, a Block metadata should at least contain the following information: the loading weight weight of the configuration block Block, which is expressed in numbers. The higher the weight, the higher the loading priority; the starting storage position startPosition of the configuration block Block; the ending storage position endPosition of the configuration block Block; the digest information of the GIS service configuration contained in the configuration block Block. When the content of the configuration block Block changes significantly, the Block metadata associated with the configuration block Block is modified.
[0067] Furthermore, the device order of each configuration block Block is determined in the following manner: first obtain the loading weight weight, starting storage position startPosition, ending storage position endPosition, etc. of each configuration block Block. Then, sort the configuration blocks Block according to the loading weight weight field of the configuration block Block. When the loading weight weight is the same, sort the configuration blocks Block according to the starting storage position startPosition, and finally obtain the loading order T1 of the configuration block Block.
[0068] According to the loading sequence T1, the first configuration block Block is loaded in batches, the GIS service is built in parallel, and the GIS service registration is completed. The specific method is as follows:
[0069] First, according to the starting storage position startPosition and the ending storage position endPosition in the Block meta-information, all GIS service configurations of the configuration block Block are obtained in batches from the GIS configuration library. For each GIS service configuration, a summary information is generated for the GIS service configuration, and the summary information is compared with the summary of the Block meta-information to verify the integrity of the configuration block Block. If the verification fails, a log alarm is issued, the loading of this configuration block Block is exited, and a signal that the loading of the configuration block Block failed is returned; if the verification succeeds, the service builder ServiceBuilder and the GIS service parallel construction executor Excetor are initialized, and the initialized service builder ServiceBuilder and the GIS service parallel construction executor Excetor are associated. Next, the parallelism of the GIS service parallel construction executor Excetor is set to K, where K = Math.round, Math.round = number of CPU cores × 4 × busy factor Q; Q defaults to 0.8 and is configurable. Furthermore, the GIS service configuration is decomposed to obtain i service construction tasks, where i is a positive integer, each service construction task is associated with a GIS service configuration, and the i service construction tasks are submitted to the GIS service parallel construction executor Excetor in turn. The GIS service parallel construction executor Excetor executes the service construction tasks in parallel according to the parallelism K until all i service construction tasks are completed.
[0070] The following is an example of the execution steps of a service construction task:
[0071] Take out the initialization strategy of the service from the GIS service configuration, and perform the corresponding initialization steps according to different strategies: when the strategy is "immediate initialization", execute the entity service construction, specifically, call the initialization service builder ServiceBuilder, build the entity service based on the GIS service configuration, the entity GIS service has the real GIS request processing capability, and set the entity GIS service to the "ready" working state; when the strategy is "delayed initialization", execute the virtual service construction, specifically, call the initialization service builder ServiceBuilder, build the virtual service based on the GIS service configuration, the service does not have the real GIS request processing capability, and set the virtual GIS service to the "loaded, waiting to start" working state. Then, register the constructed GIS service to the service registration center, and the service quantity counter in the service registration center counts the number of GIS services.
[0072] Furthermore, the loading and service construction work of the second to Nth configuration blocks Block is carried out in sequence according to the loading sequence T1. The specific loading and service construction work is the same as the loading and service construction work of the first configuration block Block mentioned above, which will not be repeated here. Finally, other system resources are loaded, the GIS service node is set to the ready state, and the GIS service node is started successfully.
[0073] S102: In response to receiving the GIS service request, obtaining a GIS service instance corresponding to the GIS service request.
[0074] When the service gateway receives a GIS request, it dispatches the GIS request to the GIS service control module, and then the service control module retrieves the GIS service instance A associated with the request from the service registration center.
[0075] S103: Determine whether the GIS service instance is a physical service.
[0076] Determine the working status of the GIS service instance A and execute different logics according to the situation, as follows:
[0077] When the working status of the GIS service instance A is "ready", it means that the GIS service instance A is a physical GIS service and can directly process GIS service requests, and step S104 is executed; when the working status of the GIS service instance A is "loaded, waiting to be started", it means that the GIS service instance A is a virtual GIS service and has no real GIS request processing capability, and step S105 is executed; if the working status of the GIS service instance A is "starting", the GIS request is added to the GIS service waiting queue and the current request processing thread is dormant.
[0078] S104: Using the GIS service instance to process the GIS service request.
[0079] A physical GIS service instance in the "ready" working state processes received GIS requests and returns responses.
[0080] S105: Dynamically assemble the entity service for the GIS service instance to obtain the entity service corresponding to the GIS service instance.
[0081] Since the GIS service instance A is a virtual GIS service and has no real GIS request processing capability, the service control module needs to dynamically convert the virtual service into a physical service, i.e., initiate an application to dynamically launch the GIS service instance A to the service registration center.
[0082] First, after the service registration center receives the application for dynamically starting GIS service instance A, it needs to determine whether the number of services with the current actual working status of "Ready" and "Starting" exceeds the tolerance. Specifically, when the number of services with the working status of "Ready" and "Starting" does not exceed the tolerance, the working status of GIS service instance A is set to "Starting", and the service control module is executed to start the process of preparing for assembling entity services. The specific steps will be described in detail below and will not be described here. When the number of services with the working status of "Ready" and "Starting" exceeds the tolerance, the idle GIS services are cleared. The specific steps will be described in detail below and will not be described here. When the cleanup work is completed, it is determined again whether the number of services with the current actual working status of "ready" and "starting" exceeds the tolerance. If it does not exceed the tolerance, the service control module is executed to start the process of preparing for the assembly of the entity service. The specific steps will be described in detail below and will not be described here. If it still exceeds the tolerance, the application failure is returned, and the reason for the failure is "the number of ready services has exceeded the maximum tolerance, and no new GIS services can be pulled up. Please try again later." When the "Service Registration Center" rejects the application for "dynamically pulling up GIS services" due to "excessive service capacity", it will be recorded in the system log that "dynamically pulling up a service failed due to service capacity issues at a certain time, reminding the administrator to expand the capacity in time", and the error message "due to service capacity issues, the current GIS request cannot be satisfied, please try again later" will be written in the response to the current GIS request, and the processing of the GIS request will be terminated.
[0083] The process of the service control module starting to prepare for the dynamic assembly of entity services is as follows: The preparation work includes but is not limited to the following processes: Take out the list of materials required to assemble its entity service from the virtual GIS service. Then, classify and summarize the list of materials, and the service materials involved include but are not limited to: GIS workspace, GIS slice source, GIS data source, GIS dataset, GIS map, GIS scene, GIS layout, GIS symbol, GIS automation processing model, font. Based on the list of materials and the specification information of GIS service instance A, generate the assembly application form AOrder of GIS service instance A.
[0084] Next, the service control module sends the GIS service instance A assembly application form AOrder to the service assembly factory. After the service assembly factory receives the GIS service instance A assembly order AOrder, it takes out prefabricated materials from the material warehouse and uses the building block method to quickly assemble the required GIS service. The specific steps are as follows: first parse the GIS service instance A assembly order AOrder, generate multiple service material application forms according to the service type and specification information in the order, and send multiple service material application forms to the material warehouse. The material warehouse receives the material application form, checks the inventory status, and produces service materials on demand. Specifically: when the material warehouse has sufficient spare parts to meet the required application, the required materials are taken out from the warehouse and the material deduction is performed. The assembly workshop finds the assembly mold of this type of service according to the service specifications of the assembly order AOrder, fills the required service materials in the assembly mold, performs assembly work, and performs initial settings. Finally, the dynamic assembly of the physical GIS service is completed and the required physical GIS service is returned.
[0085] When the material warehouse is short of stock and cannot meet the required application, the following steps are performed: Calculate the difference quantity DC, DC = RC-CC, where RC is the requested quantity and CC is the actual quantity. In order to reduce the number of material preparations, the actual production material quantity IRC should be slightly more than the required DC, but not too much more to avoid wasting resources. The specific calculation steps for the actual production material quantity IRC are as follows:
[0086] Determine the minimum replenishment quantity MSC, MSC = RC--BC, where the stock quantity is counted as BC and the application quantity is counted as RC. Next, analyze whether the material is reusable based on the material category and specification, and obtain the reusable flag F. Specifically, when the material category is GIS workspace, GIS slice source, GIS data source, GIS dataset, GIS map or GIS scene, the material specification needs to be further analyzed. The specific logic is: Material specification does not specify the material user: it is considered to be a "disposable material" and does not need to be reused, and the "disposable material" flag is returned; Material specification specifies the material user: it is considered to be a "reusable material" and needs to be recycled, and the "reusable material" flag is returned. When the material category is GIS layout, GIS symbol or system font, it is considered to be a "disposable material" and does not need to be reused, and the "disposable material" flag is returned. Finally, according to the status of the reusable flag F, the actual production quantity IRC of the material is calculated according to different situations: when the status of the reusable flag F is "one-time material", the actual production quantity IRC of the material = MSC × 4 × control factor CF, where CF defaults to 1.0 and CF is configurable; when the status of the reusable flag F is "reusable material", the actual production quantity IRC of the material = MSC × 4 × control factor CF, where CF defaults to 1.0 and CF is configurable.
[0087] Next, a material production order is issued to the material factory to produce IRC copies of materials. The material warehouse receives IRC copies of materials from the material factory and stores them in the warehouse. RC copies of materials are taken out from the warehouse to perform material deduction. The assembly workshop finds the assembly mold of this type of service according to the service specifications of the assembly order AOrder, fills the required service materials in the assembly mold, performs assembly work, and performs initial settings. Finally, the physical GIS service assembly is completed and the required physical GIS service is returned.
[0088] In addition, the service material warehouse conducts inventory operations regularly to check the stock status of each category of materials it manages. The GIS material categories included in the inventory include but are not limited to the following material categories: GIS workspace, GIS slice source, GIS data source, GIS data set, GIS map, GIS scene, GIS layout, GIS symbols, GIS automation processing model, fonts.
[0089] When the material warehouse finds that the stock quantity of some categories of materials is lower than the warning value, it issues a production instruction to the material factory. The material factory asynchronously executes parallel material production operations to replenish the materials. The specific steps are as follows:
[0090] First, calculate the actual production material quantity IRC, and then determine the actual quantity of each type of material that needs to be replenished. When the stock quantity in the material warehouse is lower than the warning quantity, the actual production material quantity IRC is calculated as follows: determine the minimum required replenishment quantity MSC, the stock quantity is calculated as BC, and the warning quantity is calculated as AC, MSC = AC--BC. Then, according to the material category and specification, analyze whether the material is reusable, and obtain the reusable flag F. Specifically, when the material category is GIS workspace, GIS slice source, GIS data source, GIS dataset, GIS map or GIS scene, the material specification needs to be further analyzed. The specific logic is: if the material specification does not specify the material user: it is considered to be a "one-time material" and does not need to be reused, and the "one-time material" flag is returned; if the material specification specifies the material user: it is considered to be a "reusable material" and needs to be recycled, and the "reusable material" flag is returned. When the material category is GIS layout, GIS symbol or system font, it is considered to be a "one-time material" and does not need to be reused, and the "one-time material" flag is returned. Finally, according to the status of the reusable flag F, the actual production quantity IRC of the material is calculated according to different situations: when the status of the reusable flag F is "one-time material", the actual production quantity IRC of the material = MSC × 4 × control factor CF, where CF defaults to 1.0 and CF is configurable; when the status of the reusable flag F is "reusable material", the actual production quantity IRC of the material = MSC × 4 × control factor CF, where CF defaults to 1.0 and CF is configurable.
[0091] Next, multiple material orders are generated, where one material order corresponds to one type of material. Multiple material production orders are sent to the material factory in sequence. After receiving the material order, the material factory performs the following steps: first parse the material category in the order, then determine the working status of the material production line corresponding to the category, execute the order production task, and if the production line has been started, directly submit the order to the production line of the category; if the production line has not been started, determine whether the number of currently started production lines has exceeded the standard. If it has exceeded the standard, submit the order to the waiting queue. After the production line startup index meets the standard, start the production line of the category and execute the order production task; if it does not exceed the standard, start the production line and submit the order to the production line. After the production line completes the order production, the material factory will check the quality of the relevant materials and pack them. Then, according to the delivery path recorded in the order, the material factory delivers the packaged supplementary materials and bill information to the material warehouse. The material warehouse takes the supplementary material package, unpacks it, and verifies the quality of each material. According to the bill information and material quality verification, the supplementary materials that meet the quality standards are registered for storage. Finally, record the operation log: at a certain time, a certain warehouse completed the replenishment of a certain category of materials, a total of a certain number of items were replenished, and there are actually certain items in the current warehouse.
[0092] The specific implementation steps for cleaning up idle GIS services are as follows: GIS service nodes provide two trigger mechanisms for cleaning up idle GIS services, namely, active cleaning and passive cleaning. When the trigger mechanism is active cleaning, before dynamically pulling up the GIS service, it is recognized that the number of "ready" services has reached the maximum quota, and a cleaning instruction is actively issued to the built-in idle service cleaning module to clean up some GIS services to release the quota. When the trigger mechanism is passive cleaning, the idle service cleaning module of the service node will be triggered regularly, automatically triggered once every 30 minutes by default, and the trigger interval is configurable.
[0093] Next, the idle service cleaning module starts the marking operation of idle GIS services, that is, marking idle GIS services in batches. First, query the service registration center for the number of "ready" services to obtain the number x, take 100 services as a marking batch, and calculate X batches, where X = Math.Round(x / 100). Next, initialize the "GIS service register to be cleaned up", set the default capacity to x, set the batch parameter BP = 0, and query the "GIS service registration center" for the "idle state FS" and "last processing request time LT" of the BP batch of GIS services. The starting index of the batch is (BP-1)×100, and the ending index is BP×100-1. Among them, the specific steps of the "service registration center" to determine whether a "GIS service" is in an idle state and the specific steps of the "service registration center" to count the last processing request time of a "GIS service" will be explained in detail later, and will not be explained here.
[0094] Next, it is successively determined whether the aforementioned 100 services should be cleaned up and registered in the "GIS Services to be Cleaned Register" as needed. Taking the judgment and registration process of one GIS service as an example, the specific steps are as follows: If the "idle status" of the service is "not idle", then return the "cannot be cleaned" flag, and record the flag indicating whether the GIS service should be cleaned up in the "GIS Services to be Cleaned Register". If the "idle status" of the service is "idle", then return the "can be cleaned" flag, calculate the actual idle time AFT of the service, AFT = current system time - the last processing request time LT of the service, in milliseconds. Then, determine whether AFT exceeds the idle threshold FTT. If AFT ≥ FTT, then return the "can be cleaned" flag; if AFT < FTT, then return the "cannot be cleaned" flag, and record the flag indicating whether the GIS service should be cleaned up in the "GIS Services to be Cleaned Register". Next, set BP = BP + 1, and repeat the steps of querying the "idle status FS" and "last processing request time LT" of the BP-th batch of GIS services from the "GIS Service Registry", successively determining whether the aforementioned 100 services should be cleaned up, registering in the "GIS Services to be Cleaned Register" as needed, and setting BP = BP + 1 until the registration work of the last batch of GIS services is completed. Finally, return the "GIS Services to be Cleaned Register" in the latest state.
[0095] Among them, the specific steps for the "Service Registry" to determine whether a certain GIS service is in an idle state are as follows: When dynamically managing GIS requests for a large number of GIS services, the specific steps are as follows: The GIS service maintains a counter requestCounter internally, with an initial value set to 0. Each time the GIS service receives a request, before calling the processing method, increment requestCounter by 1, and after completing the processing method, decrement requestCounter by 1. When the GIS Service Registry receives a "determine whether the service is idle" request, the specific steps are as follows: The GIS Service Registry dispatches the request to the corresponding GIS service. Then, the GIS service retrieves the internal counter requestCounter. If requestCounter > 0, then return the "not idle state" status; if requestCounter ≤ 0, return the "idle state" status.
[0096] The steps for the "Service Registration Center" to count the "last request processing time" of a GIS service are as follows: the GIS service maintains a timestamp lastVistor in milliseconds. Each time the GIS service completes a GIS request processing, it uses the current system time to update lastVistor. Then, after the GIS Service Registration Center receives the request to count the "last modification time of a GIS service", it dispatches the request to the corresponding GIS service. Finally, the GIS service directly returns its internal lastVistor value.
[0097] Furthermore, the idle service cleaning module starts the cleaning operation of idle GIS services, starts multiple cleaning tasks in parallel, and cleans up idle GIS services in batches. The specific execution steps are as follows: first count the number of GIS services registered in the "GIS Service Register to be Cleaned" NC, and take 30 services as a cleaning batch, and calculate CP batches, where CP = Math.round(NC / 30). Then, initialize the idle service parallel cleaner CExecutor and set the parallelism PD, where PD is the number of CPU cores in the current system. Construct CP idle service batch processing tasks CBTask and submit them to CExecutor. Each CBTask is associated with the cleaning work of 30 services.
[0098] Next, CExecutor starts PD cleaning threads, each of which executes a CBTask to perform batch cleaning operations. When the number of received CBTasks exceeds PD, the excess is placed in the waiting queue. The following takes the cleaning of a service of a CBTask as an example to explain the execution steps: First, send an atomic instruction to the "Service Registration Center" to take the service offline. The instruction is: if a service is still in an idle state, set the service to the "to be offline" state. Then judge the instruction execution status returned by the service registration center: if the execution is successful, it means that the service is still idle when receiving the instruction and has been set to the "to be offline" state. First, unregister the GIS service to be offline from the service registration center, obtain the GIS service instance object SInstance, and then send SInstance to the service disassembly factory to start disassembly and cleaning. If the execution fails, it means that the service is already processing requests when receiving the instruction, and is no longer idle. It cannot be set to the "to be offline" state and cannot be cleaned up temporarily. SInstance is directly sent to the service disassembly factory to start disassembly and cleaning.
[0099] Among them, SInstance is directly sent to the service disassembly factory to start the disassembly and cleanup steps, which specifically include: disassembling SInstance into three main components, namely GIS service provider SP, GIS service component SC and GIS service interface SI, calling the destruction interface of the GIS service interface to directly destroy SI, then disassembling the component layer cache construction SCC and component layer security construction SCS from the GIS service component SC, and then calling the destruction interface of the GIS service component to destroy SC, release resources, and send SCC to the component layer cache construction warehouse, and SCS component layer cache security construction warehouse, and then reuse it later. Then disassemble the GIS resource parts from the GIS provider, which include but are not limited to GIS workspace WS, GIS data source DS and GIS symbol library, and then call the destruction interface of the service provider to destroy SC and release resources. Finally, the disassembled GIS resource parts are sent to the relevant GIS resource warehouse for subsequent reuse.
[0100] Furthermore, the cleanup work of the current service is completed, and the cleanup statistics are recorded, including but not limited to the following information: the total time consumed for the cleanup work, which GIS services are cleaned up, how many GIS resource pieces are cleaned up, and how many basic capability pieces are cleaned up.
[0101] In the embodiment of the present application, the service can be disassembled asynchronously and the disassembly factory can be directly connected to the warehouse to realize the reuse of components and materials. Specifically, the service disassembly factory is initialized in advance, and multiple GIS service disassembly pipelines are pre-launched, including: first setting the number of disassembly pipelines, the number of disassembly pipelines is the same as the number of CPU cores available in the current system, and initializing the disassembly pipeline. Then, the service disassembly factory is connected to the GIS service component library.
[0102] After receiving the service disassembly order, the service disassembly factory starts the asynchronous disassembly operation. The specific steps are as follows: first, take out the GIS service instance SInstance to be disassembled from the order, and disassemble it into three basic service components according to the conventional disassembly method, namely, the GIS service provider SP, the GIS service component SC and the GIS service interface SI. Then, call the destruction interface of the GIS service interface SI to directly destroy SI. Then call the GIS service component deep disassembly module to disassemble the reusable basic service components from the GIS service component, submit them to the service component library for registration, and prepare for subsequent reuse. Specifically, disassemble the component layer cache component SCC, submit it to the service component warehouse, and register it; disassemble the component layer security component SCS, submit it to the service component warehouse, and register it; disassemble the component layer performance counting device PCD, submit it to the service component warehouse, and register it. Then, call the destruction interface of the service component SC to destroy SC. Then, call the GIS service provider's deep disassembly module to disassemble reusable GIS materials from the GIS service provider, submit them to the GIS service material library for registration, and prepare for subsequent reuse. Specifically, disassemble the GIS workspace, submit them to the GIS service material library, and register them; disassemble the GIS slice source, submit them to the GIS service material library, and register them; disassemble the GIS slice data source, submit them to the GIS service material library, and register them; disassemble the GIS map, submit them to the GIS service material library, and register them; disassemble the GIS scene, submit them to the GIS service material library, and register them; disassemble the GIS symbol library, submit them to the GIS service material library, and register them. Then call the destruction interface of the service provider SP to destroy the SP. Finally, call the destruction interface of the GIS service instance to destroy the GIS service instance, and complete the disassembly and destruction of the GIS service.
[0103] S106: Processing the GIS service request using the entity service corresponding to the GIS service instance.
[0104] Before executing step S106, the quality of the assembled physical GIS service is verified. If the quality meets the standards, the physical GIS service is attached to the virtual GIS service instance A, and the status of the virtual GIS service instance A is set to "ready", so that the GIS service instance A completes the dynamic switch from virtual to physical, and sends a wake-up instruction to the waiting queue of the GIS service instance A to wake up all the working threads waiting for the current GIS service to be ready. Finally, the physical GIS service instance in the "ready" state processes the received GIS request and returns a response.
[0105] If the quality does not meet the standards, when the "Service Registration Center" rejects the application for "dynamically launching GIS services" due to "excess service capacity", it will record in the system log "Dynamically launching a service failed due to service capacity issues at a certain time, reminding the administrator to expand the capacity in time", and write an error message in the response of the current GIS request "Due to service capacity issues, the current GIS request cannot be satisfied, please try again later", and end the processing of the GIS request.
[0106] In the embodiment of the present application, the GIS service is first constructed, wherein the GIS service is a physical service or a virtual service. In response to receiving a GIS service request, the GIS service instance corresponding to the GIS service request is obtained. If the GIS service instance is a virtual service, the physical service is dynamically assembled on the GIS service instance to obtain the physical service corresponding to the GIS service instance; if the GIS service instance is a physical service, the GIS service instance is used to process the GIS service request. In this way, the GIS service is first constructed, and the virtual GIS service can also receive requests. When it receives a GIS request, it will be dynamically pulled up to reduce the occupation of hardware resources, thereby improving the processing effect of the GIS service.
[0107] The above are some specific implementations of the method for dynamic management of massive GIS services provided by the present application. Based on this, the present application also provides a corresponding device. The device provided by the present application embodiment will be introduced from the perspective of functional modularization.
[0108] See also Figure 2 , Figure 2 A schematic diagram of a structure of a dynamic management device for massive GIS services provided in an embodiment of the present application, the dynamic management device 200 for massive GIS services includes:
[0109] A construction module 210 is used to construct a GIS service; the GIS service is a physical service or a virtual service;
[0110] The first acquisition module 220 is used to, in response to receiving a GIS service request, acquire a GIS service instance corresponding to the GIS service request;
[0111] The assembly module 230 is used for dynamically assembling the entity service of the GIS service instance to obtain the entity service corresponding to the GIS service instance if the GIS service instance is a virtual service;
[0112] The first processing module 240 is used to process the GIS service request using the entity service corresponding to the GIS service instance;
[0113] The second processing module 250 is used to process the GIS service request using the GIS service instance if the GIS service instance is a physical service.
[0114] Optionally, the device 200 further includes:
[0115] The partitioning module is used to divide all GIS service configurations into multiple configuration blocks according to their relevance;
[0116] A second acquisition module is used to acquire the loading weights corresponding to the plurality of configuration blocks respectively;
[0117] A determination module, configured to determine a loading order of the plurality of configuration blocks according to the loading weights respectively corresponding to the plurality of configuration blocks;
[0118] The building block 210 includes:
[0119] The loading unit is used to load the multiple configuration blocks according to the loading order to complete the construction of the GIS service.
[0120] Optionally, the assembly module 230 includes:
[0121] An extraction unit, used for extracting from the GIS service instance a bill of materials required for dynamically assembling the entity service corresponding to the GIS service instance;
[0122] A generating unit, configured to generate an assembly application form for the GIS service instance based on the bill of materials and the specification information of the GIS service instance;
[0123] The assembly unit is used to dynamically assemble the entity service corresponding to the GIS service instance according to the assembly application form to obtain the entity service corresponding to the GIS service instance.
[0124] Optionally, the device 200 further includes:
[0125] The instruction issuing module is used to issue an idle service synchronization cleanup instruction if the number of currently existing entity services exceeds the tolerance;
[0126] A third acquisition module is used to obtain a GIS service instance in an idle state in response to the idle service synchronization cleanup instruction;
[0127] The cleaning module is used to clean up the GIS service instances that are in an idle state.
[0128] Optionally, the device 200 further includes:
[0129] A verification module, used to verify the quality of the entity service corresponding to the GIS service instance;
[0130] A throwing module is used to throw a system error if the entity service quality corresponding to the GIS service instance does not meet the standard;
[0131] The execution module is used to execute the step of processing the GIS service request by using the entity service corresponding to the GIS service instance if the quality of the entity service corresponding to the GIS service instance meets the standard.
[0132] The embodiments of the present application also provide corresponding devices and computer storage media for implementing the solutions provided by the embodiments of the present application.
[0133] The device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the method described in any embodiment of the present application.
[0134] The computer storage medium stores codes, and when the codes are executed, a device executing the codes implements the method described in any embodiment of the present application.
[0135] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0136] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0137] It should also be noted that the various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the equipment and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The device embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components prompted as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0138] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A dynamic management method for massive GIS services, characterized in that: include: Constructing a GIS service; the GIS service is a physical service or a virtual service; In response to receiving the GIS service request, obtaining a GIS service instance corresponding to the GIS service request; If the GIS service instance is a virtual service, dynamically assemble the entity service for the GIS service instance to obtain the entity service corresponding to the GIS service instance; Processing the GIS service request using the entity service corresponding to the GIS service instance; If the GIS service instance is a physical service, the GIS service request is processed using the GIS service instance.
2. The method according to claim 1, characterized in that Before constructing the GIS service, the method further includes: Divide all GIS service configurations into multiple configuration blocks according to relevance; Obtaining the loading weights corresponding to the multiple configuration blocks respectively; Determining a loading order of the plurality of configuration blocks according to the loading weights respectively corresponding to the plurality of configuration blocks; The construction of GIS service includes: The multiple configuration blocks are loaded according to the loading order to complete the construction of the GIS service.
3. The method according to claim 1, characterized in that: The dynamically assembling the entity service of the GIS service instance to obtain the entity service corresponding to the GIS service instance includes: Retrieving from the GIS service instance a bill of materials required for dynamically assembling the entity service corresponding to the GIS service instance; Based on the bill of materials and the specification information of the GIS service instance, generating an assembly application form for the GIS service instance; According to the assembly application form, the entity service corresponding to the GIS service instance is dynamically assembled to obtain the entity service corresponding to the GIS service instance.
4. The method according to claim 1, characterized in that: Before dynamically assembling the entity service of the GIS service instance to obtain the entity service corresponding to the GIS service instance, the method further includes: If the number of currently existing entity services exceeds the tolerance, an idle service synchronization cleanup instruction is issued; In response to the idle service synchronization cleanup instruction, obtaining a GIS service instance in an idle state; The idle GIS service instances are cleaned up.
5. The method according to claim 1, characterized in that After dynamically assembling the entity service of the GIS service instance to obtain the entity service corresponding to the GIS service instance, the method further includes: Performing quality verification on the entity service corresponding to the GIS service instance; If the entity service quality corresponding to the GIS service instance does not meet the standard, a system error is thrown; If the quality of the entity service corresponding to the GIS service instance meets the standard, the step of processing the GIS service request using the entity service corresponding to the GIS service instance is executed.
6. A dynamic management device for massive GIS services, characterized in that: include: Construction module, used to build GIS services; The GIS service is a physical service or a virtual service; A first acquisition module, configured to, in response to receiving a GIS service request, acquire a GIS service instance corresponding to the GIS service request; An assembly module, for dynamically assembling a physical service for the GIS service instance if the GIS service instance is a virtual service, to obtain a physical service corresponding to the GIS service instance; A first processing module, used to process the GIS service request using the entity service corresponding to the GIS service instance; The second processing module is used to process the GIS service request using the GIS service instance if the GIS service instance is a physical service.
7. The device according to claim 6, characterized in that The device also includes: The partitioning module is used to divide all GIS service configurations into multiple configuration blocks according to their relevance; A second acquisition module is used to acquire the loading weights corresponding to the plurality of configuration blocks respectively; A determination module, configured to determine a loading order of the plurality of configuration blocks according to the loading weights respectively corresponding to the plurality of configuration blocks; The building blocks include: The loading unit is used to load the multiple configuration blocks according to the loading order to complete the construction of the GIS service.
8. The device according to claim 6, characterized in that The assembly module comprises: An extraction unit, used for extracting from the GIS service instance a bill of materials required for dynamically assembling the entity service corresponding to the GIS service instance; A generating unit, configured to generate an assembly application form for the GIS service instance based on the bill of materials and the specification information of the GIS service instance; The assembly unit is used to dynamically assemble the entity service corresponding to the GIS service instance according to the assembly application form to obtain the entity service corresponding to the GIS service instance.
9. The device according to claim 6, characterized in that The device also includes: The instruction issuing module is used to issue an idle service synchronization cleanup instruction if the number of currently existing entity services exceeds the tolerance; A third acquisition module is used to obtain a GIS service instance in an idle state in response to the idle service synchronization cleanup instruction; The cleaning module is used to clean up the GIS service instances that are in an idle state.
10. The device according to claim 6, characterized in that The device also includes: A verification module, used to verify the quality of the entity service corresponding to the GIS service instance; A throwing module is used to throw a system error if the entity service quality corresponding to the GIS service instance does not meet the standard; The execution module is used to execute the step of processing the GIS service request by using the entity service corresponding to the GIS service instance if the quality of the entity service corresponding to the GIS service instance meets the standard.