A method for embedding digital earth based on QcefView component
Through the method based on the QcefView component, the steps for embedding the digital earth in the application are simplified, the code reuse rate and the compatibility of the system environment are improved, the cumbersome steps and compatibility problems of embedding the digital earth in the existing technology are solved, and a high-performance digital earth is realized. exhibit.
Patent Information
- Application Number
- CN202411053777.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-02
AI Technical Summary
In the existing technology, the steps for embedding applications into the Digital Earth are cumbersome, the code reusability is poor, the hardware performance requirements are high, and there are compatibility issues, which increase the difficulty of development and maintenance, and may even cause the computer to crash or the web to fail to load.
A method based on the QcefView component is used to build a digital earth basic development package and integrate CEF's QcefView component to form a digital earth plug-in, simplifying the steps for embedding applications into the digital earth, and improving code reuse rate and system environment compatibility.
Through plug-in integration, calling and embedding a complete browser reduces hardware requirements, improves performance, simplifies development and maintenance, enhances system environment compatibility, and reduces project difficulty.
Smart Images

Figure CN118567636B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of simulation application visualization, and in particular to a method for implementing digital earth embedding based on a QcefView component. Background Art
[0002] With the continuous advancement of science and technology and the advent of the digital era, the widespread application of digital earth presents users with more realistic, detailed and vivid visualizations. The visualization of many simulation applications must rely on digital earth to present. In existing projects, the integration and embedding of applications into digital earth is cumbersome, the code commonality is poor, the hardware performance requirements are high, and many deployments have compatibility issues in individual environments, causing some computers to crash inexplicably, or web loading failures and freezes, which increases the difficulty of project development and maintenance. Therefore, it is necessary to simplify the steps of embedding applications into digital earth, improve code reuse rate, and improve the compatibility of digital earth in applications with the system environment. Summary of the invention
[0003] Based on this, it is necessary to provide a method for embedding digital earth based on QcefView component to address the above technical problems, so as to simplify the steps of embedding digital earth in application, improve code reuse rate, and improve the compatibility of digital earth in application and system environment.
[0004] A method for implementing digital earth embedding based on QcefView component, the method comprising:
[0005] S1. Build a digital earth basic development package as the basic interface for upper-layer display application development;
[0006] S2. Construct the general interface class for visualization display of the application web side according to the Digital Earth Basic Development Kit;
[0007] S3. Build the QcefView component that integrates CEF for loading and UI rendering of the digital globe;
[0008] S4. Build a digital earth plug-in that integrates QcefView components;
[0009] S5. Load the Digital Earth plug-in to complete the call of the general interface for visualization display of the Digital Earth web terminal.
[0010] Compared with the prior art, the present invention has the following advantages: 1) The plug-in integrated call simplifies the technical means of embedding the digital earth in the application, improves the code reuse rate, and reduces the difficulty of project development and maintenance; 2) A complete browser is embedded in the digital earth plug-in, which has low hardware requirements and can give full play to the rich and powerful Web capabilities of CEF. It has good performance and does not rely on the local web environment during installation and deployment, thereby improving the compatibility of the system environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of a method for implementing digital earth embedding based on QcefView component;
[0012] Figure 2 A flowchart for building a digital earth plug-in that integrates the QcefView component;
[0013] Figure 3 A structural block diagram of a device for implementing digital earth embedding based on a QcefView component in one embodiment;
[0014] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0015] 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.
[0016] In one embodiment, Figure 1 As shown, a method for implementing digital earth embedding based on QcefView component is provided, including the following steps:
[0017] S1: Build a digital earth basic development package as the basic interface for upper-level display application development.
[0018] S2: Construct the general interface class for visualization display of the application web side according to the Digital Earth Basic Development Kit. This class is the specific implementation of visualization display of the application.
[0019] S3: Build the QcefView component that integrates CEF for loading and UI rendering of the digital globe.
[0020] S4: Build a digital globe plug-in that integrates QcefView components.
[0021] S5: Load the Digital Earth plug-in to complete the general interface call of the Digital Earth web-based visualization display.
[0022] In summary, on the one hand, this application simplifies the technical means of embedding Digital Earth in applications through plug-in integrated calls, improves the code reuse rate, and reduces the difficulty of project development and maintenance. On the other hand, this application fully utilizes CEF's rich and powerful Web capabilities by embedding a complete browser in the plug-in, improves performance, reduces hardware requirements, removes the dependence on the local web environment when installing and deploying the application, and improves system environment compatibility.
[0023] In one embodiment, a digital earth basic development kit is constructed, including:
[0024] Use the open source Cesium as the digital earth framework, obtain the Cesium source code and modify it, compile the modified Cesium source code through node js, and generate the digital earth basic development package.
[0025] In one embodiment, a visual display general interface class for an application web terminal is constructed, including:
[0026] According to the visualization business requirements of the application, JavaScript is used to call the Digital Earth Basic Development Kit to realize the visualization display general interface class on the web side, complete the specific implementation of the visualization business display of the application, and form a business interface. The visualization display general interface class on the web side is loaded through the hypertext markup language and registered in the window on the web side.
[0027] In one embodiment, a QcefView component integrating CEF is constructed, including:
[0028] 1) Download CEF, modify the initial configuration of CEF, and use CMAKE to compile and generate the CEF development package;
[0029] 2) Download the CefViewCore source code, place the CEF development kit in the dep folder in the CefViewCore source code, and configure the version information of the CEF development kit in the CefViewCore source code;
[0030] 3) Download the QcefView source code, place the CefViewCore source code configured in the previous step in the QcefView source code directory, configure the Qt compilation environment, and use the CMAKE tool to create the generation directory of the QcefView component after the configuration is completed;
[0031] 4) Use CMAKE to compile the QcefView source code configured in the previous step. After waiting for the compilation to succeed, you will get the QCefView component with integrated CEF function.
[0032] Unlike the browser version of QwebEngineView, which depends on the QtCreator version, has poor compatibility and is difficult to replace, the QcefView component embeds a complete Chromium Embedded Framework (CEF). CEF can select or upgrade different versions according to needs, and can give full play to CEF's rich and powerful Web capabilities. It has low hardware requirements and good performance. It does not rely on the local web environment during installation and deployment, which improves the compatibility of the system environment. The QcefView component can use off-screen rendering mode to support the development of multiple layers and special effects of applications on its interface, thereby improving efficiency.
[0033] In one embodiment, a digital earth plug-in integrating a QcefView component is constructed, including:
[0034] Implement a class that inherits QcefView, map the interface of this class to the general interface of Digital Earth, and encapsulate it into a plug-in to obtain a Digital Earth plug-in that integrates the functions of the QcefView component as an interactive channel between the application and Digital Earth.
[0035] 1) The event message mechanism for the communication between the Digital Earth plug-in and the Digital Earth is implemented in the Digital Earth plug-in. This facilitates the caller of the Digital Earth plug-in to process the event messages of the Digital Earth in real time, increases the flexibility of the interface, and enables the caller to perform more complex logical processing on the Data Earth.
[0036] 2) The Digital Earth plug-in adds an interface mapping mechanism for the general interface class of the visualization display of the application web side. This effectively solves the scalability and calling convenience of the visualization function of the Digital Earth plug-in without affecting the overall stability of the plug-in.
[0037] 3) Different rendering data types are defined in the Digital Earth plug-in, and a dual cache mechanism for the unrendered data queue and the rendered data queue is implemented. This is to better solve the performance issues of high-frequency data and large data rendering. When high-frequency data is rendered in the program, the high-frequency data processing strategy mode is called to effectively filter multiple data of the same type within the effective rendering time range, eliminate redundant data, and relieve rendering pressure; the amount of rendering data and the use of computer resources are monitored in real time. When the amount of rendered data reaches a certain peak, the rendering process is dynamically increased to make full use of computer resources to achieve higher performance.
[0038] like Figure 2 As shown, a flowchart of building a digital earth plug-in integrating the QcefView component is provided.
[0039] This step supports the subsequent embedding of digital earth applications in different projects through integrated plug-ins, which reduces development work, lowers project maintenance costs and difficulty, and improves code reuse.
[0040] In one embodiment, loading the digital earth plug-in and completing the interface call of the digital earth includes:
[0041] Load the Digital Earth plug-in in the application, connect the signal and slot messages of QcefView, complete the connection of the web and application interaction channels, initialize the configuration of CEF, load the hypertext markup language that registers the Digital Earth general interface class, complete the loading of the Digital Earth's Web resources, call the plug-in interface to interact with the Digital Earth, and implement the embedding of the Digital Earth in the application.
[0042] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0043] In one embodiment, Figure 3 As shown, a device for implementing digital earth embedding based on QcefView component is provided, including: a development package building module, a general interface class building module, a component building module, a plug-in building module and a plug-in loading module, wherein:
[0044] Development kit building module, used to build the digital earth basic development kit, as the basic interface for upper-layer display application development;
[0045] The general interface class building module is used to build the visual display general interface class of the application web side according to the digital earth basic development kit;
[0046] Component building module, used to build the QcefView component integrated with CEF for loading and UI rendering of the digital globe;
[0047] Plugin building module, used to build digital earth plugins that integrate QcefView components;
[0048] The plug-in loading module is used to load the Digital Earth plug-in and complete the call of the visual display interface of the Digital Earth web terminal.
[0049] For the specific definition of a device for implementing digital earth embedding based on the QcefView component, please refer to the definition of a method for implementing digital earth embedding based on the QcefView component above, which will not be repeated here. Each module in the above-mentioned device for implementing digital earth embedding based on the QcefView component can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0050] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the digital earth. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for embedding a digital earth based on the QcefView component is implemented.
[0051] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0052] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.
[0053] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.
[0054] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0055] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0056] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for embedding digital earth based on QcefView component, It is characterized in that The method comprises: S1. Build a digital earth basic development package as the basic interface for upper-layer display application development; S2. Construct the general interface class for visualization display of the application web side according to the Digital Earth Basic Development Kit; S3. Build the QcefView component that integrates CEF for loading and UI rendering of the digital globe; S4. Build a digital earth plug-in that integrates QcefView components; S5. Load the digital earth plug-in and complete the call of the general interface for visualization display of the digital earth web terminal; The step S4 comprises: Implement a class that inherits the QcefView component, map the interface of this class with the general interface of Digital Earth, and encapsulate it into a plug-in to obtain a Digital Earth plug-in that integrates the functions of the QcefView component as an interactive channel between the application and Digital Earth; where: 1) The event message mechanism for communication between the Digital Earth plug-in and the Digital Earth plug-in is implemented in the Digital Earth plug-in; 2) Added an interface mapping mechanism for visually displaying common interface classes with the application web side in the Digital Earth plug-in; 3) Different types of rendering data are defined in the Digital Earth plug-in, and a double cache mechanism for the unrendered data queue and the rendered data queue is implemented.
2. The method according to claim 1, It is characterized in that The step S1 comprises: Get the Cesium source code and modify it, compile the modified Cesium source code through node js, and generate the Digital Earth Basic Development Kit.
3. The method according to claim 1, It is characterized in that The step S2 comprises: According to the visualization business requirements of the application, JavaScript is used to call the Digital Earth Basic Development Kit to implement the general interface class for visualization display on the web side, and the general interface class for visualization display on the web side is loaded through Hypertext Markup Language to register it in the window on the web side.
4. The method according to claim 1, It is characterized in that The step S3 comprises: 1) Download CEF, modify the initialization configuration of CEF, and use CMAKE to compile and generate the CEF development package; 2) Download the CefViewCore source code, place the CEF development kit in the dep folder in the CefViewCore source code, and configure the version information of the CEF development kit in the CefViewCore source code; 3) Download the QcefView source code, place the CefViewCore source code configured in the previous step in the QcefView source code directory, configure the Qt compilation environment, and use the CMAKE tool to create the generation directory of the QcefView component after the configuration is completed; 4) Use CMAKE to compile the QcefView source code configured in the previous step. After waiting for the compilation to succeed, you will get the QCefView component with integrated CEF function.
5. The method according to claim 1, It is characterized in that The step S5 comprises: Load the Digital Earth plug-in in the application, connect the signal and slot messages of the QcefView component, complete the connection of the interactive channel between the web and the application, call the initialization interface in the Digital Earth plug-in to complete the loading of the Digital Earth web resources, call the general visualization interface to realize the visualization of specific services on the Digital Earth, and complete the embedding of the Digital Earth in the application.
