Octree-based point cloud visual fusion scheduling system and method for Web end
By adopting the octree-based point cloud visual fusion scheduling method in the web environment, using WebSocket and multi-threading technology, efficient scheduling, transmission and rendering of large-scale point cloud data is achieved, solving the problem of point cloud data processing in the web environment and providing an efficient and smooth user experience.
Patent Information
- Application Number
- CN202510177050.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-23
AI Technical Summary
In the web environment, it is difficult for the existing technology to realize efficient scheduling, transmission and rendering of large-scale point cloud data, and there are problems such as limited file access, complex multi-threaded communication and low transmission performance.
The point cloud visual fusion scheduling method based on octree is adopted, through the collaborative work of the front-end and back-end, the point cloud data is organized into an octree structure, and the camera projection matrix and node data are transmitted in real time using WebSocket bidirectional data stream. The backend traverses the octree through multi-threads, calculates node weights, generates load queues, and consumes them in independent threads to ensure that important nodes are loaded and rendered first.
It realizes efficient management and real-time rendering of large-scale point cloud data in the web environment, solves the problems of limited file access, complex multi-threaded communication and low transmission performance, and provides smooth user interaction experience and efficient resource utilization.
Smart Images

Figure CN120029710A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of point cloud data visualization methods, and in particular to a method, device and medium for fusion scheduling of point cloud visualization based on an octree on a Web end. Background Art
[0002] Application areas of point cloud data visualization methods:
[0003] 1. Public safety 3D scene reconstruction and visualization: In the field of public safety, the point cloud scheduling and rendering technology of the present invention can be used to reconstruct and visualize the 3D scene of an accident scene, disaster area or crime scene in real time. Relevant departments can quickly browse the 3D points of the reconstructed scene to provide support for emergency response, investigation and evidence collection, and safety assessment.
[0004] 2. 3D modeling and visualization: In architectural design, urban planning and virtual reality, real-time point cloud rendering technology is used to visualize three-dimensional models in real time, allowing designers to intuitively view and modify designs.
[0005] 3. Geographic Information System (GIS): Through real-time rendering and hole filling technology, point cloud data (such as LiDAR data) is integrated into GIS applications to improve the display effect and analysis accuracy of geographic data such as terrain and buildings.
[0006] 4. Smart City: In the construction of smart cities, real-time point cloud data is used to monitor urban infrastructure, update urban models in real time, and provide data support for urban management and decision-making.
[0007] 5. Online education and training: In online education platforms, 3D point cloud rendering technology is used to create virtual laboratories or interactive learning environments, allowing students to explore and interact in real time, thereby enhancing learning effects.
[0008] The following potential application areas are also included:
[0009] 1. Environmental monitoring and management: In the field of environmental protection and resource management, point cloud rendering technology is used to monitor natural resources in real time, evaluate environmental changes, and support sustainable development decisions.
[0010] 2. Cultural heritage protection: 3D scanning and real-time rendering of historical sites or cultural relics for display and protection on digital platforms, providing support for cultural heritage research and education.
[0011] Technical features of the prior art:
[0012] 1. Octree structure
[0013] Feature description: Octree is a space-segmentation data structure used to efficiently manage and retrieve point cloud data in three-dimensional space. It recursively divides the three-dimensional space into eight subspaces, each of which can store corresponding point cloud data. The advantage of octree is that it can quickly locate data in a specific area and support efficient insertion, deletion and query operations.
[0014] Application effect: By using the octree, the system can significantly reduce the amount of data that needs to be processed during rendering and scheduling, and improve performance, especially when processing large-scale point cloud data.
[0015] 2. Scheduling Algorithm
[0016] Feature description: The scheduling algorithm is responsible for dynamically managing the loading order of point cloud data according to the user's perspective and needs. It combines the camera's projection matrix and the node's weight to prioritize the loading of important nodes in the visible area. The scheduling process takes into account the visibility, importance, and resource usage of the nodes to ensure that the system can still provide a smooth rendering experience when resources are limited.
[0017] Application effect: Through intelligent scheduling, the system can effectively reduce unnecessary data transmission, improve rendering efficiency, and optimize the user's interactive experience.
[0018] 3. Multithreading
[0019] Feature description: Multithreaded processing uses the multi-core architecture of modern computers to achieve efficient data processing and rendering through parallel processing. In this invention, the backend uses multiple threads to concurrently execute octree traversal, node screening, and data loading tasks. This method allows different processing tasks to be performed simultaneously, thereby greatly improving the system's response speed and processing capabilities.
[0020] Application effect: Multi-threaded processing significantly reduces processing delays, ensures that users get real-time feedback when interacting with 3D scenes, and improves the performance and usability of the overall system.
[0021] The existing point cloud data visualization methods have the following main defects:
[0022] File access and resource limitations in the Web environment: Due to browser security restrictions, Web applications cannot directly access the local file system, which makes it difficult to schedule and render large-scale point cloud data. In single-threaded mode, the rendering thread and the scheduling thread will compete for resources, reducing rendering efficiency.
[0023] Multi-threaded communication in the Web environment is complex: Multi-threaded collaboration in browsers does not support shared memory, is difficult to manage efficiently, and is prone to resource competition and synchronization problems, increasing the difficulty of development and maintenance.
[0024] Low data transmission efficiency: The amount of point cloud data is huge. If there is no effective data stratification and screening mechanism, a large amount of irrelevant data often needs to be transmitted, affecting transmission efficiency and rendering performance.
[0025] High real-time requirements: In interactive scenarios, the user's perspective is constantly changing, which places high demands on the real-time loading and rendering of point cloud data. Traditional methods cannot guarantee sufficient real-time responsiveness. Summary of the invention
[0026] The main technical problem solved by the present invention is to provide a solution that can realize efficient scheduling, transmission and rendering of large-scale point cloud data in a Web environment, thereby solving the problems of limited file access, complex multi-threaded communication and low transmission performance.
[0027] A Web-based octree-based point cloud visualization fusion scheduling method includes a front-end and a back-end:
[0028] The front end first organizes the point cloud data into octree structure data and stores it in the back end in the form of files;
[0029] The front-end inputs the camera projection matrix and transmits it to the back-end in real time through the WebSocket bidirectional data stream;
[0030] After receiving the camera projection matrix, the backend calculates the weight of each node in the octree;
[0031] The backend generates a loading queue based on the weight, sorts all nodes to be loaded by weight, adds them to the queue, and consumes them in an independent thread;
[0032] The backend transmits node data to the frontend in real time through the WebSocket bidirectional data stream, and the frontend uses WebGL to render the received node data.
[0033] Octree is a structure suitable for spatial data management. It divides the three-dimensional space into eight sub-nodes and constructs nodes of different levels according to the distribution of point cloud data. The octree hierarchical structure can help the system quickly locate point cloud data in a specific area.
[0034] Independent threads are responsible for gradually loading and parsing node data from the queue to ensure that important nodes are loaded first; the consumer thread sends the data of the parsed node in real time in a streaming manner, transmits the results to the front end through WebSocket, and sends a destruction event when the node is no longer needed.
[0035] By creating a weight loading queue and using independent threads for consumption, the system can load node data in an orderly and efficient manner, thus avoiding resource contention and efficiency issues caused by single-threaded processing. In this way, background node loading will not block other operations, and users can interact smoothly and update the view in real time.
[0036] Preferably, the calculating the weight of each node in the octree includes:
[0037] Node bounding box calculation: The 3D boundary of each node is represented as an axis-aligned bounding box to accurately define the range and position of the node in 3D space;
[0038] 2D projection of bounding box to screen: The backend maps the node bounding box from 3D space to a 2D plane on the screen according to the projection matrix of the current camera, and generates the 2D projection area of the node in the view.
[0039] Calculation of screen pixel ratio: After completing the two-dimensional projection, the system calculates the pixel ratio of the node projection on the screen based on the screen rendering resolution and the pixel size of the current page rendering;
[0040] Priority inside the 3D bounding box: If the current camera position is inside the 3D bounding box of a node, the node is very important in the view and its priority is immediately raised to the highest.
[0041] By calculating the weight to determine the importance of the node, you can avoid loading irrelevant nodes, thereby saving network bandwidth and computing resources. The weight algorithm usually makes a comprehensive evaluation based on the distance, size and position of the node in the current perspective to ensure that the loaded nodes are the most needed parts of the current view. For nodes that are no longer visible, the system will generate a destruction event to release front-end resources and prevent excessive memory usage.
[0042] The core of the weight algorithm is to determine the loading order according to the visible area and importance of the nodes on the screen to ensure that the most important point cloud nodes are rendered first, providing a smooth and realistic user experience.
[0043] Preferably, the weight is calculated based on the visibility and importance of the node in the current perspective, and nodes with high priority will be loaded first.
[0044] Preferably, the backend traverses the octree structure data through multi-threading, and dynamically calculates the visibility and priority weight of the node in combination with the camera projection matrix passed in by the Web front end.
[0045] Preferably, an independent thread is responsible for gradually loading and parsing node data from the queue to ensure that important nodes are loaded first.
[0046] Preferably, each thread is responsible for the traversal operation of a subtree.
[0047] The backend uses multi-threaded traversal of the octree to ensure efficient node screening. Each thread is responsible for the traversal of a subtree, which can significantly reduce the processing time of the backend when screening visible nodes; at the same time, the node traversal process can be combined with the camera projection matrix passed in by the Web frontend to dynamically calculate the visibility and priority weight of the node, thereby ensuring real-time rendering while efficiently utilizing resources.
[0048] Preferably, the camera projection matrix includes viewing angle, position, and direction information.
[0049] After receiving this information, the backend will calculate the weight of each node in the octree. The weight is calculated based on the visibility and importance of the node in the current perspective. Nodes with high priority will be loaded first.
[0050] A Web-based octree-based point cloud visualization fusion scheduling system includes an octree structure data generation module, a camera projection matrix transmission module, a weight calculation module, a loading module, and a rendering module.
[0051] The octree structure data generation module, the user end first organizes the point cloud data into octree structure data, and stores it in the back end in the form of a file;
[0052] The camera projection matrix transmission module, the user end inputs the camera projection matrix to the front end, and transmits the camera projection matrix of the front end to the back end in real time through the WebSocket bidirectional data stream;
[0053] The weight calculation module calculates the weight of each node in the octree after receiving the camera projection matrix;
[0054] The loading module generates a loading queue based on the weight at the back end, sorts all nodes to be loaded by weight and adds them to the queue, and gradually loads and parses the node data from the queue;
[0055] The rendering module transmits the parsed node data to the front end in real time through the WebSocket bidirectional data flow, and the front end uses WebGL to render the received node data.
[0056] A computer device includes a processor, wherein the processor is used to execute a computer program stored in a memory to implement the above-mentioned Web-side octree-based point cloud visualization fusion scheduling method.
[0057] A computer-readable storage medium stores a computer program, and a processor is used to execute the computer program stored in the storage medium to implement the above-mentioned Web-side octree-based point cloud visualization fusion scheduling method.
[0058] The present invention proposes an octree-based point cloud scheduling algorithm, which manages point cloud data in layers through the octree, filters visible nodes under a multi-threaded scheduling framework implemented in the Go language, and efficiently transmits them to the Web front end for real-time rendering through the WebSocket protocol, thereby achieving efficient management of large-scale point cloud data in a Web environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a flow chart of a method for visualizing and fusion scheduling of point clouds based on an octree on a Web side of the present invention.
[0060] Figure 2 It is a fusion scheduling architecture block diagram of a Web-based octree-based point cloud visualization fusion scheduling method of the present invention.
[0061] Figure 3 It is a weight calculation flow chart of a point cloud visualization fusion scheduling method based on an octree on a Web side of the present invention.
[0062] Figure 4 It is a scheduling timing diagram of a Web-based octree-based point cloud visualization fusion scheduling method of the present invention.
[0063] Figure 5 It is a structural schematic diagram of a Web-based octree-based point cloud visualization fusion scheduling system of the present invention. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0065] The terms "first", "second", etc. in the claims and specification of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable under appropriate circumstances. This is merely a way of distinguishing objects with the same properties in the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, so that a process, method, system, product or apparatus that includes a series of units is not necessarily limited to those units, but may include other units not expressly listed or inherent to these processes, methods, products or apparatus.
[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs. The terms used in this article and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0067] like Figure 1 , 2 As shown in FIG. 4 , in a disclosed embodiment of the present invention, a method for visualizing and fusion scheduling of point clouds based on an octree on a Web side includes a front end and a back end:
[0068] The front end first organizes the point cloud data into octree structure data and stores it in the back end in the form of files;
[0069] The front-end inputs the camera projection matrix and transmits it to the back-end in real time through the WebSocket bidirectional data stream;
[0070] After receiving the camera projection matrix, the backend calculates the weight of each node in the octree;
[0071] The backend generates a loading queue based on the weight, sorts all nodes to be loaded by weight, adds them to the queue, and consumes them in an independent thread;
[0072] The backend transmits node data to the frontend in real time through the WebSocket bidirectional data stream, and the frontend uses WebGL to render the received node data.
[0073] The point cloud data is first organized into an octree structure and stored in the backend in the form of a file; the octree is a structure suitable for spatial data management, which divides the three-dimensional space into eight sub-nodes and constructs nodes of different levels according to the distribution of the point cloud data; the octree hierarchical structure can help the system quickly locate the point cloud data in a specific area.
[0074] At the transmission level, the backend transmits node data to the frontend in real time through WebSocket bidirectional data flow. WebSocket provides a low-latency, real-time communication channel that can avoid the latency and bandwidth overhead of traditional HTTP requests. The frontend uses WebGL to render the received point cloud data to achieve visualization effects.
[0075] WebSocket bidirectional communication allows the front-end and back-end to maintain real-time connection. The front-end can transmit the latest camera projection matrix back to the back-end at any time, and the back-end can also send data to the front-end in real time. This communication mechanism not only reduces data transmission latency, but also ensures the smoothness of interaction on the Web side, avoiding the performance bottleneck that may be caused by the traditional polling mode. The front-end WebGL rendering can quickly draw the received point cloud data, ensuring the user's real-time visualization experience.
[0076] In a disclosed embodiment of the present invention, the camera projection matrix includes viewing angle, position, and direction information.
[0077] After receiving this information, the backend calculates the weight of each node in the octree.
[0078] In a disclosed embodiment of the present invention, the backend traverses the octree structure data through multi-threading, and dynamically calculates the visibility and priority weight of the node in combination with the camera projection matrix passed in by the Web front end; each thread is responsible for the traversal operation of a subtree.
[0079] The backend uses multi-threading to traverse the octree data to ensure efficient node screening. Each thread is responsible for traversing a subtree, which can significantly reduce the processing time of the backend when screening visible nodes.
[0080] The node traversal process can combine the camera projection matrix passed in by the Web front end to dynamically calculate the visibility and priority weight of the node, thereby ensuring the real-time rendering while efficiently utilizing resources.
[0081] In a disclosed embodiment of the present invention, the weight is calculated based on the visibility and importance of the node in the current perspective, and nodes with high priority will be loaded first.
[0082] The core of the weight algorithm is to determine the loading order according to the visible area and importance of the nodes on the screen to ensure that the most important point cloud nodes are rendered first, providing a smooth and realistic user experience.
[0083] like Figure 3 As shown, in a disclosed embodiment of the present invention, calculating the weight of each node in the octree includes:
[0084] 1) Calculation of node bounding box
[0085] The 3D boundary of each node is represented as an axis-aligned bounding box (AABB), which is used to accurately define the range and position of the node in 3D space. The bounding box information can help quickly determine the relative position of the node in the view and provide basic geometric data for subsequent projection calculations.
[0086] 2) 2D projection of the bounding box to the screen
[0087] The backend maps the node bounding box from the three-dimensional space to the two-dimensional plane on the screen according to the current camera's projection matrix, generating the two-dimensional projection area of the node in the view. The projection matrix contains information such as the camera's viewing angle, position, and direction. These parameters combined with the node's three-dimensional coordinates can accurately calculate the visible area of the node in the current viewing angle. In this way, the system can quickly determine whether the node is in the field of view and its location.
[0088] 3) Calculation of screen pixel ratio
[0089] After completing the two-dimensional projection, the system calculates the pixel ratio of the node projection on the screen based on the screen's rendering resolution (including device pixel ratio) and the pixel size of the current page rendering. The larger the ratio, the more area the node occupies on the screen and the richer the details, so its importance (or weight) increases accordingly. This calculation process ensures that small nodes far away from the center of the view have low weights, while large and important nodes within the view are loaded first to optimize the rendering effect.
[0090] 4) Priority inside the 3D bounding box
[0091] If the current camera position is inside the 3D bounding box of the node, the node is very important in the view and its priority should be immediately raised to the highest level. This usually means that the user's perspective has penetrated deep into the node, so the system must ensure that the data of the node and its neighboring areas are fully loaded to ensure that the user can obtain a high-quality, non-delayed interactive experience. If the current camera position is inside the 3D bounding box of the node, the node is very important in the view and its priority should be immediately raised to the highest level.
[0092] By calculating the weight to determine the importance of the node, you can avoid loading irrelevant nodes, thereby saving network bandwidth and computing resources. The weight algorithm usually makes a comprehensive evaluation based on the distance, size and position of the node in the current perspective to ensure that the loaded nodes are the most needed parts of the current view. For nodes that are no longer visible, the system will generate a destruction event to release front-end resources and prevent excessive memory usage.
[0093] In a disclosed embodiment of the present invention, an independent thread is responsible for gradually loading and parsing node data from a queue to ensure that important nodes are loaded first.
[0094] The backend generates a loading queue based on the weight, sorts all nodes to be loaded by weight, adds them to the queue, and consumes them in an independent thread.
[0095] Independent threads are responsible for gradually loading and parsing node data from the queue to ensure that important nodes are loaded first. The consumer thread will send the parsed node data in real time in a stream manner, transmit the results to the front end through WebSocket, and send a destruction event when the node is no longer needed.
[0096] By creating a weight loading queue and using independent threads for consumption, the system can load node data in an orderly and efficient manner, thus avoiding resource contention and efficiency issues caused by single-threaded processing. In this way, background node loading will not block other operations, and users can interact smoothly and update the view in real time.
[0097] like Figure 5 As shown, in a disclosed embodiment of the present invention, a Web-based octree-based point cloud visualization fusion scheduling system includes an octree structure data generation module, a camera projection matrix transmission module, a weight calculation module, a loading module, and a rendering module.
[0098] The octree structure data generation module, the front end first organizes the point cloud data into octree structure data, and stores it in the form of a file at the back end;
[0099] The camera projection matrix transmission module inputs the camera projection matrix at the front end and transmits the camera projection matrix to the back end in real time through the WebSocket bidirectional data stream;
[0100] The weight calculation module calculates the weight of each node in the octree after receiving the camera projection matrix;
[0101] The loading module generates a loading queue based on the weight at the back end, sorts all nodes to be loaded by weight and adds them to the queue, and gradually loads and parses the node data from the queue;
[0102] The rendering module transmits the parsed node data to the front end in real time through the WebSocket bidirectional data flow, and the front end uses WebGL to render the received node data.
[0103] In a disclosed embodiment of the present invention, a computer device includes a processor, wherein the processor is used to execute a computer program stored in a memory to implement the above-mentioned Web-based octree-based point cloud visualization fusion scheduling method.
[0104] In a disclosed embodiment of the present invention, a computer-readable storage medium stores a computer program, and a processor is used to execute the computer program stored in the storage medium to implement the above-mentioned Web-based octree-based point cloud visualization fusion scheduling method.
[0105] The present invention proposes a data scheduling and transmission scheme based on octree, which makes it possible to realize efficient management and real-time rendering of large-scale point cloud data in a Web environment. The specific implementation steps include backend file storage, camera projection matrix transmission, multi-threaded octree traversal, weight-based node loading scheduling, and data transmission and rendering. This scheme effectively solves the problems of limited file access, low JavaScript execution efficiency, complex multi-threaded communication and low transmission performance.
[0106] 1: Octree backend file storage and multi-threaded traversal
[0107] In this patent solution, the point cloud data is first organized into an octree structure and stored in the backend in the form of a file. The octree is a structure suitable for spatial data management, which divides the three-dimensional space into eight child nodes and constructs nodes of different levels according to the distribution of the point cloud data.
[0108] The octree hierarchical structure can help the system quickly locate point cloud data in a specific area. The backend traverses the octree through multiple threads to ensure efficient node screening. Each thread is responsible for the traversal operation of a subtree, which can significantly reduce the processing time of the backend when screening visible nodes. At the same time, the node traversal process can be combined with the camera projection matrix passed in by the Web frontend to dynamically calculate the visibility and priority weight of the node, thereby ensuring real-time rendering while efficiently utilizing resources.
[0109] 2: Real-time transmission of camera projection matrix and node weight calculation
[0110] The camera projection matrix of the front-end is transmitted to the back-end in real time through the WebSocket bidirectional data stream. The camera projection matrix contains information such as viewing angle, position, and direction. After receiving this information, the back-end will calculate the weight of each node in the octree. The weight calculation is based on the visibility and importance of the node in the current viewing angle, and the nodes with high priority will be loaded first.
[0111] By calculating the weight to determine the importance of the node, you can avoid loading irrelevant nodes, thereby saving network bandwidth and computing resources. The weight algorithm usually makes a comprehensive evaluation based on the distance, size and position of the node in the current perspective to ensure that the loaded nodes are the most needed parts of the current view. For nodes that are no longer visible, the system will generate a destruction event to release front-end resources and prevent excessive memory usage.
[0112] The core of the weight algorithm is to determine the loading order based on the visible area and importance of the nodes on the screen to ensure that the most important point cloud nodes are rendered first, providing a smooth and realistic user experience. The specific implementation steps are as follows:
[0113] 1) Calculation of node bounding box
[0114] The 3D boundary of each node is represented as an axis-aligned bounding box (AABB), which is used to accurately define the range and position of the node in 3D space. The bounding box information can help quickly determine the relative position of the node in the view and provide basic geometric data for subsequent projection calculations.
[0115] 2) 2D projection of the bounding box to the screen
[0116] The backend maps the node bounding box from the three-dimensional space to the two-dimensional plane on the screen according to the current camera's projection matrix, generating the two-dimensional projection area of the node in the view. The projection matrix contains information such as the camera's viewing angle, position, and direction. These parameters combined with the node's three-dimensional coordinates can accurately calculate the visible area of the node in the current viewing angle. In this way, the system can quickly determine whether the node is in the field of view and its location.
[0117] 3) Calculation of screen pixel ratio
[0118] After completing the two-dimensional projection, the system calculates the pixel ratio of the node projection on the screen based on the screen's rendering resolution (including device pixel ratio) and the pixel size of the current page rendering. The larger the ratio, the more area the node occupies on the screen and the richer the details, so its importance (or weight) increases accordingly. This calculation process ensures that small nodes far away from the center of the view have low weights, while large and important nodes within the view are loaded first to optimize the rendering effect.
[0119] 4) Priority inside the 3D bounding box
[0120] If the current camera position is inside the 3D bounding box of a node, the node is very important in the view and its priority should be immediately raised to the highest level. This usually means that the user's perspective has penetrated deep into the node, so the system must ensure that the data of the node and its neighboring areas are fully loaded to ensure that the user can get a high-quality, non-delayed interactive experience.
[0121] 3: Weight loading queue and independent thread consumption
[0122] The backend generates a loading queue based on the weight, sorts all nodes to be loaded by weight, adds them to the queue, and consumes them in an independent thread. The independent thread is responsible for gradually loading and parsing node data from the queue to ensure that important nodes are loaded first. The consumer thread will send the data of the parsed nodes in real time in a streaming manner, transmit the results to the front end through WebSocket, and send a destruction event when the node is no longer needed.
[0123] By creating a weight loading queue and using independent threads for consumption, the system can load node data in an orderly and efficient manner, thus avoiding resource contention and efficiency issues caused by single-threaded processing. In this way, background node loading will not block other operations, and users can interact smoothly and update the view in real time.
[0124] Four: WebSocket bidirectional data flow and real-time rendering
[0125] At the transmission level, the backend transmits node data to the frontend in real time through WebSocket bidirectional data flow. WebSocket provides a low-latency, real-time communication channel that can avoid the latency and bandwidth overhead of traditional HTTP requests. The frontend uses WebGL to render the received point cloud data to achieve visualization effects.
[0126] WebSocket bidirectional communication allows the front-end and back-end to maintain real-time connection. The front-end can transmit the latest camera projection matrix back to the back-end at any time, and the back-end can also send data to the front-end in real time. This communication mechanism not only reduces data transmission latency, but also ensures the smoothness of interaction on the Web side, avoiding the performance bottleneck that may be caused by the traditional polling mode. The front-end WebGL rendering can quickly draw the received point cloud data, ensuring the user's real-time visualization experience.
[0127] Through the above scheme, this patent achieves the following significant technical effects:
[0128] 1. Efficient point cloud data management: Octree hierarchical storage and multi-threaded traversal ensure efficient scheduling of large-scale point cloud data, reduce unnecessary data transmission, and improve system response speed.
[0129] 2. Real-time node loading and priority control: The real-time transmission of the camera projection matrix and the weight-based node scheduling mechanism enable the system to adjust the data loading strategy according to the user's perspective and provide optimal data without affecting user interaction.
[0130] 3. Low communication delay and high transmission performance: Using WebSocket instead of traditional HTTP requests to establish real-time two-way data flow significantly reduces communication delay and improves data transmission efficiency between the front-end and back-end.
[0131] 4. Smooth user interaction experience: The front end achieves real-time rendering through WebGL, and users can achieve smooth interaction between perspective change and data loading. System resource utilization is more reasonable, and user experience is significantly improved.
[0132] Through this solution, this patent realizes an efficient visualization experience of point cloud data that is almost a local application in a Web environment, providing an efficient solution for the cross-platform expansion of three-dimensional visualization applications.
[0133] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A Web-based octree-based point cloud visualization fusion scheduling method, characterized in that: Including front-end and back-end: The front end first organizes the point cloud data into octree structure data and stores it in the back end in the form of files; The front-end inputs the camera projection matrix and transmits it to the back-end in real time through the WebSocket bidirectional data stream; After receiving the camera projection matrix, the backend calculates the weight of each node in the octree; The backend generates a loading queue based on the weight, sorts all nodes to be loaded by weight, adds them to the queue, and consumes them in an independent thread; The backend transmits node data to the frontend in real time through the WebSocket bidirectional data stream, and the frontend uses WebGL to render the received node data.
2. According to claim 1, the method for visualizing and fusion scheduling of point clouds based on octree on the Web side is characterized in that: The calculation of the weight of each node in the octree includes: The 3D boundary of each node is represented as an axis-aligned bounding box, which is used to accurately define the extent and position of the node in 3D space; The backend maps the node bounding box from the three-dimensional space to the two-dimensional plane on the screen according to the projection matrix of the current camera, and generates the two-dimensional projection area of the node in the view; After completing the two-dimensional projection, the system calculates the pixel ratio of the node projection on the screen based on the screen rendering resolution and the pixel size of the current page rendering; If the current camera position is inside the 3D bounding box of the node, the node is very important in the view and its priority is immediately raised to the highest.
3. The method for visualizing and fusion scheduling of point clouds based on octree on the Web side according to claim 2 is characterized in that: The weight is calculated based on the visibility and importance of the node in the current perspective, and nodes with higher priority will be loaded first.
4. The method for visualizing and fusion scheduling of point clouds based on octree on the Web side according to claim 1, characterized in that: The backend traverses the octree structure data through multi-threading, and combines it with the camera projection matrix passed in by the Web frontend to dynamically calculate the visibility and priority weight of the node.
5. The method for visualizing and fusion scheduling of point clouds based on octree on the Web side according to claim 1, characterized in that: Independent threads are responsible for gradually loading and parsing node data from the queue to ensure that important nodes are loaded first.
6. The method for visualizing and fusion scheduling of point clouds based on octree on the Web side according to claim 4, characterized in that: Each thread is responsible for traversing a subtree.
7. The method for visualizing and fusion scheduling of point clouds based on octree on the Web side according to claim 1, characterized in that: The camera projection matrix contains the viewing angle, position, and direction information.
8. A Web-based octree-based point cloud visualization fusion scheduling system, characterized in that: It includes octree structure data generation module, camera projection matrix transmission module, weight calculation module, loading module and rendering module. The octree structure data generation module, the front end first organizes the point cloud data into octree structure data, and stores it in the form of a file at the back end; The camera projection matrix transmission module inputs the camera projection matrix at the front end and transmits the camera projection matrix to the back end in real time through the WebSocket bidirectional data stream; The weight calculation module calculates the weight of each node in the octree after receiving the camera projection matrix; The loading module generates a loading queue based on the weight at the back end, sorts all nodes to be loaded by weight and adds them to the queue, and gradually loads and parses the node data from the queue; The rendering module transmits the parsed node data to the front end in real time through the WebSocket bidirectional data flow, and the front end uses WebGL to render the received node data.
9. A computer device, characterized in that: It includes a processor, which is used to execute a computer program stored in a memory to implement the Web-side octree-based point cloud visualization fusion scheduling method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The processor is used to execute the computer program stored in the storage medium to implement the octree-based point cloud visualization fusion scheduling method for the Web side as described in any one of claims 1 to 7.