Differential shielding method and system based on WebGIS, electronic equipment and storage medium
Through modular and plug-in design and scene state snapshot technology, the problem of differentiation of the WebGIS engine is solved, unified interface and seamless transition are achieved, and user experience and switching efficiency are improved.
Patent Information
- Application Number
- CN202411799698.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-07
AI Technical Summary
In the existing WebGIS technology, the differences in technical architectures of different engines lead to inconsistent performance, increasing the difficulty of user selection and use. At the same time, the ability to automatically switch map rendering engines is lacking, and unified interfaces and seamless transitions are not possible.
The modular and plug-in design model is adopted, and the simple adaptation of the new WebGIS platform is achieved by defining standardized plug-in interfaces and expansion mechanisms. Combining scene state snapshots and preloading technologies, the current scene state is automatically captured and the resources required by the new engine are preloaded, ensuring that the scene content is maintained through smooth transition and unaware data migration during the switching process, and the continuity of the scene content and the stability of the user interface are maintained.
It realizes a unified interface to different WebGIS platforms, simplifies the engine adaptation process, reduces the need for core code modification, ensures smoothness of engine switching and improves user experience, and improves switching efficiency and compatibility.
Smart Images

Figure CN119583527A_ABST
Abstract
Description
Technical Field
[0001] The patent of this invention relates to the technical field of network geographic information system, specifically, to a differentiated shielding method, system, electronic device and storage medium based on WebGIS. Background Art
[0002] In the current information age, WebGIS (Web Geographic Information System), as a product of the deep integration of geographic information system (GIS) and Internet technology, is increasingly becoming an important support for the information construction of various industries. However, with the rapid development of WebGIS technology, many WebGIS engines with different technical architectures and features have emerged on the market. These engines have significant differences in performance, functions, ease of use, etc., which makes users face many challenges when choosing and using them.
[0003] First, the differences in the technical architecture of different WebGIS engines lead to different performances in data processing, rendering, interaction, etc. Some engines may focus on efficient data processing and rendering capabilities, suitable for the display and analysis of large-scale geographic data; while other engines may focus more on interactivity and user experience, providing rich map operations and visualization functions. This differentiation requires users to choose the right engine according to their own needs, which increases the cost of selection and the difficulty of use.
[0004] In addition, the demand for low-computing power terminals and localization has been increasing recently, and the need to automatically switch map rendering engines according to different devices is also imminent. To switch the map rendering engine according to computing power, the upper layer must first be able to shield differentiated WebGIS engines so that the visualization SDK can provide a unified interface to the outside world.
[0005] In the prior art, some system solutions for taking into account the capability differences of different WebGIS platforms have also been proposed. Among them, a Chinese patent (CN 114153437 A) discloses a WEBGIS compatible system, method, device and storage medium. The solution provides a technical solution to solve the incompatibility between different WebGIS platforms under the existing technical conditions, which leads to the need for code rewriting. Specifically, it includes: a domain abstract interface for receiving a WebGIS control instruction of a specified type sent by an external terminal; an abstract encapsulation for constructing an abstract platform encapsulation rule according to the domain abstract interface; a platform encapsulation for generating a specific platform encapsulation according to the abstract platform encapsulation rule, and using the specific platform encapsulation to generate a WebGIS control object, and the WebGIS control object converts the WebGIS control instruction of the specified type into a specific WebGIS platform control instruction; a specific WebGIS platform for executing WebGIS operations according to the specific WebGIS platform control instruction.
[0006] However, a WEBGIS compatible system, method, device and storage medium only abstracts specific domain abstract interfaces based on different WebGIS platforms and performs abstract encapsulation, and then performs platform encapsulation through different WebGIS platforms, that is, performs WebGIS instruction conversion. In other words, each adaptation of a WebGIS platform requires the above three parts of operations, and adapting a new WebGIS platform requires a large amount of encapsulation to shield different platform protocols; on the other hand, the system solution does not support seamless transition between two-dimensional scenes and three-dimensional scenes, does not support seamless transition between different WebGIS platforms under the currently constructed scene, so that users can clearly perceive the switching action, and does not support intelligent adaptive rendering engine switching.
[0007] Therefore, the present invention aims to provide a WebGIS-based differentiated shielding method, system, electronic device and storage medium to solve the above-mentioned problems. Summary of the invention
[0008] The purpose of the present invention is to provide a differentiated shielding method, system, electronic device and storage medium based on WebGIS. The present invention adopts a modular and plug-in design mode to build a flexible and extensible architecture system. By defining a standardized plug-in interface and an extension mechanism, the adaptation of the new WebGIS platform can be as simple and fast as installing a plug-in, without the need for large-scale modification of the core code. At the same time, the present invention also adopts a scene state snapshot and preloading technology to automatically capture the current scene state before the engine is switched, and preload the resources required by the new engine, so that during the switching process, the continuity of the scene content and the stability of the user interface are ensured through smooth transition animation and imperceptible data migration, and the use of a cache machine can reduce the repeated loading time, improve the switching efficiency, and enable users to complete the smooth transition of the engine without knowing it.
[0009] The present invention is implemented as follows: a WebGIS-based differentiated shielding system includes a request receiving module, an interface encapsulation module, a platform encapsulation module, a platform switching module and a seamless transition module; The request receiving module is used to receive a WebGIS call request sent by an external terminal; The interface encapsulation module is used to define a general protocol based on the abstraction of the map data expression domain model, implement the encapsulation of the WebGIS protocol interface, select the protocol interface for data interaction by obtaining the call request in the request receiving module, and generate a rendering request; The platform switching module is used to adaptively switch the WebGIS platform, obtain the rendering request in the interface encapsulation module, parse the terminal device performance data, dynamically evaluate the terminal device performance data to obtain the terminal device computing power value, and generate the WebGIS platform control instruction according to the terminal device computing power value; The platform encapsulation module is used to encapsulate multiple WebGIS platforms, and selects to switch the WebGIS platform to complete the rendering by obtaining the WebGIS platform control instruction in the platform switching module; The seamless transition module is used for seamless and imperceptible switching of the WebGIS platform. By utilizing the architecture design of the platform encapsulation module to encapsulate the general rendering layer and perform scene pre-rendering, the WebGIS platform can be smoothly and imperceptibly switched in perspective.
[0010] The present invention also provides a differentiated shielding method based on WebGIS, comprising the following steps: S1, receiving a WebGIS call request sent by an external terminal; S2. Based on the abstraction of the domain model of map data expression, a general protocol is defined, the WebGIS protocol interface is encapsulated, and the protocol interface is selected according to the call request for data interaction, and a rendering request is generated; S3, obtain the rendering request, parse and obtain the terminal device performance data, dynamically evaluate the terminal device performance data to obtain the terminal device computing power value, and generate the WebGIS platform control instruction according to the terminal device computing power value; S4, obtaining the WebGIS platform control instruction, determining whether it is the first rendering request, if it is the first rendering request, selecting the WebGIS platform to complete the rendering, otherwise, jumping to step S5; S5. Switch the WebGIS platform to draw the pre-rendered scene, and complete the smooth and imperceptible perspective switching of the WebGIS platform.
[0011] Furthermore, the process of encapsulating the WebGIS protocol interface in step S2 is as follows: S201, establish WebGIS domain model; S202, divide the domain model into subdomains to perform abstract description of business functions; S203, define the protocol according to the abstract description of the business function; S204. Implement specific functions according to the protocol definition and complete the encapsulation of the WebGIS protocol interface.
[0012] Furthermore, the process of generating the WebGIS platform control instruction in step S3 is as follows: S301, presetting the evaluation strategy of selecting the WebGIS platform corresponding to the computing power values of different terminal devices; S302, registering and monitoring the computing power driver of the terminal device; S303, monitoring the computing power status of the terminal device; S304, dynamically evaluate the computing power value of the terminal device; S305: Select a WebGIS platform according to the computing power value of the terminal device and the evaluation strategy, and generate a WebGIS platform control instruction.
[0013] Furthermore, the process of selecting the WebGIS platform to complete the rendering in step S4 is as follows: S401, rendering container abstraction; S402, dividing the component services that the rendering container depends on; S403, injecting component services into the rendering container; S404, injecting the plug-in service into the component service call life cycle; S405: According to the rendering request, a rendering container scheduling component service is selected to complete the rendering.
[0014] Furthermore, the process of switching the WebGIS platform to draw the pre-rendered scene in step S5 is as follows: S501, encapsulate the general rendering layer; S502, converting the external call rendering function into a specific rendering instruction; S503, performing graphics rendering according to the rendering instruction and the rendering layer; S504, obtaining rendering scene parameters according to the graphics rendering and caching them; S505, performing scene pre-rendering using a rendering scene pool according to rendering scene parameters; S506: Draw the pre-rendered scene in the rendering scene pool when switching the WebGIS platform operation.
[0015] Furthermore, the rendering container is abstracted into a visual rendering layer for carrying rendering control of the entire application. At least one component service is registered in the visual rendering layer, and the component service is used to perform rendering operations by scheduling.
[0016] Furthermore, the component services include map engine services, layer management services, control services, debugging services, plug-in services, data mapping services and global picking services. By registering component services in the visual rendering layer, the entire rendering process is driven by the rendering container in the visual rendering layer during the rendering phase.
[0017] Furthermore, the visualization rendering layer scheduling component service to perform rendering operations is implemented based on plug-in processing. By monitoring the rendering request process, the rendering life cycle is obtained, and custom events are performed externally through the plug-in mechanism. The plug-in service is scheduled according to the rendering life cycle to complete the entire scene rendering.
[0018] Furthermore, the terminal device computing power monitoring driver is to obtain the CPU core number, CPU computing speed, GPU information and FPS test results of the terminal device through monitoring, generate the terminal device computing power value according to the preset evaluation strategy, and thus generate the WebGIS platform control instructions.
[0019] The present invention also provides a WebGIS-based differentiated shielding system, comprising a request receiving module, an interface encapsulation module, a platform encapsulation module, a platform switching module and a seamless transition module; The request receiving module is used to receive a WebGIS call request sent by an external terminal; The interface encapsulation module is used to define a general protocol based on the abstraction of the map data expression domain model, implement the encapsulation of the WebGIS protocol interface, select the protocol interface for data interaction by obtaining the call request in the request receiving module, and generate a rendering request; The platform switching module is used to adaptively switch the WebGIS platform, obtain the rendering request in the interface encapsulation module, parse the terminal device performance data, dynamically evaluate the terminal device performance data to obtain the terminal device computing power value, and generate the WebGIS platform control instruction according to the terminal device computing power value; The platform encapsulation module is used to encapsulate multiple WebGIS platforms, and selects to switch the WebGIS platform to complete the rendering by obtaining the WebGIS platform control instruction in the platform switching module; The seamless transition module is used for seamless and imperceptible switching of the WebGIS platform. By utilizing the architecture design of the platform encapsulation module to encapsulate the general rendering layer and perform scene pre-rendering, the WebGIS platform can be smoothly and imperceptibly switched in perspective.
[0020] The present invention also provides a WebGIS-based differentiated shielding electronic device, comprising at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement a WebGIS-based differentiated shielding method.
[0021] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement a differentiated shielding method based on WebGIS.
[0022] Compared with the prior art, the present invention has the following beneficial effects: 1. Based on the deep integration of cross-platform compatibility, the present invention defines a general protocol and implements the encapsulation of the protocol interface by abstracting the map data expression domain model, thereby truly shielding the differentiated protocols of different WebGIS platforms and enabling a set of codes to support rendering on different WebGIS platforms; 2. The present invention adopts a future-oriented scalable architecture design method, solves the architecture design involved in different WebGIS platforms according to the need, and finally solves the incompatibility between different WebGIS platforms by decoupling the architecture design from the map. At the same time, it uses the performance monitoring of different terminal devices to automatically select the appropriate WebGIS platform solution, solving the problem of automatically selecting the appropriate WebGIS rendering engine according to the computing power of the terminal device; 3. The present invention adopts modular and plug-in design mode to build a flexible and scalable architecture system. By defining standardized plug-in interfaces and extension mechanisms, the adaptation of the new WebGIS platform can be as simple and fast as installing plug-ins, without large-scale modification of the core code, thus ensuring that the system can respond quickly to technological changes; 4. The present invention also adopts scene status snapshot and preloading technology to automatically capture the current scene status before the engine switches, and preload the resources required for the new engine. During the switching process, the continuity of the scene content and the stability of the user interface are ensured through smooth transition animation and imperceptible data migration. In addition, the cache mechanism is used to reduce the repeated loading time, which can effectively improve the switching efficiency, allowing users to complete the smooth transition of the engine without knowing it, and achieve a seamless transition scene construction, avoiding users from perceiving the switching action, greatly improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the process of protocol interface encapsulation provided in an embodiment of the present invention; Figure 2 It is a schematic diagram of the subdomain model division and functional characteristic structure provided in an embodiment of the present invention; Figure 3 It is a schematic diagram of the process of the WebGIS platform switching strategy provided in an embodiment of the present invention; Figure 4 It is a schematic diagram of a process flow compatible with the WebGIS platform provided in an embodiment of the present invention; Figure 5 It is a schematic diagram of a scalable architecture design structure provided in an embodiment of the present invention; Figure 6 is a schematic diagram of a flow chart of visualization engine rendering provided in an embodiment of the present invention; Figure 7 It is a schematic diagram of the process of drawing a pre-rendered scene on a WebGIS platform provided in an embodiment of the present invention; Figure 8 It is a schematic diagram of the non-perceptual WebGIS platform switching provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0025] The implementation of the present invention is described in detail below in conjunction with specific embodiments.
[0026] The same or similar numbers in the drawings of this embodiment correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the drawings, it is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limitations on this patent. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0027] Reference Figure 1-8 The figure shows a preferred embodiment of the present invention.
[0028] Example 1: A WebGIS differentiated shielding method based on drone images. This example is based on a method of differentiated shielding based on drone images combined with WebGIS. It analyzes application scenarios such as oil depot fire emergency rescue, natural resource verification, rural damaged road collection, abandoned farmland detection, and agricultural pest control, and will be used for continuous expansion and deepening in various fields in the future.
[0029] In the oil depot fire emergency rescue, the flexible and real-time characteristics of drones are fully utilized, and WebGIS is used to carry fire scene maps to quickly reach the fire accident scene, and real-time multi-window and multi-dimensional monitoring of the fire situation is carried out. It is suitable for emergency timeliness and sudden work such as forest fire rescue, urban rescue, and natural disaster rescue; natural resource verification fully utilizes the advantages of drones for large-scale rapid mapping, and field drones are used for on-site verification and evidence collection, while internal desktop approval and reporting are conducted to solve the problems of low efficiency of manual evidence collection and difficulty in reaching complex areas. It is suitable for large-area resource surveys such as forest resource surveys and water resource surveys; rural damaged road collection uses drones to shoot rural road videos close to the ground, and uses WebGIS technology and AI technology to automatically detect cracks, potholes and other damaged areas in the road, and directly displays them on the map. It can display the damaged location and calculate the damaged area, solve the problems of poor conditions, high consumption and low efficiency, and difficulty in obtaining evidence for manual inspection of rural roads, and provide a basis for rural road maintenance; the detection of abandoned farmland takes advantage of the clear and timely characteristics of drone photography, and uses the pictures or videos taken by drones to produce DOM images of different time periods, compare the farmland cover in the monitored area, and extract the cultivated land, which is suitable for two- and three-dimensional data production and its application, including crop growth detection and water pollution monitoring; agricultural pest control is through local agricultural management departments, regularly using drones to collect video data of cotton and other crop areas. The management platform identifies the pest and disease areas, counts the pest and disease areas, estimates possible losses, and predicts development trends. Farmers carry out prevention and control based on the analysis results, thereby ensuring the quality and yield of cotton.
[0030] In the application scenario of oil depot fire emergency rescue, real-time multi-window and multi-dimensional monitoring of the fire situation is required. In the application scenario of natural resource verification, field drones are required for on-site verification and evidence collection, and internal desktop approval and reporting are required, so more emphasis is placed on interactivity and user experience; in the application scenario of rural damaged road collection, it is necessary to display the damaged location and calculate the damaged area. In the application scenario of abandoned farmland detection, it is also necessary to compare the farmland cover in the monitoring area and extract the planted farmland. In the application scenario of agricultural pest control, it is necessary to identify the pest area, count the pest area, estimate the possible loss, and predict the development trend. Therefore, more emphasis is placed on efficient data processing and rendering capabilities. Through the method of the present invention based on drone images combined with WebGIS differentiated shielding, users can choose the appropriate engine according to different application scenarios and needs, reducing the selection cost and difficulty of use.
[0031] The WebGIS-based differentiated shielding method in this embodiment is aimed at the specific application of drone images in the above-mentioned oil depot fire emergency rescue, natural resource verification, rural damaged road collection, farmland abandonment detection and agricultural pest control application scenarios, including the following steps: S1. Receive the WebGIS call request sent by the drone terminal.
[0032] S2. Based on the abstraction of the domain model of map data expression, a general protocol is defined, the WebGIS protocol interface is encapsulated, and the protocol interface is selected according to the call request for data interaction to generate a rendering request.
[0033] like Figure 1 As shown in the figure, the process of encapsulating the WebGIS protocol interface is: establish a WebGIS domain model, divide the domain model into subdomains to abstractly describe the business functions, define the protocol based on the abstract description of the business functions, implement specific functions based on the protocol definition, and complete the encapsulation of the WebGIS protocol interface.
[0034] This embodiment adopts the idea of domain-driven design. First, the WebGIS domain model is established and the subdomain model is divided. The main subdomain models of the WebGIS domain include: layer subdomain model, basemap subdomain model, control subdomain model, map interaction subdomain model, and rendering scene subdomain model. Then, the functions of each subdomain model are abstractly defined. This embodiment adopts the InterFace type feature in the TypeScript development language to implement the abstract definition of the subdomain model function. According to the abstract definition of the subdomain model function, the Implements feature in the TypeScript development language is used to implement the function in the interface class, such as Figure 2 As shown, the specific subdomain model division and some functional characteristics are demonstrated.
[0035] S3. Obtain rendering requests, parse to obtain terminal device performance data, dynamically evaluate the terminal device performance data to obtain the terminal device computing power value, and generate WebGIS platform control instructions based on the terminal device computing power value.
[0036] like Figure 3 As shown, the process of generating WebGIS platform control instructions is to preset the evaluation strategy of the WebGIS platform corresponding to the computing power values of different terminal devices, register and monitor the computing power driver of the terminal device, monitor the computing power status of the terminal device, dynamically evaluate the computing power value of the terminal device, select the WebGIS platform according to the computing power value of the terminal device and the evaluation strategy, generate WebGIS platform control instructions, and select the corresponding WebGIS platform according to the WebGIS platform control instructions to initialize and complete the adaptive WebGIS platform operation.
[0037] In this embodiment, the terminal device computing power driver is mainly registered and monitored. The driver can directly load the driver to obtain the current terminal device performance indicators without intruding into the business code; the driver mainly obtains the number of CPU cores, CPU computing speed, GPU information, and FPS test results of the terminal device, and calculates the terminal device computing power value by assigning different weights to these performance indicators. The computing power value intervals of different terminal devices are divided in advance to correspond to the selected WebGIS platform, so that the terminal device computing power value calculated according to different weights can be adaptively selected.
[0038] The present embodiment obtains the number of CPU cores by calling the hardwareConcurrency API of the browser; the API is used to obtain the number of CPU cores that can be used by the client.
[0039] For the CPU calculation speed, it is mainly through executing a complex operation script to obtain the time difference between the CPU calculations before and after, so as to evaluate the CPU calculation speed. For time acquisition, this embodiment adopts the browser Date API getSeconds and getMinutes to obtain.
[0040] For GPU information, this embodiment obtains information related to the GPU of the current terminal device through the WEBGL_debug_renderer_info extension in WebGL, and processes the obtained information to return standardized information.
[0041] For FPS testing, this embodiment calculates by calling the browser's requestAnimationFrame API, and obtains the current terminal device FPS value through the time difference of each frame refresh; this embodiment also provides another way to obtain FPS, by obtaining GPU information, and then obtaining standard device parameters of different graphics cards from the GFXBench website to obtain the FPS value; wherein the GFXBench website is a high-end graphics benchmark test that uses industry standards and specific APIs provided by suppliers to measure mobile and desktop performance through next-generation graphics capabilities across all platforms. It is currently a true cross-API benchmark test and one of the sources of test reports on the main graphics performance aspects of GPU performance testing.
[0042] Regarding selecting a WebGIS platform according to the performance indicators, this example provides a preferred embodiment. Currently, Openlayers and CesiumJS WebGIS platform selection strategies are given, as shown in Table 1: Table 1 Selection strategies of Openlayers and CesiumJS WebGIS platforms S4. Obtain the WebGIS platform control instruction and determine whether it is the first rendering request. If it is the first rendering request, select the WebGIS platform to complete the rendering. If it is not the first rendering request, jump to step S5.
[0043] The judgment of whether it is the first rendering request is based on the cookie value in the platform control instruction. After obtaining the WebGIS platform control instruction, a cookie search function is triggered to find out whether there is a user-visited field in the cookie. If the user is requesting rendering for the first time and there is no such field, then the event of selecting the WebGIS platform for rendering is triggered, and the user-visited field is written into the cookie. Conversely, if the user-visited field is found in the cookie, the event of drawing the pre-rendered scene is triggered.
[0044] This embodiment is mainly based on the architecture design involved in solving different WebGIS platforms, and finally solves the incompatibility between different WebGIS platforms by decoupling the architecture design from the map. Figure 4 As shown, the process of selecting the WebGIS platform to complete the rendering is: abstraction of the rendering container, division of the component services that the rendering container depends on, injection of the component services into the rendering container, injection of the plug-in services into the component service call life cycle, and selection of the rendering container to schedule the component services to complete the rendering according to the rendering request.
[0045] This embodiment adopts a future-oriented scalable architecture design method, preferably adopts a control flip design mode and adopts a modular + plug-in basis as the implementation basis of the technical solution of the present invention. The specific framework design is as follows: Figure 5 As shown, the visualization rendering layer mainly carries the rendering control of the entire application. In the visualization rendering layer, many component services are registered, such as map engine service, layer management service, control service, debugging service, plug-in service, data mapping service, global picking service, etc. By registering the control service in the visualization rendering layer, the visualization layer is in the rendering stage. The entire rendering process is driven by the rendering container in the visualization rendering layer, and the rendering operation is completed by scheduling different component services.
[0046] For plug-in processing, a programming paradigm based on event flow is adopted, so that plug-in processing is more focused on triggering and processing custom events. Through plug-in, you can customize the registered event, and then execute the custom event when the triggering condition of the custom registered event is met.
[0047] The entire visualization engine rendering process is implemented based on plug-in processing. By monitoring different rendering stages, the rendering life cycle is obtained. External events can be customized through the plug-in mechanism, and then each component service monitors the plug-in life cycle to schedule component services to complete the entire scene rendering. Figure 6 shown.
[0048] S5. Switch the WebGIS platform to draw the pre-rendered scene, and complete the smooth and imperceptible perspective switching of the WebGIS platform.
[0049] like Figure 7 As shown, the process of switching the WebGIS platform to draw the pre-rendered scene is: encapsulating the general rendering layer, converting the external call rendering function into a specific rendering instruction, performing graphics rendering according to the rendering instruction and the rendering layer, obtaining the rendering scene parameters according to the graphics rendering for caching, and using the rendering scene pool to pre-render the scene according to the rendering scene parameters. When switching the WebGIS platform operation, the pre-rendered scene in the rendering scene pool is drawn.
[0050] This embodiment mainly relies on the aforementioned future-oriented scalable architecture design and off-screen rendering technology to achieve real rendering by encapsulating the rendering container in the visualization rendering layer. Figure 8 As shown, in this embodiment, a canvas container is used to carry visual rendering, and the map service layer is mainly used to load maps and has nothing to do with the core visual rendering. The canvas container pre-renders the scene by calling an external rendering function, and pre-draws the pre-rendered scene in the rendering scene pool when switching the WebGIS platform operation, so that the WebGIS platform switching is achieved without perception. For the off-screen rendering technology, this embodiment uses canvas's createFrameBuffer to implement it, and creates a frame buffer object by obtaining the scene rendering configuration, and finally draws the buffer object through canvas's frameBufferTexture2D.
[0051] Embodiment 2: A differentiated shielding system based on WebGIS includes a request receiving module, an interface encapsulation module, a platform encapsulation module, a platform switching module and a seamless transition module.
[0052] The request receiving module receives the WebGIS calling request sent by the external terminal.
[0053] The WebGIS domain model is established inside the interface encapsulation module, and the domain model is divided into subdomains to abstractly describe the business functions. Then, the general protocol is defined based on the abstract description of the business functions. Finally, the general protocol definition is used to implement specific functions and complete the encapsulation of the WebGIS protocol interface. The call request in the request receiving module is obtained to select the protocol interface for data interaction and generate a rendering request.
[0054] The platform switching module is used to adaptively switch the WebGIS platform. First, the evaluation strategy of the WebGIS platform corresponding to the computing power values of different terminal devices is preset, and then the computing power driver of the terminal device is registered to monitor the computing power status of the terminal device. The monitoring of the computing power driver of the terminal device is to obtain the number of CPU cores, CPU computing speed, GPU information and FPS test results of the terminal device through monitoring. According to the preset evaluation strategy, based on the comprehensive computing power evaluation index system, the CPU idle rate index, GPU idle rate index, RAM and hard disk storage index and network data throughput are obtained to generate the terminal device computing power value. By dynamically evaluating the computing power value of the terminal device, the process is to first use the entropy weight method to calculate the basic performance score of the node, and then use the CART algorithm to segment the basic performance. After determining the user's basic performance requirements for the node, its dynamic factors are obtained. Finally, the n-dimensional Euclidean distance method is used to find the WebGIS platform that best matches the user's task requirements, generate WebGIS platform control instructions, and finally use the WebGIS platform control instructions to select the corresponding WebGIS platform for initialization to complete the adaptive WebGIS platform operation.
[0055] The platform encapsulation module is used to encapsulate various WebGIS platforms. The rendering container is abstracted into a visual rendering layer internally, which is used to carry the rendering control of the entire application. Multiple component services are registered in the visual rendering layer, which are used to perform rendering operations by scheduling multiple component services. Multiple component services include map engine services, layer management services, control services, debugging services, plug-in services, data mapping services, and global picking services. By registering component services in the visual rendering layer, the entire rendering process is driven by the rendering container in the visual rendering layer during the rendering stage.
[0056] The visual rendering layer schedules multiple component services to perform rendering operations based on plug-in processing. By monitoring different rendering stages and injecting the rendering life cycle, external custom events are performed through the plug-in mechanism. Each component service monitors the plug-in life cycle to schedule component services to complete the entire scene rendering. By obtaining the WebGIS platform control instructions in the platform switching module, the WebGIS platform is switched to complete the rendering.
[0057] The seamless transition module is used for seamless and imperceptible switching of WebGIS platforms. It encapsulates the general rendering layer based on the architecture design of the platform encapsulation module, converts the external rendering function call into specific rendering instructions, performs graphics rendering according to the rendering instructions and the rendering layer, and then obtains the rendering scene parameters for caching. Through the rendering scene parameters, the rendering scene pool is used to pre-render the scene. When switching the WebGIS platform operation, the pre-rendered scene in the rendering scene pool is drawn to complete the smooth and imperceptible perspective switching of the WebGIS platform.
[0058] Embodiment 3: A WebGIS-based differentiated shielding electronic device comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the processor, the instructions being used to be executed by the processor to implement the WebGIS-based differentiated shielding method of embodiment 1, the method comprising: receiving a WebGIS call request sent by an external terminal; performing a general protocol definition based on the abstraction of a domain model expressing map data, encapsulating a WebGIS protocol interface, selecting a protocol interface for data interaction based on the call request, and generating a rendering request; obtaining the rendering request, parsing it to obtain terminal device performance data, dynamically evaluating the terminal device performance data to obtain a terminal device computing power value, and generating a WebGIS platform control instruction based on the terminal device computing power value; obtaining the WebGIS platform control instruction, determining whether it is the first rendering request, and if so, selecting the WebGIS platform to complete the rendering; if not, switching the WebGIS platform to draw a pre-rendered scene, and completing a smooth and imperceptible perspective switching of the WebGIS platform.
[0059] Embodiment 4: A computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by a computer to implement the WebGIS-based differentiated shielding method of embodiment 1, the method comprising: receiving a WebGIS call request sent by an external terminal; based on the abstraction of the map data expression domain model, defining a general protocol, encapsulating a WebGIS protocol interface, selecting a protocol interface for data interaction according to the call request, and generating a rendering request; obtaining the rendering request, parsing it to obtain terminal device performance data, dynamically evaluating the terminal device performance data to obtain a terminal device computing power value, and generating a WebGIS platform control instruction according to the terminal device computing power value; obtaining the WebGIS platform control instruction, determining whether it is the first rendering request, and if it is the first rendering request, selecting a WebGIS platform to complete the rendering; if it is not the first rendering request, switching the WebGIS platform to draw a pre-rendered scene, and completing a smooth and imperceptible perspective switching of the WebGIS platform.
[0060] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A differentiated shielding method based on WebGIS, characterized in that: The following steps are involved: S1, receiving a WebGIS call request sent by an external terminal; S2. Based on the abstraction of the domain model of map data expression, a general protocol is defined, the WebGIS protocol interface is encapsulated, and the protocol interface is selected according to the call request for data interaction, and a rendering request is generated; S3, obtain the rendering request, parse and obtain the terminal device performance data, dynamically evaluate the terminal device performance data to obtain the terminal device computing power value, and generate the WebGIS platform control instruction according to the terminal device computing power value; S4, obtaining the WebGIS platform control instruction, determining whether it is the first rendering request, if it is the first rendering request, selecting the WebGIS platform to complete the rendering, otherwise, jumping to step S5; S5. Switch the WebGIS platform to draw the pre-rendered scene, and complete the smooth and imperceptible perspective switching of the WebGIS platform.
2. The WebGIS-based differentiated shielding method according to claim 1, characterized in that: The process of encapsulating the WebGIS protocol interface in step S2 is as follows: S201, establish WebGIS domain model; S202, divide the domain model into subdomains to perform abstract description of business functions; S203, define the protocol according to the abstract description of the business function; S204. Implement specific functions according to the protocol definition and complete the encapsulation of the WebGIS protocol interface.
3. The WebGIS-based differentiated shielding method according to claim 1, characterized in that: The process of generating the WebGIS platform control instruction in step S3 is as follows: S301, presetting the evaluation strategy of selecting the WebGIS platform corresponding to the computing power values of different terminal devices; S302, registering and monitoring the computing power driver of the terminal device; S303, monitoring the computing power status of the terminal device; S304, dynamically evaluate the computing power value of the terminal device; S305: Select a WebGIS platform according to the computing power value of the terminal device and the evaluation strategy, and generate a WebGIS platform control instruction.
4. The WebGIS-based differentiated shielding method according to claim 1, characterized in that: The process of selecting the WebGIS platform to complete rendering in step S4 is as follows: S401, rendering container abstraction; S402, dividing the component services that the rendering container depends on; S403, injecting component services into the rendering container; S404, injecting the plug-in service into the component service call life cycle; S405: According to the rendering request, a rendering container scheduling component service is selected to complete the rendering.
5. The WebGIS-based differentiated shielding method according to claim 1, characterized in that: The process of switching the WebGIS platform to draw the pre-rendered scene in step S5 is as follows: S501, encapsulate the general rendering layer; S502, converting the external call rendering function into a specific rendering instruction; S503, performing graphics rendering according to the rendering instruction and the rendering layer; S504, obtaining rendering scene parameters according to the graphics rendering and caching them; S505, performing scene pre-rendering using a rendering scene pool according to rendering scene parameters; S506: Draw the pre-rendered scene in the rendering scene pool when switching the WebGIS platform operation.
6. The WebGIS-based differentiated shielding method according to claim 4, characterized in that: The rendering container is abstracted into a visual rendering layer, which is used to carry the rendering control of the entire application. At least one component service is registered in the visual rendering layer, and the component service is used to perform rendering operations by scheduling.
7. The WebGIS-based differentiated shielding method according to claim 6, characterized in that: The component services include map engine services, layer management services, control services, debugging services, plug-in services, data mapping services and global picking services. By registering component services in the visual rendering layer, the entire rendering process of the visual rendering layer is driven by the rendering container in the visual rendering layer during the rendering phase.
8. The WebGIS-based differentiated shielding method according to claim 6, characterized in that: The visualization rendering layer scheduling component service to perform rendering operations is implemented based on plug-in processing. By monitoring the rendering request process, the rendering life cycle is obtained, and custom events are performed externally through the plug-in mechanism. The plug-in service is scheduled according to the rendering life cycle to complete the entire scene rendering.
9. The WebGIS-based differentiated shielding method according to claim 3, characterized in that: The terminal device computing power monitoring driver obtains the CPU core number, CPU computing speed, GPU information and FPS test results of the terminal device through monitoring, generates the terminal device computing power value according to the preset evaluation strategy, and thus generates the WebGIS platform control instructions.
10. The differentiated shielding system based on WebGIS is characterized by: It includes a request receiving module, an interface encapsulation module, a platform encapsulation module, a platform switching module and a seamless transition module; The request receiving module is used to receive a WebGIS call request sent by an external terminal; The interface encapsulation module is used to define a general protocol based on the abstraction of the map data expression domain model, implement the encapsulation of the WebGIS protocol interface, select the protocol interface for data interaction by obtaining the call request in the request receiving module, and generate a rendering request; The platform switching module is used to adaptively switch the WebGIS platform, obtain the rendering request in the interface encapsulation module, parse the terminal device performance data, dynamically evaluate the terminal device performance data to obtain the terminal device computing power value, and generate the WebGIS platform control instruction according to the terminal device computing power value; The platform encapsulation module is used to encapsulate multiple WebGIS platforms, and selects to switch the WebGIS platform to complete the rendering by obtaining the WebGIS platform control instruction in the platform switching module; The seamless transition module is used for seamless and imperceptible switching of the WebGIS platform. By utilizing the architecture design of the platform encapsulation module to encapsulate the general rendering layer and perform scene pre-rendering, the WebGIS platform can be smoothly and imperceptibly switched in perspective.
11. Differentiated shielding electronic equipment based on WebGIS, characterized in that: It comprises at least one processor; and a memory which is communicatively connected to at least one of the processors; wherein the memory stores instructions which can be executed by the processor, and the instructions are used to be executed by the processor to implement the WebGIS-based differentiated shielding method described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the WebGIS-based differentiated shielding method described in any one of claims 1-9.
Citation Information
Patent Citations
WEBGIS compatible system, method and device and storage medium
CN114153437A