A multi-threaded rendering method and system for electronic charting
By using multi-threaded rendering methods and thread pool configuration strategies, nautical charts are dynamically segmented and rendered in parallel, solving the stuttering and latency issues caused by large-size nautical charts in traditional rendering methods, thus improving rendering efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU COSCO SHIPPING HAINING TECH CO LTD
- Filing Date
- 2026-02-03
- Publication Date
- 2026-06-05
AI Technical Summary
Traditional electronic chart systems are prone to stuttering and scaling delays when rendering large-size charts on low-performance devices, resulting in a degraded user experience.
A multi-threaded rendering method is adopted, which dynamically segments the nautical chart through a quadtree space partitioning algorithm and combines it with a thread pool configuration strategy to achieve multi-threaded parallel off-screen rendering of the nautical chart. After the rendering results are stitched together, they are synchronized to the screen in a preset order.
It improves rendering load balancing, increases processing efficiency in complex areas, reduces user interaction response latency, and improves resource utilization and rendering speed.
Smart Images

Figure CN122156437A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of electronic chart drawing, specifically relating to a multi-threaded rendering method and system for electronic chart drawing. Background Technology
[0002] Electronic Chart Systems (ECDIS) are a core tool for ship navigation, but traditional vector charts such as S57 generate massive amounts of data. This data is particularly problematic when rendered on low-performance devices (such as older shipboard equipment), leading to issues like stuttering and scaling delays. This is because single-threaded rendering of large-size charts is too time-consuming, resulting in a degraded user experience.
[0003] Therefore, improvements are needed. Summary of the Invention
[0004] To address the technical problem of excessively long rendering times for large-size nautical charts, this application provides a multi-threaded rendering method and system for electronic nautical chart production.
[0005] The first objective of this invention is achieved through the following technical solution:
[0006] A multi-threaded rendering method for electronic nautical chart plotting includes:
[0007] When several original nautical charts ordered according to a preset drawing order are received, based on a preset requirement threshold, it is determined whether each original nautical chart needs to be segmented and added to the rendering queue.
[0008] Based on the preset thread pool configuration strategy, thread resources are dynamically allocated from the thread pool to perform multi-threaded parallel off-screen rendering on the undivided nautical charts and the divided sub-charts in the rendering queue.
[0009] Once all the off-screen rendering of the nautical charts is complete, the rendering results are stitched together to form a complete nautical chart, and then synchronized to the screen display according to the preset drawing order.
[0010] In a preferred embodiment, the step of determining whether each original nautical chart needs to be segmented and added to the rendering queue based on a preset demand threshold when receiving a plurality of original nautical charts sorted according to a preset drawing order includes:
[0011] When the amount of data in the original nautical chart exceeds a preset threshold, the following operations are performed:
[0012] Based on the quadtree space partitioning algorithm, the original nautical chart is recursively divided into several nautical charts;
[0013] When the number of geographic features per unit area of a nautical chart exceeds a first preset threshold, the nautical chart is identified as a dense area.
[0014] When the number of geographic features per unit area of a nautical chart is less than or equal to a first preset threshold, the nautical chart is judged as a simple area.
[0015] Furthermore, the nautical chart is divided into several sub-charts;
[0016] Based on a preset refined segmentation strategy, the dense region is recursively divided into several preset sub-maps with the smallest segmentation granularity.
[0017] Based on a preset large-size segmentation strategy, the simple region is directly divided into several sub-charts with preset maximum segmentation sizes;
[0018] Output the segmented sub-charts and insert them into the rendering queue according to the preset drawing order;
[0019] Task metadata is attached to each segmented sub-map, and the task metadata includes the pixel area of the sub-map. Sub-chart element complexity .
[0020] In a preferred embodiment, the step of determining whether each of the original nautical charts needs to be segmented and added to the rendering queue based on a preset demand threshold when receiving a plurality of original nautical charts sorted according to a preset drawing order further includes:
[0021] When the amount of data in the original nautical chart is less than or equal to the preset requirement threshold, there is no need to split it, and initial task metadata is bound to each unsegmented original nautical chart.
[0022] The initial task metadata includes the original nautical chart pixel area. Complexity of original nautical chart elements ;
[0023] The original, undivided nautical charts are inserted into the rendering queue according to the preset drawing order and marked as undivided.
[0024] In a preferred embodiment, the step of dynamically allocating thread resources from the thread pool based on a preset thread pool configuration strategy, and performing multi-threaded parallel off-screen rendering on the undivided original nautical chart and the divided sub-charts in the rendering task queue, includes:
[0025] For each rendering task in the rendering queue, the rendering task includes the original undisturbed nautical chart and the segmented sub-charts, based on a preset formula. Calculate rendering weights ;
[0026] in, For the maximum pixel area of all rendering tasks, The maximum element complexity for all rendering tasks and For preset coefficients and ;
[0027] Based on preset formula Calculate task priority ;
[0028] in, and For preset coefficients, The task dependency depth represents the level of the sub-chart in the recursive partitioning, where the original chart is... Sub-chart after initial segmentation And so on;
[0029] All rendering tasks are prioritized. Arrange the rendering tasks in descending order and output a new rendering queue. For rendering tasks with the same priority, sort them according to the preset drawing order.
[0030] When a new sub-chart is added to the rendering queue, the task priority of the new sub-chart is immediately recalculated, and the new rendering queue order is dynamically adjusted.
[0031] In a preferred embodiment, the step of dynamically allocating thread resources from the thread pool based on a preset thread pool configuration strategy to perform multi-threaded parallel off-screen rendering of the undivided nautical charts and the divided sub-charts in the rendering task queue further includes:
[0032] The thread pool includes a core thread group, an elastic thread group, and a dedicated rendering thread group;
[0033] For the new rendering queue, the preset thread pool configuration strategy includes:
[0034] when , When the first threshold is preset, the rendering task is judged as a large-area rendering task, a preset number of consecutive physical cores are allocated from the core thread group, and a pre-stored dedicated texture cache is configured to the rendering task.
[0035] when , When the second threshold is preset, the rendering task is judged as a complex feature rendering task, a preset number of logical threads are allocated from the elastic thread group, and a pre-stored dedicated texture cache is configured to the rendering task.
[0036] when When a rendering task is identified as a simple feature rendering task, a number of pre-defined logical threads are allocated from the elastic thread group, and a pre-stored shared cache pool is configured to the rendering task.
[0037] when When a rendering task is identified as an urgent rendering task, several high-priority threads are directly allocated from the dedicated rendering thread group, and a pre-stored low-latency cache is configured for the rendering task.
[0038] In a preferred embodiment, the step of stitching the rendering results into a complete nautical chart and synchronizing it to the screen display according to a preset drawing order after completing the off-screen rendering of all nautical charts and sub-charts includes:
[0039] After all rendering tasks have completed off-screen rendering, they are classified into three-level queues according to the type of rendering task. The three-level queues include the main queue, the space queue, and the emergency queue.
[0040] When the rendering task is an undivided original nautical chart or a sub-chart without spatial dependencies, it is classified into the main queue, and the rendering task is synchronized from the off-screen cache to the screen in a preset drawing order.
[0041] When the rendering task is a segmented sub-map and there are adjacent dependencies, it is classified into the spatial queue, the spatial adjacency of the sub-map is detected, and a dependency chain with adjacent sub-maps is constructed for each sub-map. The sub-maps in the dependency chain are synchronized from the off-screen cache to the screen in spatial order.
[0042] When the rendering task is marked as triggered by user interaction, it is categorized into the emergency queue.
[0043] Preemptive insertion at the head of the rendering queue immediately interrupts the current synchronization process, prioritizing the synchronization of the rendering task to the visible area of the screen.
[0044] In a preferred embodiment, the step of stitching the rendering results into a complete nautical chart and synchronizing it to the screen display according to a preset drawing order after completing the off-screen rendering of all nautical charts and sub-charts further includes:
[0045] In the spatial queue, a graph traversal algorithm is used to detect whether a circular dependency chain exists;
[0046] When a circular dependency chain is detected, the dependency chain is automatically broken, and the rendering tasks are synchronized from the off-screen cache to the screen in a preset drawing order.
[0047] If an abnormal rendering result is detected during synchronization, the following actions are triggered:
[0048] Reread the task metadata from the off-screen cache;
[0049] If rereading the task metadata fails, the rendering task is reinserted into the rendering queue and marked as the highest priority. .
[0050] The second objective of this invention is achieved through the following technical solution:
[0051] A multi-threaded rendering system for electronic nautical chart plotting includes:
[0052] First module: When receiving several original nautical charts sorted according to a preset drawing order, based on a preset requirement threshold, determine whether each original nautical chart needs to be segmented and add it to the rendering queue.
[0053] The second module: Based on the preset thread pool configuration strategy, thread resources are dynamically allocated from the thread pool to perform multi-threaded parallel off-screen rendering on the undivided original nautical chart and the divided sub-charts in the rendering queue.
[0054] The third module: When all nautical charts and sub-charts have been rendered off-screen, the rendering results are stitched together into a complete nautical chart and synchronized to the screen display according to the preset drawing order.
[0055] The third objective of this invention is achieved through the following technical solution:
[0056] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the multi-threaded rendering method for electronic chart drawing described above.
[0057] The fourth objective of this invention is achieved through the following technical solution:
[0058] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described multi-threaded rendering method for electronic chart drawing.
[0059] In summary, this application includes at least one of the following beneficial technical effects:
[0060] The system first performs automated preprocessing on the received raw nautical charts. It dynamically determines whether the charts need to be segmented based on preset thresholds, improving load balancing for subsequent rendering and increasing efficiency in handling complex areas. Then, based on a preset thread pool configuration strategy, the system intelligently allocates computing resources from multiple thread pools, improving resource utilization for multi-threaded parallel rendering, accelerating the processing of complex tasks, and reducing user interaction response latency. Finally, after off-screen rendering is completed, precise delivery is achieved. Attached Figure Description
[0061] Figure 1 This is a flowchart of an implementation embodiment of a multi-threaded rendering method for electronic chart drawing according to this application;
[0062] Figure 2This is a schematic diagram of all sub-charts in step S10 of an embodiment of a multi-threaded rendering method for electronic chart drawing in this application;
[0063] Figure 3 This is a flowchart of multi-threaded nautical chart drawing steps S20-S30 in an embodiment of a multi-threaded rendering method for electronic nautical chart drawing in this application;
[0064] Figure 4 This is a schematic block diagram of a computer device according to this application. Detailed Implementation
[0065] The following is in conjunction with the appendix Figure 1-4 This application will be described in further detail.
[0066] In one embodiment, such as Figure 1 As shown, this application discloses a multi-threaded rendering method for electronic nautical chart plotting, which specifically includes the following steps:
[0067] S10: When receiving several original nautical charts sorted according to a preset drawing order, based on a preset requirement threshold, determine whether each original nautical chart needs to be segmented and add it to the rendering queue.
[0068] S20: Based on the preset thread pool configuration strategy, dynamically allocate thread resources from the thread pool to perform multi-threaded parallel off-screen rendering on the undivided original nautical chart and the divided sub-charts in the rendering queue.
[0069] S30: When all nautical charts and sub-charts have been rendered off-screen, the rendering results are stitched together into a complete nautical chart and synchronized to the screen display according to the preset drawing order.
[0070] In this embodiment, the system first performs automated preprocessing on the received raw nautical chart. It dynamically determines whether the chart needs to be segmented based on a preset threshold, improving the load balancing of subsequent rendering and increasing the efficiency of handling complex areas. Then, based on a preset thread pool configuration strategy, the system intelligently allocates computing resources from multiple thread pools, improving resource utilization for multi-threaded parallel rendering, accelerating the processing speed of complex tasks, and reducing user interaction response latency. Finally, after completing off-screen rendering, precise delivery is achieved.
[0071] like Figure 2 As shown, step S10 includes:
[0072] S101: When the amount of data in the original nautical chart exceeds a preset requirement threshold, perform the following operation:
[0073] S102: Based on the quadtree space partitioning algorithm, the original nautical chart is recursively divided into several nautical charts;
[0074] S103: When the number of geographic elements per unit area of a nautical chart exceeds a first preset threshold, the nautical chart is identified as a dense area.
[0075] S104: When the number of geographic elements per unit area of a nautical chart is less than or equal to a first preset threshold, the nautical chart is judged as a simple area;
[0076] S105: Further, the nautical chart is divided into several sub-charts;
[0077] S106: Based on a preset refined segmentation strategy, the dense region is recursively divided into several preset sub-maps with the smallest segmentation granularity.
[0078] S107: Based on a preset large-size segmentation strategy, the simple region is directly divided into several preset sub-charts with the largest segmentation size;
[0079] S108: Output the segmented sub-charts and insert them into the rendering queue according to the preset drawing order;
[0080] S109: Bind task metadata to each segmented sub-chart, the task metadata including the sub-chart pixel area. Sub-chart element complexity .
[0081] In this embodiment, a balanced rendering load is achieved through intelligent region analysis and a dynamic block-splitting strategy. The core principle is as follows: when the amount of original nautical chart data exceeds a preset threshold, the system first employs a recursive spatial partitioning strategy, dividing the nautical chart into dense and simple regions based on the density of geographic features. For densely populated regions, the system uses multi-level recursive subdivision until the smallest block granularity is reached, effectively distributing the rendering pressure of complex features. For sparsely populated regions, a large-size block strategy is used to reduce task fragmentation. During the partitioning process, the system binds metadata containing pixel area and feature complexity to each sub-chart, providing a quantitative basis for subsequent scheduling decisions. Finally, the partitioned sub-charts are inserted into the rendering queue according to a preset drawing order, while original nautical charts that have not reached the partitioning threshold are directly enqueued in their complete form. This mechanism improves the distribution of rendering pressure in complex regions, effectively reduces memory usage in simple regions, and, through metadata-driven queue management, lays a load-balanced foundation for subsequent multi-threaded rendering.
[0082] Step S10 also includes:
[0083] SA1: When the amount of data in the original nautical chart is less than or equal to the preset requirement threshold, there is no need to split it. Instead, initial task metadata is bound to each unsegmented original nautical chart.
[0084] SA2: The initial mission metadata includes the original nautical chart pixel area. Complexity of original nautical chart elements ;
[0085] SA3: Insert the undivided original nautical chart into the rendering queue according to the preset drawing order and mark it as undivided.
[0086] In this embodiment, for original nautical charts whose data volume does not reach the segmentation threshold, the system employs a lightweight processing mechanism to optimize resource utilization. When the system detects that the original nautical chart data volume is less than or equal to a preset requirement threshold, it directly preserves the complete chart form, avoiding unnecessary segmentation operations. At this time, the system binds initial task metadata to each original nautical chart, including its original pixel area and geographic feature complexity information, providing basic parameters for subsequent scheduling. These unsegmented charts are directly inserted into the rendering queue according to a preset drawing order and marked as unsegmented to distinguish them from processed tasks. This strategy effectively avoids task fragmentation caused by excessive segmentation by reducing the preprocessing overhead of simple tasks, while preserving the context information of the complete nautical chart, providing a more efficient scheduling unit for subsequent multi-threaded rendering.
[0087] like Figure 3 As shown, step S20 includes:
[0088] S201: For each rendering task in the rendering queue, the rendering task includes the original nautical chart without segmentation and the segmented sub-charts, based on a preset formula... Calculate rendering weights ;
[0089] S202: Wherein, For the maximum pixel area of all rendering tasks, The maximum element complexity for all rendering tasks and For preset coefficients and ;
[0090] S203: Based on preset formula Calculate task priority ;
[0091] S204: Wherein, and For preset coefficients, The task dependency depth represents the level of the sub-chart in the recursive partitioning, where the original chart is... Sub-chart after initial segmentation And so on;
[0092] S205: Prioritize all rendering tasks. Arrange the rendering tasks in descending order and output a new rendering queue. For rendering tasks with the same priority, sort them according to the preset drawing order.
[0093] S206: When a new sub-chart is added to the rendering queue, the task priority of the new sub-chart is immediately recalculated, and the new rendering queue order is dynamically adjusted.
[0094] In this embodiment, efficient allocation of rendering resources is achieved through multi-dimensional weight evaluation and real-time queue adjustment. The core principle is that the system dynamically calculates the priority of each task in the rendering queue (including complete nautical charts and segmented sub-charts), comprehensively considering task size, content complexity, and hierarchical dependencies. By constructing an evaluation model that includes pixel area ratio, element density, and task dependency depth, the system can quantitatively distinguish between critical and non-critical rendering tasks. During the queue sorting phase, high-priority tasks (such as large, complex areas or root node tasks) are placed first, while tasks of the same priority maintain their original rendering order to ensure spatial continuity. When a new sub-chart is added to the queue, the system immediately triggers priority recalculation and adjusts the queue order to ensure that urgent or dependent tasks can quickly rise to the top.
[0095] like Figure 3 As shown, step S20 also includes:
[0096] SB1: The thread pool includes a core thread group, an elastic thread group, and a dedicated rendering thread group;
[0097] SB2: For the new rendering queue, the preset thread pool configuration strategy includes:
[0098] SB3: When , When the first threshold is preset, the rendering task is judged as a large-area rendering task, a preset number of consecutive physical cores are allocated from the core thread group, and a pre-stored dedicated texture cache is configured to the rendering task.
[0099] SB4: When , When the second threshold is preset, the rendering task is judged as a complex feature rendering task, a preset number of logical threads are allocated from the elastic thread group, and a pre-stored dedicated texture cache is configured to the rendering task.
[0100] SB5: When When a rendering task is identified as a simple feature rendering task, a number of pre-defined logical threads are allocated from the elastic thread group, and a pre-stored shared cache pool is configured to the rendering task.
[0101] SB6: When When a rendering task is identified as an urgent rendering task, several high-priority threads are directly allocated from the dedicated rendering thread group, and a pre-stored low-latency cache is configured for the rendering task.
[0102] In this embodiment, a heterogeneous resource pool and task feature matching mechanism are used to achieve coordinated optimization of rendering performance and resource utilization. The core principle is that the system divides computing resources into a core thread group for basic performance assurance, a dynamically scalable logical thread group, and a dedicated rendering thread group for high-priority response. For different task types, the system adopts a differentiated resource configuration strategy: for large-area rendering tasks, continuous physical cores are allocated and bound to dedicated texture caches to maximize memory bandwidth utilization; for complex feature rendering tasks, logical threads are scheduled and feature-specific caches are configured to accelerate geometry processing; for simple feature tasks, a shared cache pool is reused to reduce memory consumption; for urgent rendering tasks (such as those triggered by user interaction), dedicated rendering threads are directly preempted and low-latency cache channels are enabled. This strategy improves the execution efficiency of computationally intensive tasks through physical core binding, dynamically scales logical threads to adapt to different complexity loads, and avoids resource contention between tasks through dedicated configuration of cache resources.
[0103] like Figure 3 As shown, step S30 includes:
[0104] S301: After all rendering tasks have completed off-screen rendering, they are classified into three-level queues according to the type of rendering task. The three-level queues include the main queue, the space queue, and the emergency queue.
[0105] S302: When the rendering task is an undivided original nautical chart or a sub-chart without spatial dependencies, it is classified into the main queue, and the rendering task is synchronized from the off-screen cache to the screen in sequence according to the preset drawing order.
[0106] S303: When the rendering task is a segmented sub-map and there are adjacent dependencies, it is classified into the spatial queue, the spatial adjacency of the sub-map is detected, and a dependency chain with adjacent sub-maps is constructed for each sub-map, wherein the sub-maps in the dependency chain are synchronized from the off-screen cache to the screen in spatial order.
[0107] S304: When the rendering task is marked as triggered by user interaction, it is classified into the emergency queue, preemptively inserted into the head of the rendering queue, the current synchronization process is immediately interrupted, and the rendering task is synchronized to the visible area of the screen first.
[0108] In this embodiment, a three-level queue collaboration mechanism is used to achieve precise delivery of rendering output and real-time assurance of user experience. Its core principle is as follows: after all off-screen rendering tasks are completed, the system intelligently classifies and processes them according to task attributes. For complete nautical charts or independent sub-charts without spatial dependencies, the system assigns them to the main queue and strictly follows the preset drawing order to deliver the rendering results, ensuring the spatial continuity of the base layer. For segmented nautical charts with adjacent dependencies, the system constructs a topological dependency chain through a spatial queue, forcing result synchronization according to spatial adjacency order to avoid visual tearing caused by rendering timing errors. For urgent tasks triggered by user interaction, the system directly activates the preemption mechanism of the emergency queue, interrupting the synchronization process of non-critical tasks and prioritizing the delivery of rendering results from the interactive area to the visible screen area. This mechanism achieves differentiated processing for three types of scenarios through a queue diversion strategy: the rendering of the base layer maintains strict sequential consistency, spatially dependent tasks ensure rendering integrity through dependency chain resolution, and interactive operation responses achieve sub-second feedback through queue preemption.
[0109] like Figure 3 As shown, step S30 also includes:
[0110] S305: In a spatial queue, detect the existence of circular dependency chains based on a graph traversal algorithm;
[0111] S306: When a circular dependency chain is detected, the dependency chain is automatically removed, and the rendering tasks are sequentially synchronized from the off-screen cache to the screen according to the preset drawing order;
[0112] S307: When an abnormal rendering result is detected during synchronization, the following operation is triggered:
[0113] S308: Reread task metadata from off-screen cache;
[0114] S309: If rereading the task metadata fails, reinsert the rendering task into the rendering queue and mark it as the highest priority. .
[0115] In this embodiment, the spatial queue ensures the rendering integrity of complex segmented regions through dependency chain resolution and anomaly tolerance mechanisms. Its core principle lies in using a graph traversal algorithm to perform deep detection of the topological relationships of the segmented sea map. When a circular dependency structure is identified, the circular link is forcibly removed and degenerated into a linear synchronization order, effectively avoiding the risk of rendering deadlock caused by dependency loops and ensuring that all segments can complete the result delivery according to the preset rendering order. At the anomaly handling level, when an anomaly in the rendering result is detected during synchronization, the system immediately triggers a rollback mechanism, attempting to reload task metadata from the off-screen cache to restore the rendering context. If metadata reading fails, the abnormal task is marked as the highest priority and re-injected into the rendering queue, ensuring data integrity through a preemptive re-rendering process. This mechanism improves the efficiency of circular dependency resolution in the spatial queue, reduces the error rate of rendering results in complex segmented regions, and shortens the average recovery time of abnormal tasks. While ensuring the continuity of the rendering process, it significantly enhances the system's fault tolerance capability for unexpected errors, constructing a spatial synchronization system that combines robustness and adaptability.
[0116] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0117] In one embodiment, a multi-threaded rendering system for electronic nautical chart plotting is provided, which corresponds to the multi-threaded rendering method for electronic nautical chart plotting described in the above embodiment. The multi-threaded rendering system for electronic nautical chart plotting includes:
[0118] First module: When receiving several original nautical charts sorted according to a preset drawing order, based on a preset requirement threshold, determine whether each original nautical chart needs to be segmented and add it to the rendering queue.
[0119] The second module: Based on the preset thread pool configuration strategy, thread resources are dynamically allocated from the thread pool to perform multi-threaded parallel off-screen rendering on the undivided original nautical chart and the divided sub-charts in the rendering queue.
[0120] The third module: When all nautical charts and sub-charts have been rendered off-screen, the rendering results are stitched together into a complete nautical chart and synchronized to the screen display according to the preset drawing order.
[0121] Optional, also includes:
[0122] Module 4: When the amount of data in the original nautical chart exceeds a preset threshold, perform the following operations:
[0123] Module 5: Based on the quadtree space partitioning algorithm, the original nautical chart is recursively divided into several nautical charts;
[0124] Module 6: When the number of geographic features per unit area on a nautical chart exceeds a first preset threshold, the nautical chart is identified as a dense area.
[0125] Module 7: When the number of geographic features per unit area of a nautical chart is less than or equal to a first preset threshold, the nautical chart is judged as a simple area;
[0126] Module 8: Further, the nautical chart is divided into several sub-charts;
[0127] Module 9: Based on a preset refined segmentation strategy, the dense region is recursively divided into several preset sub-maps with the smallest segmentation granularity.
[0128] Module 10: Based on a preset large-size segmentation strategy, the simple region is directly divided into several sub-charts with preset maximum segmentation sizes;
[0129] Module 11: Outputs the segmented sub-charts and inserts them into the rendering queue according to the preset drawing order;
[0130] Module 12: This module binds task metadata to each segmented sub-chart, including the sub-chart pixel area. Sub-chart element complexity .
[0131] Optional, also includes:
[0132] Module 13: When the amount of data in the original nautical chart is less than or equal to the preset requirement threshold, there is no need to split it; instead, initial task metadata is bound to each unsegmented original nautical chart.
[0133] Module 14: The initial task metadata includes the original nautical chart pixel area. Complexity of original nautical chart elements ;
[0134] Module 15: Inserts the undivided original nautical charts into the rendering queue according to the preset drawing order and marks them as undivided.
[0135] Optional, also includes:
[0136] Module 16: For each rendering task in the rendering queue, the rendering task includes the original nautical chart without segmentation and the segmented sub-charts, based on a preset formula. Calculate rendering weights ;
[0137] Seventeen modules: Among them, For the maximum pixel area of all rendering tasks, The maximum element complexity for all rendering tasks and For preset coefficients and ;
[0138] Eighteen modules: based on preset formulas Calculate task priority ;
[0139] Nineteen modules: Among them, and For preset coefficients, The task dependency depth represents the level of the sub-chart in the recursive partitioning, where the original chart is... Sub-chart after initial segmentation And so on;
[0140] Module 20: Prioritize all rendering tasks. Arrange the rendering tasks in descending order and output a new rendering queue. For rendering tasks with the same priority, sort them according to the preset drawing order.
[0141] Module 21: When a new sub-chart is added to the rendering queue, the task priority of the new sub-chart is immediately recalculated, and the new rendering queue order is dynamically adjusted.
[0142] Optional, also includes:
[0143] Module 22: The thread pool includes a core thread group, an elastic thread group, and a dedicated rendering thread group;
[0144] Modules 2 and 3: For the new rendering queue, the preset thread pool configuration strategy includes:
[0145] Module 24: When , When the first threshold is preset, the rendering task is judged as a large-area rendering task, a preset number of consecutive physical cores are allocated from the core thread group, and a pre-stored dedicated texture cache is configured to the rendering task.
[0146] Module 25: When , When the second threshold is preset, the rendering task is judged as a complex feature rendering task, a preset number of logical threads are allocated from the elastic thread group, and a pre-stored dedicated texture cache is configured to the rendering task.
[0147] Module 26: When When a rendering task is identified as a simple feature rendering task, a number of pre-defined logical threads are allocated from the elastic thread group, and a pre-stored shared cache pool is configured to the rendering task.
[0148] Module 27: When When a rendering task is identified as an urgent rendering task, several high-priority threads are directly allocated from the dedicated rendering thread group, and a pre-stored low-latency cache is configured for the rendering task.
[0149] Optional, also includes:
[0150] Module 28: After all rendering tasks have completed off-screen rendering, they are classified into three-level queues according to the type of rendering task. The three-level queues include the main queue, the space queue, and the emergency queue.
[0151] Module 29: When the rendering task is an undivided original nautical chart or a sub-chart without spatial dependencies, it is classified into the main queue, and the rendering task is synchronized from the off-screen cache to the screen in sequence according to the preset drawing order.
[0152] Module 30: When the rendering task is a segmented sub-map and there are adjacent dependencies, it is classified into the spatial queue, the spatial adjacency of the sub-map is detected, and a dependency chain with adjacent sub-maps is constructed for each sub-map. The sub-maps in the dependency chain are synchronized from the off-screen cache to the screen in spatial order.
[0153] The 31 module: When the rendering task is marked as triggered by user interaction, it is classified into the emergency queue, preemptively inserted into the head of the rendering queue, and the current synchronization process is immediately interrupted to prioritize synchronizing the rendering task to the visible area of the screen.
[0154] Optional, also includes:
[0155] Module 32: In the space queue, based on the graph traversal algorithm, detect whether there is a circular dependency chain;
[0156] The 33 module: When a circular dependency chain is detected, the dependency chain is automatically broken, and the rendering tasks are synchronized from the off-screen cache to the screen in a preset drawing order.
[0157] Modules 3 and 4: When an abnormal rendering result is detected during synchronization, the following operations are triggered:
[0158] Module 35: Rereads task metadata from off-screen cache;
[0159] Module 36: When rereading task metadata fails, the rendering task is reinserted into the rendering queue and marked as the highest priority. .
[0160] For specific limitations regarding a multi-threaded rendering system for electronic chart plotting, please refer to the limitations of a multi-threaded rendering method for electronic chart plotting described above, which will not be repeated here. The modules in the aforementioned multi-threaded rendering system for electronic chart plotting can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0161] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores nautical charts. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a multi-threaded rendering method for electronic nautical chart plotting.
[0162] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a multi-threaded rendering method for electronic chart drawing.
[0163] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program being executed by a processor as a multi-threaded rendering method for electronic chart plotting.
[0164] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0165] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
Claims
1. A multi-threaded rendering method for electronic nautical chart plotting, characterized in that, include: When several original nautical charts ordered according to a preset drawing order are received, based on a preset requirement threshold, it is determined whether each original nautical chart needs to be segmented and added to the rendering queue. Based on the preset thread pool configuration strategy, thread resources are dynamically allocated from the thread pool to perform multi-threaded parallel off-screen rendering on the undivided nautical charts and the divided sub-charts in the rendering queue. When all nautical charts and sub-charts have been rendered off-screen, the rendering results are stitched together to form a complete nautical chart and synchronized to the screen display according to the preset drawing order.
2. The multi-threaded rendering method for electronic nautical chart drawing according to claim 1, characterized in that, The step of receiving several original nautical charts sorted according to a preset drawing order, and determining whether each original nautical chart needs to be segmented and added to the rendering queue based on a preset requirement threshold, includes: When the amount of data in the original nautical chart exceeds a preset threshold, the following operations are performed: Based on the quadtree space partitioning algorithm, the original nautical chart is recursively divided into several nautical charts; When the number of geographic features per unit area of a nautical chart exceeds a first preset threshold, the nautical chart is identified as a dense area. When the number of geographic features per unit area of a nautical chart is less than or equal to a first preset threshold, the nautical chart is judged as a simple area. Furthermore, the nautical chart is divided into several sub-charts; Based on a preset refined segmentation strategy, the dense region is recursively divided into several preset sub-maps with the smallest segmentation granularity. Based on a preset large-size segmentation strategy, the simple region is directly divided into several sub-charts with preset maximum segmentation sizes; Output the segmented sub-charts and insert them into the rendering queue according to the preset drawing order; Task metadata is attached to each segmented sub-map, and the task metadata includes the pixel area of the sub-map. Sub-chart element complexity .
3. The multi-threaded rendering method for electronic nautical chart plotting according to claim 2, characterized in that, The step of determining whether each original nautical chart needs to be segmented and added to the rendering queue based on a preset demand threshold when receiving several original nautical charts sorted according to a preset drawing order further includes: When the amount of data in the original nautical chart is less than or equal to the preset requirement threshold, it is determined that no splitting is required, and initial task metadata is bound to each unsplit original nautical chart. The initial task metadata includes the original nautical chart pixel area. Complexity of original nautical chart elements ; The original, undivided nautical charts are inserted into the rendering queue according to the preset drawing order and marked as undivided.
4. The multi-threaded rendering method for electronic nautical chart drawing according to claim 1, characterized in that, The step of dynamically allocating thread resources from the thread pool based on a preset thread pool configuration strategy to perform multi-threaded parallel off-screen rendering of the undivided original nautical charts and the divided sub-charts in the rendering task queue includes: For each rendering task in the rendering queue, the rendering task includes the original undisturbed nautical chart and the segmented sub-charts, based on a preset formula. Calculate rendering weights ; in, For the maximum pixel area of all rendering tasks, The maximum element complexity for all rendering tasks and For preset coefficients and ; Based on preset formula Calculate task priority ; in, and For preset coefficients, The task dependency depth represents the level of the sub-chart in the recursive segmentation, where the original chart is... Sub-chart after initial segmentation And so on; All rendering tasks are prioritized. Arrange the rendering tasks in descending order and output a new rendering queue. For rendering tasks with the same priority, sort them according to the preset drawing order. When a new sub-chart is added to the rendering queue, the task priority of the new sub-chart is immediately recalculated, and the new rendering queue order is dynamically adjusted.
5. A multi-threaded rendering method for electronic nautical chart plotting according to claim 4, characterized in that, The step of dynamically allocating thread resources from the thread pool based on a preset thread pool configuration strategy and performing multi-threaded parallel off-screen rendering on the undivided nautical charts and the divided sub-charts in the rendering task queue also includes: The thread pool includes a core thread group, an elastic thread group, and a dedicated rendering thread group; For the new rendering queue, the preset thread pool configuration strategy includes: when , When the first threshold is preset, the rendering task is judged as a large-area rendering task, a preset number of consecutive physical cores are allocated from the core thread group, and a pre-stored dedicated texture cache is configured to the rendering task. when , When the second threshold is preset, the rendering task is judged as a complex feature rendering task, a preset number of logical threads are allocated from the elastic thread group, and a pre-stored dedicated texture cache is configured to the rendering task. when When a rendering task is identified as a simple feature rendering task, a number of pre-defined logical threads are allocated from the elastic thread group, and a pre-stored shared cache pool is configured to the rendering task. when When a rendering task is identified as an urgent rendering task, several high-priority threads are directly allocated from the dedicated rendering thread group, and a pre-stored low-latency cache is configured for the rendering task.
6. The multi-threaded rendering method for electronic nautical chart drawing according to claim 1, characterized in that, The step of stitching the rendering results into a complete nautical chart and synchronizing it to the screen display according to a preset drawing order after completing the off-screen rendering of all nautical charts and sub-charts includes: After all rendering tasks have completed off-screen rendering, they are classified into three-level queues according to the type of rendering task. The three-level queues include the main queue, the space queue, and the emergency queue. When the rendering task is an undivided original nautical chart or a sub-chart without spatial dependencies, it is classified into the main queue, and the rendering task is synchronized from the off-screen cache to the screen in a preset drawing order. When the rendering task is a segmented sub-map and there are adjacent dependencies, it is classified into the spatial queue, the spatial adjacency of the sub-map is detected, and a dependency chain with adjacent sub-maps is constructed for each sub-map. The sub-maps in the dependency chain are synchronized from the off-screen cache to the screen in spatial order. When the rendering task is marked as triggered by user interaction, it is categorized into the emergency queue. Preemptive insertion at the head of the rendering queue immediately interrupts the current synchronization process, prioritizing the synchronization of the rendering task to the visible area of the screen.
7. A multi-threaded rendering method for electronic nautical chart plotting according to claim 6, characterized in that, The step of stitching the rendering results into a complete nautical chart and synchronizing it to the screen display according to a preset drawing order after completing the off-screen rendering of all nautical charts and sub-charts also includes: In the spatial queue, a graph traversal algorithm is used to detect whether a circular dependency chain exists; When a circular dependency chain is detected, the dependency chain is automatically broken, and the rendering tasks are synchronized from the off-screen cache to the screen in a preset drawing order. If an abnormal rendering result is detected during synchronization, the following actions are triggered: Reread the task metadata from the off-screen cache; If rereading the task metadata fails, the rendering task is reinserted into the rendering queue and marked as the highest priority. .
8. A multi-threaded rendering system for electronic nautical chart plotting, characterized in that, include: First module: When receiving several original nautical charts sorted according to a preset drawing order, based on a preset requirement threshold, determine whether each original nautical chart needs to be segmented and add it to the rendering queue. The second module: Based on the preset thread pool configuration strategy, thread resources are dynamically allocated from the thread pool to perform multi-threaded parallel off-screen rendering on the undivided nautical charts and the divided sub-charts in the rendering queue. The third module: When all nautical charts and sub-charts have been rendered off-screen, the rendering results are stitched together into a complete nautical chart and synchronized to the screen display according to the preset drawing order.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of a multi-threaded rendering method for electronic chart drawing as described in claims 1-7.
10. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a multi-threaded rendering method for electronic chart drawing as described in claims 1-7.