Visibility analysis method, system and device for R3 algorithm and storage medium
By dividing elevation data into annular decomposition domains and predicting computational intensity, and combining them into balanced block groups, the load imbalance problem of the R3 algorithm in the GPU environment is solved, and efficient visualization analysis computation is achieved.
Patent Information
- Application Number
- CN202511638723.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-06
AI Technical Summary
The R3 algorithm suffers from computational efficiency bottlenecks in view analysis, especially in GPU environments where it struggles to fully utilize parallel computing capabilities. This is primarily due to the heterogeneity of computational tasks and the complexity of data dependencies, leading to load imbalance.
The original elevation data is divided into annular decomposition domains. The computational intensity is predicted by a computational intensity prediction model. The decomposition domains are then combined into blocks with balanced computational intensity and scheduled to run on streaming multiprocessors to execute the R3 algorithm, thus achieving parallel computing.
It significantly improves the computational efficiency of the R3 algorithm in visualization analysis scenarios, solves the load imbalance problem in GPU environments, and makes full use of the parallel computing capabilities of GPUs.
Smart Images

Figure CN121478869A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of geographic computing with high performance requirements, and particularly relates to a visibility analysis method, system and device for R3 algorithm and a storage medium. BACKGROUND
[0002] As the most representative classic algorithm in the field of viewshed analysis, R3 algorithm should have been widely used due to its high-precision advantage in theory. However, the algorithm has a significant bottleneck in computational efficiency, which leads most commercial GIS software and open-source algorithm libraries to choose higher-computational-efficiency but relatively lower-precision alternatives, such as R2 algorithm, XDraw and reference plane algorithm. With the continuous development of sensor technology, the precision of digital elevation model (DEM) is improving towards sub-meter level, and the error caused by the approximate algorithm with lower precision has become unacceptable, especially in the fields of disaster reduction and emergency and military operations with higher precision requirements.
[0003] In recent years, with the in-depth application of parallel computing technology in the field of geoscience computing, a series of parallelization researches have been carried out on the viewshed analysis algorithm in CPU and GPU environments. Among them, the CPU environment has weaker concurrency capability, but is suitable for processing complex logical tasks, while the GPU environment supports large-scale concurrent computing, but has smaller memory and is only suitable for simple computing tasks. It should be pointed out that, unlike R2 and other algorithms with natural parallel characteristics, R3 algorithm has two key technical challenges:
[0004] (1) The computing task has significant heterogeneity. The computing amount of different DEM grid points is significantly different, and the smaller the amount of calculation is, the earlier the line of sight appears to be blocked, and vice versa. However, existing coarse-grained parallel methods often ignore the problem of computing heterogeneity, which easily leads to load imbalance problem, thereby seriously restricting the parallel performance of the algorithm;
[0005] (2) There are complex dependency relationships between data. The visibility of each grid point needs to access the elevation of the grid point on the line of sight, and when the line of sight does not pass through the grid point, interpolation operation based on neighborhood data is also needed. How to transplant R3 to the GPU environment with limited memory and only suitable for simple computing tasks to fully exert the parallel computing capability of GPU is a problem to be solved at present. SUMMARY
[0006] The purpose of the present application is to overcome the deficiencies in the prior art, and provide a visibility analysis method, system, device and storage medium for R3 algorithm, which significantly improves the computational efficiency of R3 algorithm in the visibility analysis scene.
[0007] The present application provides the following technical solutions:
[0008] In a first aspect, a visibility analysis method for an R3 algorithm is provided, including: obtaining original height data including a plurality of grid points, dividing the original height data into a plurality of ring voxel decomposition domains according to a preset decomposition number, and establishing a position mapping relationship between grid point indexes in the ring voxel decomposition domains and the original height data;
[0009] calculating feature vectors and occupied memory spaces of each of the ring voxel decomposition domains, inputting the feature vectors into a pre-trained calculation intensity prediction model to obtain calculation intensities of the ring voxel decomposition domains;
[0010] combining the ring voxel decomposition domains according to the global memory space of the GPU end and the memory spaces occupied by the ring voxel decomposition domains to obtain a plurality of chunk groups, and combining the ring voxel decomposition domains in each chunk group according to the calculation intensities of the ring voxel decomposition domains to obtain a plurality of block groups with balanced calculation intensities;
[0011] sending the chunk groups one by one to the GPU end, scheduling target points to be subjected to visibility determination to stream multiprocessors on the GPU end according to the block groups, and executing the R3 algorithm by the stream multiprocessors to obtain a target point result array including visibility determination results and target point indexes;
[0012] obtaining the target point result array, and obtaining a final visibility determination result map according to the position mapping relationship between the grid point indexes in the ring voxel decomposition domains and the original height data.
[0013] As an optional technical solution of the present application, the obtaining of the original height data including a plurality of grid points, the division of the original height data into a plurality of ring voxel decomposition domains according to a preset decomposition number, and the establishment of a position mapping relationship between grid point indexes in the ring voxel decomposition domains and the original height data include:
[0014] dividing the original height data into four basic subdomains along the northwest, southwest, southeast and northeast directions with a viewpoint as the center;
[0015] extending the boundaries of the basic subdomains by one layer to obtain the ring voxel decomposition domains;
[0016] establishing a rectangular coordinate system with the viewpoint as the origin, determining the lower boundary of the ring voxel decomposition domains in the y direction, and confirming the number of grid points in each column of the ring voxel decomposition domains in the y direction;
[0017] obtaining the x and y coordinates of the grid points, determining the minimum value of the column in which the grid points are located according to the lower boundary of the ring voxel decomposition domains in the y direction and the x coordinates of the grid points;
[0018] determining the offset of the grid point in the y direction according to the y coordinate of the grid point and the minimum value of the column where the grid point is located;
[0019] obtaining the accumulated value of the number of grid points before the column where the grid point is located according to the x coordinate of the grid point and the number of grid points of each column in the y direction of the ring shot decomposition domain;
[0020] summing the offset of the grid point in the y direction and the accumulated value of the number of grid points before the column where the grid point is located to obtain the index of the grid point in the ring shot decomposition domain, and accessing the elevation data corresponding to the grid point through the index.
[0021] As an optional technical solution of the present application, the feature vector of each ring shot decomposition domain is calculated, and the feature vector is input into a pre-trained calculation intensity prediction model to obtain the calculation intensity of the ring shot decomposition domain, comprising:
[0022] The feature vector includes the number of grid points in the ring shot decomposition domain, the maximum value of the slope, the minimum value of the slope, the average value of the slope, the root mean square of the slope, the distance of the peak point of the slope, and the morphological structure index, wherein the slope represents the ratio of the elevation difference and the plane distance of the grid point and the viewpoint, the distance of the peak point of the slope represents the plane distance between the maximum value point of the slope and the viewpoint, and the morphological structure index represents the ratio of the length of the angle bisector and the opening angle radian of the ring shot decomposition domain.
[0023] The calculation intensity prediction model is a machine learning model generated according to the feature vector, and the time of executing the R3 algorithm of the ring shot decomposition domain on the GPU end is used as the sample label, and the machine learning model is constructed and trained by using a machine learning algorithm; wherein the machine learning algorithm includes a random forest regression algorithm, a gradient ascent regression algorithm and a decision tree regression algorithm.
[0024] As an optional technical solution of the present application, the memory space occupied by each ring shot decomposition domain, comprising:
[0025] The memory space occupied by the ring shot decomposition domain is obtained by summing the number of grid points in the ring shot decomposition domain, the number of target points to be determined in the ring shot decomposition domain, and the ring shot decomposition domain meta information;
[0026] The ring shot decomposition domain meta information includes the lower boundary in the y direction of the ring shot decomposition domain and the accumulated value of the number of grid points of each column in the y direction.
[0027] As an optional technical solution of the present application, the global memory space of the GPU end and the memory space occupied by each of the ring shot decomposition domains are acquired in advance, and the ring shot decomposition domains are combined to obtain a plurality of chunk groups; according to the calculation intensity of the ring shot decomposition domains, the ring shot decomposition domains in each chunk group are combined to obtain a plurality of block groups with balanced calculation intensity, including:
[0028] A first queue is constructed based on the memory space occupied by the ring shot decomposition domains, and the following operations are repeatedly performed until the first queue is empty:
[0029] S1.1, the ring shot decomposition domains are sequentially taken from the head of the first queue and accumulated one by one until the cumulative value of the memory space occupied by the ring shot decomposition domains after the next accumulation is greater than the global memory space of the GPU end, and the accumulated ring shot decomposition domains constitute a chunk group;
[0030] S1.2, after obtaining all the chunk groups, the number of block groups to be used for each chunk group is configured, the calculation intensity of the ring shot decomposition domains in each chunk group is summed, and then divided by the number of block groups to be used to obtain the average calculation intensity of the block;
[0031] A second queue is constructed based on the calculation intensity of the ring shot decomposition domains in each chunk group, and the following operations are repeatedly performed until the second queue is empty:
[0032] S2.1, the ring shot decomposition domains are sequentially taken from the head of the second queue and accumulated one by one until the cumulative value of the calculation intensity of the ring shot decomposition domains after the next accumulation is greater than the average calculation intensity of the block, and the accumulated ring shot decomposition domains constitute a block group.
[0033] As an optional technical solution of the present application, the R3 algorithm is executed by the stream multiprocessor to obtain a target point result array including visibility judgment results and target point indexes, including:
[0034] The following operations are repeatedly performed until all the target points in the block group are subjected to visibility judgment:
[0035] The stream multiprocessor calculates the target point index of the target point in the ring shot decomposition domain according to the position information of the target point in the original elevation data, in combination with the position mapping relationship between the grid point index in the ring shot decomposition domain and the original elevation data, and accesses the elevation data of the target point through the target point index;
[0036] Based on the elevation data of the target point, the stream multiprocessor executes the R3 algorithm to obtain the visibility judgment result of the target point.
[0037] As an optional technical solution of the present application, the target point result array is obtained, and according to the mapping relationship between the grid point index in the ring volume decomposition domain and the position of the original elevation data, a final visibility determination result map is obtained, including:
[0038] The cumulative value of the target point quantity in each column of the ring volume decomposition domain is confirmed, and by comparing the target point index and the cumulative value of the target point quantity in each column of the ring volume decomposition domain, a first offset of the target point from the viewpoint is obtained;
[0039] According to the first offset of the target point from the viewpoint, the x coordinate of the target point in the original elevation data is obtained;
[0040] According to the x coordinate of the target point in the original elevation data, the minimum value of the column where the target point is located is obtained;
[0041] According to the cumulative value of the target point quantity in each column of the ring volume decomposition domain, the cumulative value of the target point quantity before the column where the target point is located is obtained;
[0042] The target point index is subtracted by the cumulative value of the target point quantity before the column where the target point is located, to obtain a second offset of the target point in the y direction relative to the minimum value of the column where the target point is located, and the second offset is added to the minimum value of the column where the target point is located to obtain the y coordinate of the target point in the original elevation data;
[0043] After determining the position of the target point in the original elevation data, the visibility determination result of the target point is written into the result to be output, to obtain a final visibility determination result map.
[0044] In a second aspect, a visibility analysis system for R3 algorithm is provided, including: a decomposition domain division module, configured to obtain original elevation data including a plurality of grid points, divide the original elevation data into a plurality of ring volume decomposition domains according to a preset decomposition quantity, and establish a mapping relationship between a grid point index in the ring volume decomposition domain and a position of the original elevation data;
[0045] A calculation intensity prediction module is configured to calculate a feature vector and a memory space occupied by each ring volume decomposition domain, input the feature vector into a pre-trained calculation intensity prediction model, and obtain the calculation intensity of the ring volume decomposition domain;
[0046] A grouping module is configured to combine the ring volume decomposition domains to obtain a plurality of chunk groups according to a pre-obtained global memory space of a GPU end and the memory space occupied by each ring volume decomposition domain, and combine the ring volume decomposition domains in each chunk group to obtain a plurality of block groups with balanced calculation intensity according to the calculation intensity of the ring volume decomposition domain;
[0047] A visibility determination module is configured to send the chunk group to a GPU end one by one, to schedule the target points to be determined for visibility to each stream multiprocessor according to the block group by the GPU end, and to obtain a target point result array including the visibility determination result and the target point index by performing the R3 algorithm by the stream multiprocessor.
[0048] An output module is configured to obtain the target point result array, and to obtain a final visibility determination result map according to the position mapping relationship between the grid point index in the ring shot decomposition domain and the original elevation data.
[0049] In a third aspect, a visibility analysis device for the R3 algorithm is provided, including a processor and a storage medium.
[0050] The storage medium is configured to store instructions.
[0051] The processor is configured to operate according to the instructions to perform the steps of the visibility analysis method for the R3 algorithm.
[0052] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the program is executed by a processor to implement the steps of the visibility analysis method for the R3 algorithm.
[0053] Compared with the prior art, the present application has the following advantages:
[0054] The visibility analysis method for the R3 algorithm provided by the present application divides the original elevation data into independent ring shot decomposition domains, extracts the number, distribution and morphological feature characteristics of the ring shot decomposition domains, predicts the decomposition domain calculation intensity by using a calculation intensity prediction model, and then combines the ring shot decomposition domains into block groups with balanced calculation intensity and schedules the block groups to the stream multiprocessor for parallel execution, so as to improve the calculation efficiency of the visibility analysis calculation by using the R3 algorithm. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 is a flow chart of the visibility analysis method for the R3 algorithm in the embodiment of the present application;
[0056] Figure 2 is a ring shot decomposition and mapping strategy diagram in the embodiment of the present application, wherein (a) is a basic sub-domain diagram, and (b) is a grid point number cumulative value diagram in the y direction;
[0057] Figure 3 is a target point index and original elevation data position mapping diagram in the embodiment of the present application. DETAILED DESCRIPTION
[0058] The application will be further described below with reference to the drawings. The following examples are only used to more clearly illustrate the technical solutions of the application, and cannot be used to limit the protection scope of the application.
[0059] Example 1
[0060] This embodiment provides a visibility analysis method for R3 algorithm. In this embodiment, the method is executed by a CPU end. As shown in Figure 1 , the method comprises the following steps:
[0061] Step 1: Obtain original elevation data comprising a plurality of grid points, divide the original elevation data into a plurality of ring-tessellation decomposition domains according to a preset decomposition number, and establish a position mapping relationship between grid point indexes in the ring-tessellation decomposition domains and the original elevation data. Specifically:
[0062] Step 1.1, as shown in (a) of Figure 2 , divide the original elevation data into four basic sub-domains along the northwest, southwest, southeast and northeast directions with a viewpoint as the center.
[0063] Step 1.2, in order to avoid data dependence between the basic sub-domains, expand the boundaries of the basic sub-domains by one layer outward to obtain the ring-tessellation decomposition domains, as shown by the green areas in (a) of Figure 2 .
[0064] Step 1.3, establish a rectangular coordinate system with the viewpoint as the origin, determine the lower boundary of the ring-tessellation decomposition domain in the y direction, and confirm the number of grid points in each column of the ring-tessellation decomposition domain in the y direction.
[0065] Step 1.4, obtain the x coordinate and y coordinate of the grid point, determine the minimum value of the column where the grid point is located according to the lower boundary of the ring-tessellation decomposition domain in the y direction and the x coordinate of the grid point. As shown in (b), the red area is the lower boundary of the ring-tessellation decomposition domain in the y direction, taking the northwest-southwest decomposition domain as an example. Figure 2
[0066] Step 1.5, determine the offset of the grid point in the y direction according to the y coordinate of the grid point and the minimum value of the column where the grid point is located.
[0067] Step 1.6, obtain the cumulative value of the number of grid points before the column where the grid point is located according to the x coordinate of the grid point and the number of grid points in each column of the ring-tessellation decomposition domain in the y direction. As shown in (b), [0 5 12 21 30] is the cumulative value of the number of grid points in the y direction of the ring-tessellation decomposition domain. Figure 2
[0068] Step 1.7, sum the offset of the grid point in the y direction and the cumulative value of the number of grid points before the column where the grid point is located, to obtain the index of the grid point in the annular shot decomposition domain, and access the elevation data corresponding to the grid point through the index.
[0069] Step 2: Calculate the feature vector and the occupied memory space of each annular shot decomposition domain, and input the feature vector into the pre-trained calculation intensity prediction model to obtain the calculation intensity of the annular shot decomposition domain.
[0070] From the aspects of set number, spatial distribution and morphological structure, the characteristics affecting the calculation intensity of the annular shot decomposition domain in the R3 algorithm are analyzed. The feature vector includes the number of grid points in the annular shot decomposition domain, the maximum slope, the minimum slope, the average slope, the root mean square of the slope, the distance of the peak value point of the slope and the morphological structure index. The slope represents the ratio of the elevation difference and the plane distance between the grid point and the viewpoint, the distance of the peak value point of the slope represents the plane distance between the maximum slope point and the viewpoint, and the morphological structure index represents the ratio of the length of the angular bisector and the opening angle radian of the annular shot decomposition domain. The larger the morphological index is, the more likely it is to need to calculate more slope points.
[0071] The calculation intensity prediction model is generated according to the feature vector, and the time of executing the R3 algorithm on the GPU end is used as the sample label. The machine learning model is constructed and trained by using a machine learning algorithm. The machine learning algorithm includes a random forest regression algorithm, a gradient ascent regression algorithm and a decision tree regression algorithm.
[0072] The memory space occupied by the annular shot decomposition domain is obtained by summing the number of grid points in the annular shot decomposition domain, the number of target points in the annular shot decomposition domain to be determined for visibility and the annular shot decomposition domain meta information. The y direction lower boundary of the annular shot decomposition domain and the cumulative value of the number of grid points in each column in the y direction. The number of grid points in the annular shot decomposition domain is determined by the number of grid points and the elevation value storage type, and the amount of target point data in the annular shot decomposition domain to be determined for visibility is used to store the visibility determination result on the GPU end.
[0073] Step 3: According to the global memory space of the GPU end and the memory space occupied by each annular shot decomposition domain, the annular shot decomposition domains are combined to obtain a plurality of chunk groups; according to the calculation intensity of the annular shot decomposition domain, the annular shot decomposition domains in each chunk group are combined to obtain a plurality of block groups with balanced calculation intensity.
[0074] Step 3.1, a first queue is constructed based on the memory space occupied by the annular shot decomposition domain, and the following operations are repeatedly executed until the first queue is empty:
[0075] S1.1, sequentially take out the ring shot decomposition domain from the head of the first queue and accumulate one by one until the cumulative value of memory space occupation is greater than the global memory space of the GPU end after accumulating the ring shot decomposition domain again, and the accumulated ring shot decomposition domain constitutes a chunk group.
[0076] S1.2, after obtaining all the chunk groups, configure the number of block groups to be used (3-4 times the number of stream processors) for each chunk group, sum the calculation intensity of the ring shot decomposition domain in each chunk group, and divide by the number of block groups to be used to obtain the block average calculation intensity.
[0077] Step 3.2, based on the calculation intensity of the ring shot decomposition domain in each chunk group, a second queue is constructed, and the following operations are repeatedly performed until the second queue is empty:
[0078] S2.1, sequentially take out the ring shot decomposition domain from the head of the second queue and accumulate one by one until the cumulative value of the calculation intensity is greater than the block average calculation intensity after accumulating the ring shot decomposition domain again, and the accumulated ring shot decomposition domain constitutes a block group.
[0079] Step 4: send the chunk groups to the GPU end one by one, and schedule the target points to be determined for visibility to each stream processor on the GPU end according to the block group, and execute the R3 algorithm through the stream processor to obtain a target point result array including the visibility determination result and the target point index.
[0080] Step 4.1, according to the chunk group and the block group, allocate the GPU end memory, and sequentially send the data contained in the chunk group to the GPU end.
[0081] Step 4.2, after the GPU end receives the data, according to the block group, the target points are scheduled to each stream processor. Repeat the following operations until all target points in the block group are determined for visibility:
[0082] The stream processor calculates the target point index of the target point in the ring shot decomposition domain according to the position information of the target point in the original elevation data, in combination with the position mapping relationship between the grid point index in the ring shot decomposition domain and the original elevation data, and accesses the elevation data of the target point through the target point index;
[0083] Based on the elevation data of the target point, the stream processor executes the R3 algorithm to obtain the visibility determination result of the target point.
[0084] Step 5: Obtain the target point result array, and based on the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data, obtain the final visibility determination result map.
[0085] Step 5.1: Confirm the cumulative number of target points in each column of the ring-shaped decomposition domain. By comparing the target point index with the cumulative number of target points in each column of the ring-shaped decomposition domain, obtain the first offset of the target point from the viewpoint.
[0086] like Figure 3 As shown, the points connected by the black dashed lines are the target points to be determined for visibility, and the red area is the lower boundary of the target point in the y-direction. [0 1 2] is the offset of the target point from the viewpoint, which is obtained by subtracting 2 from the absolute value of the difference between the viewpoint x coordinate and the target point x coordinate. [0 4 10 18] is the cumulative value of the number of target points in each column.
[0087] Step 5.2: Obtain the x-coordinate of the target point in the original elevation data based on the first offset of the target point from the viewpoint.
[0088] Step 5.3: Obtain the minimum value of the column containing the target point based on the x-coordinate of the target point in the original elevation data.
[0089] Step 5.4: Based on the cumulative number of target points in each column of the annular decomposition domain, obtain the cumulative number of target points before the column containing the target point.
[0090] Step 5.5: Subtract the cumulative number of target points before the target point's column from the target point index to obtain the second offset of the target point in the y direction relative to the minimum value of the target point's column. Add the second offset to the minimum value of the target point's column to obtain the y coordinate of the target point in the original elevation data.
[0091] Step 5.6: After determining the position of the target point in the original elevation data, write the visibility determination result of the target point into the output result to obtain the final visibility determination result map.
[0092] Example 2
[0093] This embodiment provides a visibility analysis system for the R3 algorithm, including:
[0094] The decomposition domain partitioning module is used to acquire the original elevation data including several grid points, divide the original elevation data into several annular decomposition domains according to a preset decomposition number, and establish the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data.
[0095] The intensity prediction module is used to calculate the feature vectors and memory space occupied by each of the ring-shaped decomposition domains, and input the feature vectors into the pre-trained intensity prediction model to obtain the intensity of the ring-shaped decomposition domain.
[0096] The grouping module is used to combine the circumradius decomposition domains into several chunk groups based on the pre-acquired global memory space of the GPU and the memory space occupied by each circumradius decomposition domain; and to combine the circumradius decomposition domains in each chunk group into several block groups with balanced computational intensity based on the computational intensity of the circumradius decomposition domains.
[0097] The visibility determination module is used to send the chunk groups one by one to the GPU. The GPU schedules the target points to be determined for visibility determination to each stream multiprocessor according to the block group. The stream multiprocessor executes the R3 algorithm to obtain a target point result array including the visibility determination result and the target point index.
[0098] The output module is used to obtain the target point result array and, based on the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data, obtain the final visibility determination result map.
[0099] Example 3
[0100] This embodiment provides a visibility analysis device for the R3 algorithm, including a processor and a storage medium; the storage medium is used to store instructions; the processor is used to perform operations according to the instructions to execute the steps of the visibility analysis method for the R3 algorithm described in Embodiment 1.
[0101] Example 4
[0102] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the visibility analysis method for the R3 algorithm described in Embodiment 1.
[0103] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0107] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A visualization analysis method for the R3 algorithm, characterized in that, include: Obtain the original elevation data including several grid points, divide the original elevation data into several annular decomposition domains according to the preset decomposition number, and establish the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data. Calculate the feature vectors and memory space occupied by each of the ring-shaped decomposition domains, and input the feature vectors into a pre-trained computational intensity prediction model to obtain the computational intensity of the ring-shaped decomposition domain. Based on the pre-acquired global memory space of the GPU and the memory space occupied by each of the ring body decomposition domains, the ring body decomposition domains are combined to obtain several chunk groups; based on the computational intensity of the ring body decomposition domains, the ring body decomposition domains in each chunk group are combined to obtain several block groups with balanced computational intensity. The chunks are sent to the GPU one by one. The GPU schedules the target points to be assessed for visibility to each stream multiprocessor according to the block grouping. The stream multiprocessor executes the R3 algorithm to obtain a target point result array including the visibility assessment result and the target point index. Obtain the target point result array, and based on the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data, obtain the final visibility determination result map.
2. The visibility analysis method for the R3 algorithm according to claim 1, characterized in that, The process of acquiring raw elevation data including several grid points, dividing the raw elevation data into several annular decomposition domains according to a preset number of decompositions, and establishing a positional mapping relationship between the grid point indices in the annular decomposition domains and the raw elevation data includes: Centered on the viewpoint, the original elevation data is divided into four basic subdomains along the northwest, southwest, southeast, and northeast directions; The boundary of the basic subdomain is extended outward by one layer to obtain the annular decomposition domain; Establish a rectangular coordinate system with the viewpoint as the origin, determine the lower boundary of the annular volume decomposition domain in the y direction, and confirm the number of grid points in each column of the annular volume decomposition domain in the y direction; Obtain the x and y coordinates of the grid points, and determine the minimum value of the column where the grid point is located based on the lower boundary of the y-direction of the annular decomposition domain and the x coordinates of the grid points. The offset of the grid point in the y direction is determined based on the y coordinate of the grid point and the minimum value of its column. Based on the x-coordinate of the grid point and the number of grid points in each column of the annular body decomposition domain in the y-direction, the cumulative value of the number of grid points before the column containing the grid point is obtained; The offset of the grid point in the y-direction and the cumulative number of grid points preceding the column containing the grid point are summed to obtain the index of the grid point in the annular decomposition domain. The elevation data corresponding to the grid point is accessed through the index.
3. The visibility analysis method for the R3 algorithm according to claim 1, characterized in that, The calculation of the feature vectors of each ring-shaped volume decomposition domain and the input of the feature vectors into a pre-trained computational intensity prediction model to obtain the computational intensity of the ring-shaped volume decomposition domain includes: The feature vector includes the number of grid points in the circumradius decomposition domain, the maximum slope, the minimum slope, the average slope, the root mean square of the slope, the distance between the peak slope points, and the morphological structure index. The slope represents the ratio of the elevation difference between the grid point and the viewpoint to the planar distance. The distance between the peak slope points represents the planar distance between the point with the maximum slope and the viewpoint. The morphological structure index represents the ratio of the length of the angle bisector of the circumradius decomposition domain to the radian of the opening angle. The computational intensity prediction model is a machine learning model that is constructed and trained using machine learning algorithms, with sample data generated based on the feature vector and the time taken to execute the R3 algorithm on the GPU in the circumradius decomposition domain as the sample label; wherein the machine learning algorithms include random forest regression algorithm, gradient ascent regression algorithm and decision tree regression algorithm.
4. The visibility analysis method for the R3 algorithm according to claim 2, characterized in that, The calculation of the memory space occupied by each annular decomposition domain includes: The memory space occupied by the ring decomposition domain is obtained by summing the number of grid points in the ring decomposition domain, the number of target points to be visually determined in the ring decomposition domain, and the ring decomposition domain metadata. The meta-information of the annular body decomposition domain includes the lower boundary of the annular body decomposition domain in the y direction and the cumulative value of the number of grid points in each column in the y direction.
5. The visibility analysis method for the R3 algorithm according to claim 1, characterized in that, The process involves combining the circumradius decomposition domains into several chunk groups based on the pre-acquired global memory space of the GPU and the memory space occupied by each of the circumradius decomposition domains. Based on the computational intensity of the annular decomposition domain, the annular decomposition domains within each chunk group are combined to obtain several block groups with balanced computational intensity, including: A first queue is constructed based on the memory space occupied by the decomposition domain of the circumradius, and the following operation is repeated until the first queue is empty: S1.
1. Take out the ring body decomposition domains from the head of the first queue one by one and accumulate them until the accumulated memory space occupied after the ring body decomposition domains are accumulated is greater than the global memory space on the GPU. The accumulated ring body decomposition domains constitute a chunk group. S1.2 After obtaining all the chunk groups, configure the number of block groups to be used for each chunk group, sum the computational intensity of the annular decomposition domain in each chunk group, and divide it by the number of block groups to be used to obtain the average computational intensity of the block. A second queue is constructed based on the calculated intensity of the annular decomposition domain within each chunk group, and the following operation is repeated until the second queue is empty: S2.
1. Take out the ring body decomposition domains from the head of the second queue one by one and accumulate them until the accumulated intensity value of the ring body decomposition domains is greater than the average calculated intensity of the block. The accumulated ring body decomposition domains constitute a block group.
6. The visibility analysis method for the R3 algorithm according to claim 1, characterized in that, The step of executing the R3 algorithm via a streaming multiprocessor to obtain a target point result array, including visibility determination results and target point indices, includes: Repeat the following operation until all target points within the block group are deemed visible: The streaming multiprocessor calculates the target point index in the annular decomposition domain based on the position information of the target point in the original elevation data and the position mapping relationship between the grid point index in the annular decomposition domain and the original elevation data, and accesses the elevation data of the target point through the target point index. Based on the elevation data of the target point, the streaming multiprocessor executes the R3 algorithm to obtain the visibility determination result of the target point.
7. The visibility analysis method for the R3 algorithm according to claim 1, characterized in that, The acquisition of the target point result array, based on the positional mapping relationship between the grid point indices in the annular decomposition domain and the original elevation data, yields the final visibility determination result map, including: Confirm the cumulative number of target points in each column of the ring decomposition domain, and obtain the first offset of the target point from the viewpoint by comparing the target point index with the cumulative number of target points in each column of the ring decomposition domain. The x-coordinate of the target point in the original elevation data is obtained based on the first offset of the target point from the viewpoint. The minimum value of the column containing the target point is obtained based on the x-coordinate of the target point in the original elevation data; Based on the cumulative number of target points in each column of the annular decomposition domain, the cumulative number of target points before the column containing the target point is obtained; Subtract the cumulative number of target points before the target point's column from the target point index to obtain the second offset of the target point in the y direction relative to the minimum value of the target point's column. Add the second offset to the minimum value of the target point's column to obtain the y coordinate of the target point in the original elevation data. After determining the location of the target point in the original elevation data, the visibility determination result of the target point is written into the output result to obtain the final visibility determination result map.
8. A visualization analysis system for the R3 algorithm, characterized in that, include: The decomposition domain partitioning module is used to acquire the original elevation data including several grid points, divide the original elevation data into several annular decomposition domains according to a preset decomposition number, and establish the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data. The intensity prediction module is used to calculate the feature vectors and memory space occupied by each of the ring-shaped decomposition domains, and input the feature vectors into the pre-trained intensity prediction model to obtain the intensity of the ring-shaped decomposition domain. The grouping module is used to combine the circumradius decomposition domains into several chunk groups based on the pre-acquired global memory space of the GPU and the memory space occupied by each circumradius decomposition domain; and to combine the circumradius decomposition domains in each chunk group into several block groups with balanced computational intensity based on the computational intensity of the circumradius decomposition domains. The visibility determination module is used to send the chunk groups one by one to the GPU. The GPU schedules the target points to be determined for visibility determination to each stream multiprocessor according to the block group. The stream multiprocessor executes the R3 algorithm to obtain a target point result array including the visibility determination result and the target point index. The output module is used to obtain the target point result array and, based on the positional mapping relationship between the grid point index in the annular decomposition domain and the original elevation data, obtain the final visibility determination result map.
9. A visualization analysis device for the R3 algorithm, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the visibility analysis method for the R3 algorithm as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the visibility analysis method for the R3 algorithm as described in any one of claims 1 to 7.