A distributed multi-level slice pipeline and a layered verification method thereof
By constructing a three-level scheduling structure of task-subtask group-subtask and a database state machine, the problems of coarse-grained scheduling of tile tasks, scattered state management, and reliance on external coordination services for process crash recovery in existing technologies are solved, achieving efficient distributed multi-level map tile state consistency and fault-tolerant recovery.
Patent Information
- Application Number
- CN202611574213.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, the distributed implementation of multi-level map tiles suffers from problems such as coarse-grained tile task scheduling, scattered task status management, and reliance on external coordination services for process crash recovery, which also results in long recovery paths and high costs.
A three-level scheduling structure of task-subtask group-subtask is constructed. The state records are written to the database state machine, and the state is advanced through atomic updates with state conditions to achieve state consistency. In the event of a process crash, the database state machine is used as the sole recovery source to restore the state of the task and subtask.
It achieves reliable scheduling and state consistency of distributed multi-level map tiles, improves the fault tolerance and recovery efficiency of the tile pipeline, and reduces recovery paths and costs.
Smart Images

Figure CN123178015A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of map tiling technology, and in particular to a distributed multi-level tiling pipeline and its hierarchical verification method. Background Technology
[0002] Multi-source geographic data, including vector maps, raster data, imagery data, and existing tile pyramids, typically requires the construction of multi-level tile pyramids before public release. This involves resampling, rendering, and tiling the same data source at multiple Levels of Detail (LOD) levels, generating a massive number of tiles. For nationwide datasets, the number of tiles can reach billions, making single-machine serial processing inefficient; therefore, a distributed parallel tiling approach is usually employed. Simultaneously, the tiled outputs undergo quality verification to prevent defects such as missing tiles, misalignment, color differences, and style errors from entering the release stage.
[0003] In existing technologies, there are three main types of solutions for the distributed implementation of multi-level map tiles.
[0004] The first category is a centralized server-distributed, multi-machine execution scheme. For example, the distributed map tiling method, apparatus, storage medium, and server disclosed in Chinese invention application CN111159325A. This type of scheme typically involves the server determining the tiling task and distributing it to multiple execution computers; these execution computers form a client-server structure with the server. During execution, the execution end records the task progress and reports any exceptions to the server, which then decides whether to continue execution or reassign the task. This type of scheme typically lacks an intermediate scheduling unit called a "sub-task group," and the server directly faces a massive number of tile tasks, resulting in coarse-grained task scheduling and cleanup. Task progress relies on the execution end's tagging, and exceptions are judged one by one by the server. The states between the execution end and the server need to be aligned, but a unified state machine and an atomic state progression mechanism with state conditions are not explicitly disclosed. After a process crash, recovery mainly relies on tag positions and task reassignment, resulting in a long recovery path and high cost.
[0005] The second category is parallel tiling schemes based on a cluster coordination layer. For example, the map tiling method, apparatus, device, and medium based on a distributed cluster disclosed in Chinese invention application CN113032509A typically calculates the row and column numbers and boundary values of each tile at the target tile level based on the boundary values of the area to be tiled. It then uses quadtree grid encoding to establish the association between tiles and geographic areas, and multiple executors in the cluster perform tiling and rendering in parallel. The task state of this type of scheme is usually stored in the cluster coordination layer, and the database state machine is not disclosed as the sole authoritative recovery source. After a process crash, it still relies on the cluster coordination layer to participate in state confirmation or task redistribution, making state management and recovery paths relatively complex.
[0006] The third category is a general master-slave scheduling solution combined with an external coordination service. Examples include the common distributed scheduling architecture consisting of a master scheduling process, worker processes, and an external coordination service. This type of solution typically uses a master scheduling process, a group of worker processes, and an external coordination service. When a worker process becomes unreachable, the external coordination service detects this and notifies the master scheduling process to reassign the task. This approach requires maintaining consistency between the local state of the worker processes, the state of the coordination service, and the state of the master scheduling process simultaneously, resulting in significant coordination overhead. Furthermore, when the coordination service itself fails or a network partition occurs, manual intervention is often required.
[0007] In summary, the three types of solutions mentioned above still have shortcomings in terms of granularity of slice task scheduling, task status management, and process crash recovery, and need further improvement. Summary of the Invention
[0008] To address the aforementioned issues, this invention proposes a distributed multi-level slice pipeline and its hierarchical verification method, aiming to solve the problems of coarse-grained slice task scheduling, scattered task states, and long and costly recovery paths due to reliance on external coordination services for crash recovery in existing technologies.
[0009] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0010] A distributed multi-level slicing pipeline and its hierarchical verification method include the following steps:
[0011] Acquire multi-source geographic data, and use a distributed scheduling device to segment the multi-source geographic data according to LOD level and spatial grid to generate a three-level scheduling structure of tasks, sub-task groups and sub-tasks;
[0012] Write the status records of the task, the subtask group, and the subtask into the database state machine;
[0013] The distributed scheduling device assigns the subtask group to one or more worker processes. The worker processes execute the subtasks in the subtask group, generate tiles and write them to the tile storage. During the execution of the subtasks, the states of the task, the subtask group and the subtask in the database state machine are advanced by atomic updates with state conditions. The atomic updates only take effect when the current state is the expected state and abandon the state advancement when the number of affected rows is zero.
[0014] When the working process or the distributed scheduling device crashes, the database state machine is used as the sole recovery source to restore the state of the task, the subtask group, and the subtask and continue execution.
[0015] When the state recorded in the database state machine meets the preset conditions, the tile pyramid corresponding to the multi-source geographic data is output.
[0016] In some implementations, the task corresponds to a multi-level slicing request, the subtask group is uniquely determined by the task, the LOD level, and the bounding box, and the subtask is uniquely determined by the subtask group and the tile row and column numbers.
[0017] In some implementations, the database state machine stores a unique identifier, status code, LOD level, bounding box, storage location of the produced object, and number of retries for the task, the subtask group, and the subtask, respectively; the atomic update with state conditions is an update statement that only takes effect when the current state is in the expected state, and when the number of rows affected by the update statement is zero, the current state advancement is abandoned.
[0018] In some implementations, when the worker process crashes, a new worker process reads its subtask groups and subtasks from the database state machine and continues execution; when the distributed scheduling device crashes, the newly started distributed scheduling device restores the records of the task, the subtask groups and the subtasks from the database state machine, rolls back or advances records in intermediate states to a safe state, and takes over subsequent scheduling.
[0019] In some implementations, when a subtask group at any LOD level meets the closing condition, a hierarchical verification of the LOD level is triggered. The hierarchical verification is performed in parallel with the slice construction of other LOD levels. The closing condition includes all subtask groups under the corresponding LOD level entering a closed state or an abnormal final state.
[0020] In some implementations, the hierarchical verification includes, in sequence: tile file integrity verification, physical layer geometric precision verification, source data and cached tile color difference verification, and functional consistency verification. Furthermore, the next level of verification is only allowed after the current level of verification is passed.
[0021] In some implementations, once all subtask groups at all LOD levels have been completed and all the hierarchical verifications have passed, the corresponding subtask is marked as ready for release, triggering the byte-level encapsulation of the tile container and the tile pyramid is released to the outside world.
[0022] In some implementations, when any level of verification fails, an exception branch is executed according to the failure level, including: when the tile file integrity verification fails, the corresponding subtask is re-rendered and the tile file integrity verification is performed again; when the physical layer geometric precision verification fails, the tile is re-rendered and spatially adjacent tiles are included in the alignment re-check; when the source data and cached tile color difference verification fails, the comparison range is expanded to the adjacent LOD level; when the functional consistency verification fails, style hit investigation and threshold review are performed.
[0023] In some implementations, the worker process performs rendering through a pool of rendering subprocesses. The main process of the worker process is responsible for communication, task acquisition, subprocess management, and status reporting, but does not perform rendering. When a rendering subprocess crashes, the main process re-enqueues the subtasks of the rendering subprocess that are in transit and adds a new rendering subprocess.
[0024] In some implementations, during system operation, the generated online operating metrics and historical cumulative metrics are written to independent storage. The online operating metrics are first written to a memory queue and then batch-fed into a database at a preset period. The liveness detection operation is performed based on the liveness table in memory. The historical cumulative metrics are written to a statistical table or statistical database that is independent of the online operating metrics.
[0025] The beneficial effects of this invention are as follows: By constructing a three-level scheduling structure of task-subtask group-subtask, multi-source geographic data is divided according to LOD level and spatial grid, and the three-level states are uniformly written into the database state machine. During execution, the state is advanced through atomic updates with state conditions, ensuring the state consistency when multiple work processes are executed concurrently. When a work process or distributed scheduling device crashes, the database state machine is used as the sole recovery source for state recovery. Thus, reliable scheduling, state consistency, and crash recovery of distributed multi-level map tiles are achieved without relying on external coordination services, improving the fault tolerance and recovery efficiency of the tile pipeline. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the distributed multi-level slicing pipeline and its hierarchical verification method disclosed in an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the content of this invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to this invention are shown in the accompanying drawings, not all of them.
[0028] Optionally, prior to the introduction of this method, the hardware deployment can consist of one master scheduling node and multiple worker nodes. Furthermore, the distributed scheduling device uses the FastAPI framework, with a default port of 8080. The database state machine adopts SQLite WAL mode and is deployed as a single file. Worker nodes can be servers with 32 cores and 64GB of RAM.
[0029] This embodiment proposes a distributed multi-level slicing pipeline and its hierarchical verification method, such as... Figure 1 As shown, it includes the following steps:
[0030] Step 1: Acquire multi-source geographic data. Use a distributed scheduling device to segment the multi-source geographic data according to LOD level and spatial grid to generate a three-level scheduling structure of tasks, subtask groups, and subtasks.
[0031] In one example, the input multi-source geographic data can be an ArcGIS mosaic dataset. The physical paths of each raster are exported and parsed by a separate ArcGIS Pro Python subprocess started by the distributed scheduling device. The timeout is, for example, 600 seconds. The parsing results are cached and reused, so the main scheduling process does not need to run the ArcGIS runtime environment.
[0032] In this embodiment, the aforementioned distributed scheduling device can be an independently deployed scheduling service or process, such as running as an HTTP service on the main scheduling node, providing functions such as task splitting, subtask group distribution, heartbeat reception, status reporting, scheduling recovery, and management queries. It is important to note that in this solution, the distributed scheduling device does not directly perform tile rendering; instead, it is responsible for maintaining the three-level scheduling relationship between tasks, subtask groups, and subtasks, and dispatching subtask groups to one or more worker processes based on the state in the database state machine.
[0033] In this embodiment, the aforementioned task corresponds to a multi-level tile tiling request. A subtask group is uniquely determined by the task, LOD level, and bounding box, while a subtask is uniquely determined by the subtask group and the tile row and column number. Specifically, a task in this embodiment can be understood as a complete multi-level tile tiling operation, and its records may include information such as data source identifier, coverage area, target LOD level range, output format, and project priority. A task can be decomposed into multiple LOD levels, and each LOD level is further divided into multiple bounding boxes according to the spatial grid. Each bounding box corresponds to a subtask group. The subtask group is an intermediate scheduling unit between the task and the subtasks. Its function is to aggregate massive tile tasks according to LOD level and spatial range, facilitating distributed scheduling devices to distribute, finish, and restore tasks in groups, and trigger verification by LOD. A subtask is an execution unit within a subtask group, specifically assigned to a particular tile row and column number. Each subtask is responsible for rendering and writing one or a batch of tiles.
[0034] In one example, suppose a multi-level tile request is for a national vector map tile, with data sources including four types of elements: administrative divisions, road networks, water systems, and annotations. The target LOD levels are 8, 10, 12, and 14. Assume this request is assigned a task identifier T001. For LOD10, the space is divided into 128×128 tiles as a spatial grid unit. A bounding box B001 corresponds to a subtask group G001, uniquely identified by task T001, LOD10, and bounding box B001. Within subtask group G001, a tile with row and column number (0,0) corresponds to subtask ST001, uniquely identified by subtask group G001 and tile row and column number (0,0). Therefore, any tile can be traced back to its data source and LOD level by following the sequence of subtask, subtask group, and task.
[0035] Step 2: Write the status records of the task, subtask group, and subtask into the database state machine.
[0036] In this embodiment, the database state machine can be a state table in a relational database or an embedded database that supports transactions and atomic update statements, such as SQLite WAL mode. Its function is to serve as the sole authoritative record source of task, subtask group and subtask status, so that each working process and distributed scheduling device can recover from the database state machine after a crash, without relying on external coordination services.
[0037] In step 2, the database state machine stores unique identifiers, status codes, LOD levels, bounding boxes, storage locations of produced objects, and the number of retries for each task, subtask group, and subtask. Furthermore, an atomic update with state conditions is an update statement that only takes effect if the current state is the expected state; if the number of rows affected by the update statement is zero, the current state progression is abandoned.
[0038] In one example, the database state machine can be configured with a task table, a subtask group table, and a subtask table. The task table records the task identifier, task status, data source, coverage area, target LOD level, etc.; the subtask group table records the subtask group identifier, belonging task identifier, LOD level, bounding box, status code, output object storage location, and number of retries, etc.; the subtask table records the subtask identifier, belonging subtask group identifier, tile row and column number, status code, output object storage location, and number of retries, etc. The aforementioned state progression uses atomic updates with state conditions, allowing the option to "update the status to 'processing' only if the status is 'pending distribution'". Furthermore, if the number of rows affected by the update statement is zero, it means that the record has been preempted by other worker processes, and this state progression is abandoned, thus achieving concurrent state control without adding external coordination services.
[0039] In one example, the subtask group's state transition path is: pending → processing → rendered → flushed → merging → merged → confirmed, with the exception of a failed final state. The subtask's state transition path is: pending → processing → completed, with the exception of failed and skipped final states. Here, flushed, merged, and confirmed correspond to the "written → completed" states, while skipped and failed correspond to the exceptions.
[0040] Step 3: The subtask group is assigned to one or more worker processes through a distributed scheduling device. The worker processes execute the subtasks in the subtask group, generate tiles and write them to the tile storage. During the execution of the subtasks, the state of the task, subtask group and subtask in the database state machine is advanced through atomic updates with state conditions. The atomic update only takes effect when the current state is the expected state and abandons the state advancement when the number of affected rows is zero.
[0041] In one example, the worker process actively pulls subtask groups. Specific group selection rules can be: prioritizing high-priority projects, prioritizing the dispatch of remaining key groups after the project completion rate reaches a preset percentage (e.g., 95%), prioritizing groups closer to the worker process space among groups with the same cost, sorting the groups in descending order of expected time consumption, or pausing dispatch when the worker process reaches its concurrency, CPU, or memory limits.
[0042] In step 3, the worker process performs rendering through the rendering subprocess pool. The main process of the worker process is responsible for communication, task acquisition, subprocess management and status reporting, but does not perform rendering. When the rendering subprocess crashes, the main process re-enqueues the subtasks of the rendering subprocess that are in transit and adds a new rendering subprocess.
[0043] Specifically, worker processes can be deployed on one or more worker nodes. The main process of a worker process is only responsible for communicating with the distributed scheduling device, acquiring subtask groups, managing rendering subprocesses, and reporting status; it does not directly load the rendering library. One or more rendering subprocesses in the rendering subprocess pool are responsible for actually calling the rendering library to perform tile rendering. Therefore, when the rendering library crashes due to defects, memory anomalies, or dependency conflicts, only the corresponding rendering subprocess is affected; the main process will not crash. Then, when the main process detects a rendering subprocess crash, it re-enqueues its en route subtask groups and adds new rendering subprocesses to continue execution, thereby compressing the fault domain to the subprocess level. The recovery time is shortened from restarting the entire worker process to replacing a subprocess.
[0044] In one implementation, the internal implementation of the rendering subprocess can be as follows: The rendering subprocess renders per watt using a thread pool, and the rendering pipeline can use GDAL plus NumPy and Pillow image compositing to output PNG tiles. To further ensure the stability of the rendering subprocess, two levels of timeout protection are also set: the single-watt rendering budget is dynamically estimated based on the data volume, for example, the base duration (e.g., 300 seconds) plus the amount of intersecting data (megabytes) divided by the throughput rate (e.g., 10MB / s), and falls between the upper and lower limits (e.g., 600 seconds to the upper limit); if the entire group has no output for a long time (e.g., more than 2400 seconds), it is determined that the subprocess is frozen and forcibly terminated and reborn.
[0045] In one implementation, the registration and survival management of worker processes can be performed as follows: after a worker process starts, it first registers with the distributed scheduling device and carries a version number. If the versions are inconsistent, no task will be assigned. After registration, a heartbeat is sent every 30 seconds. If no heartbeat is received for more than 60 seconds, the worker process is determined to be offline and its sub-task groups are automatically reclaimed.
[0046] Even better, in addition to the above-mentioned rendering subprocess isolation, the system can also manage online running indicators and historical cumulative indicators separately during operation. The generated online running indicators and historical cumulative indicators are written to independent storage. The online running indicators are first written to the memory queue and then batch-fed to the database according to a preset period. The liveness detection operation is performed based on the liveness table in memory. The historical cumulative indicators are written to a statistical table or statistical database that is independent of the online running indicators.
[0047] In this embodiment, the aforementioned online operation metrics may include worker process heartbeats, current load, rendering subprocess status, etc., characterized by frequent writes and high real-time requirements. Historical cumulative metrics, on the other hand, may include long-term statistics, time-consuming samples, archived details, etc., characterized by large data volumes and large write batches. Writing these two types of metrics to independent storage can avoid interference between historical batch statistical writes and real-time scheduling status writes, thereby reducing production line jitter. The liveness detection operation is performed based on the liveness table in memory, eliminating the need to wait for database round trips, thus improving the real-time performance of fault detection.
[0048] In one example, heartbeats are first queued in memory and then written to the database every second or every 100 records in batches; the active table in memory is used to determine which to refresh before the database; historical cumulative indicators are written to a separate long-term statistical table and confirmed when the group is confirmed; the time consumption sample for each tile is backfilled and the tile cost is estimated according to a preset window (e.g., 7 days) to feed back into the scheduling sorting; the details of completed projects are moved into the historical archive table after a preset time (e.g., 3 days).
[0049] In addition to the above-mentioned metric separation, in one implementation, the system can also perform zombie recycling and health degradation during runtime. The zombie recycling rules are: no progress exceeding a preset time (e.g., 3600 seconds), hard timeout when only one active worker process remains (e.g., 900 seconds), and hard queue limit (e.g., 14400 seconds); the health degradation rules are: if the rendering rate is continuously lower than a preset percentage of the active median (e.g., 25%) for a preset time (e.g., 600 seconds), it will be progressively downgraded to rate limiting or eliminated.
[0050] Step 4: When a worker process or distributed scheduling device crashes, the database state machine is used as the sole recovery source to restore the state of the task, subtask group, and subtask and continue execution.
[0051] In a preferred embodiment, when a worker process crashes, a new worker process reads its subtask groups and subtasks from the database state machine and continues execution; when the distributed scheduling device crashes, the newly started distributed scheduling device restores the records of tasks, subtask groups and subtasks from the database state machine, rolls back or advances records in intermediate states to a safe state, and takes over subsequent scheduling.
[0052] In this embodiment, the aforementioned worker processes can only retain discardable and rebuildable progress caches locally, such as caches used for interface display or batch reporting. These caches are not used as the basis for recovery. After a worker process crashes, a new worker process starts and registers, reads its subtask groups and subtasks from the database state machine, and determines which subtasks need to be re-executed and which have been written to tile storage and can be reused based on the status codes. In addition, when the distributed scheduling device crashes, the newly started distributed scheduling device reads all three levels of records from the database state machine, rolls back or advances records in intermediate states such as processing and merging to a safe state according to rules, and then continues scheduling. Since the decision states in this scheme only exist in the database state machine, the recovery process does not need to check the status with surviving processes, nor does it require the participation of external coordination services.
[0053] In one example, the recovery rules are as follows: groups in process are rolled back to pending distribution; merge failures are rolled back to written fragments; temporary files in the merging process are cleared and rolled back; written fragments and files that still exist are directly confirmed for finalization; groups with missing fragments are rolled back and re-splittered.
[0054] Step 5: When the state recorded in the database state machine meets the preset conditions, output the tile pyramid corresponding to the multi-source geographic data.
[0055] In one implementation, before outputting the tile pyramid, each subtask group can be finalized and merged. In one example, after all subtasks within a group have reached their final state, the subtask group meets the finalization conditions, and the distributed scheduling device performs merging processing on the products of the same group. For example, the rendering subprocess writes tiles to a bundled fragment file (.part fragment, with a PART identifier in the file header, and a name including the group number, process number, and sequence number), and the process then reports that it has been written; after all fragments in the same grid cell have arrived, the distributed scheduling device merges them into a tile container file (e.g., ArcGIS CompactV2 format, including a 64-byte file header, 16384 × 8-byte index entries, and PNG data segments; unproduced tiles have empty entries in the index), and after verification, the subtask group is marked as confirmed, and temporary fragments are deleted.
[0056] In one implementation, when a subtask group at any LOD level meets the closing condition, a hierarchical verification of the LOD level is triggered. The hierarchical verification is executed in parallel with the slice construction of other LOD levels. The closing condition includes all subtask groups under the corresponding LOD level entering a closed state or an abnormal final state.
[0057] In this embodiment, each LOD level can maintain its own completion criteria. For example, when all subtask groups under a given LOD level have entered a completed or abnormal final state, the LOD level is considered to meet the completion criteria, and the hierarchical verification of that LOD level is immediately triggered. At this time, the slice construction of other LOD levels can continue without waiting for the construction of all levels to be completed. Therefore, since the coarse-level data volume is usually smaller and completed earlier, the coarse-level can be verified first and meet the release conditions first, thereby shortening the overall production line time from "the sum of the construction of all levels plus overall verification" to nearly "the construction and verification of the slowest level".
[0058] In one implementation, the above-mentioned hierarchical verification includes, in sequence: tile file integrity verification, physical layer geometric precision verification, source data and cache tile color difference verification, and functional consistency verification. Furthermore, the next level of verification is allowed only after the current level of verification is passed.
[0059] In one example, the four levels of verification mentioned above can be referred to as L1 verification, L2 verification, L3 verification, and L4 verification, respectively. L1 verification mainly checks whether the tile file exists, whether the file size is within a valid range, whether the file header magic number matches the expected format, whether it can be completely decoded, and whether the container index record in the packaged form is valid. L2 verification mainly checks whether the tile bounding box is aligned with the corresponding range of the source data, whether the projection parameters are consistent, whether adjacent tile edges are continuous, and whether the cache coverage outline matches the valid range outline of the source data. L3 verification mainly compares the cached tiles with the reference channel rendered from the source data using the same parameters, assigning a weighted color difference score, and setting source-side and cache-side error tolerances respectively. L4 verification mainly performs a display-level comparison of the cache and source data according to the target mapping style, checking key element hits, cross-level consistency, and blank tile ratio. Only after the previous level of verification passes can the next level of verification be performed, thus filtering defects step-by-step from the cheapest to the most complex.
[0060] Even better, during the hierarchical verification process, when any level of verification fails, an exception branch is executed according to the failure level, including: when the tile file integrity verification fails, the corresponding subtask is re-rendered and the tile file integrity verification is performed again; when the physical layer geometric precision verification fails, the tile is re-rendered and spatially adjacent tiles are included in the alignment re-check; when the source data and cached tile color difference verification fails, the comparison range is expanded to the adjacent LOD level; when the functional consistency verification fails, style hit investigation and threshold review are performed.
[0061] In this embodiment, different verification levels correspond to different defect types, and therefore the repair paths also differ. Specifically, L1 failures typically indicate file corruption or missing data, requiring priority re-rendering; L2 failures typically indicate geometric misalignment, seams, or coverage gaps, requiring not only re-rendering but also alignment re-checking of adjacent tiles; L3 failures may be rendering defects or reasonable differences caused by source data updates, thus extending the comparison scope to adjacent LOD levels to distinguish between source data differences and rendering defects; L4 failures are usually related to style configuration or threshold settings, thus requiring style hit checks and threshold verification. Each abnormal branch can be configured with a retry limit and exponential backoff interval. After retries are exhausted, options include skipping, downgrading to non-release-ready, or reverting to a rescheduled approach to avoid a retry storm.
[0062] In one example, the maximum number of retries for a single tile failure is 3, with backoff intervals of 1 second, 2 seconds, and 4 seconds. After the retries are exhausted, the tile container is set to skipped, the tile container is empty, and a manual retry entry is retained. When a manual retry is performed, the state is reset, the count is cleared, and the tile is inserted at the head of the queue.
[0063] In one implementation, once all subtask groups at all LOD levels have been completed and all hierarchical verifications have passed, the corresponding subtask is marked as ready for release, triggering byte-level encapsulation of the tile container and the tile pyramid is released to the outside world.
[0064] Specifically, the aforementioned release-ready flags can be recorded in the database state machine. For example, once all LOD levels have been completed and all level 4 verifications have passed, the distributed scheduling device can asynchronously generate the metadata required for the tile pyramid and trigger byte-level encapsulation of the tile container. After encapsulation, the preview service or release service can directly read the encapsulated tile container to provide tile services, thereby realizing the complete process from slicing, verification to release.
[0065] The above embodiments are merely illustrative of the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made based on the essence of the content of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A distributed multi-level slicing pipeline and its hierarchical verification method, characterized in that, Includes the following steps: Acquire multi-source geographic data, and use a distributed scheduling device to segment the multi-source geographic data according to LOD level and spatial grid to generate a three-level scheduling structure of tasks, sub-task groups and sub-tasks; Write the status records of the task, the subtask group, and the subtask into the database state machine; The distributed scheduling device assigns the subtask group to one or more worker processes. The worker processes execute the subtasks in the subtask group, generate tiles and write them to the tile storage. During the execution of the subtasks, the states of the task, the subtask group and the subtask in the database state machine are advanced by atomic updates with state conditions. The atomic updates only take effect when the current state is the expected state and abandon the state advancement when the number of affected rows is zero. When the working process or the distributed scheduling device crashes, the database state machine is used as the sole recovery source to restore the state of the task, the subtask group, and the subtask and continue execution. When the state recorded in the database state machine meets the preset conditions, the tile pyramid corresponding to the multi-source geographic data is output.
2. The distributed multi-tier slice pipeline and its layered verification method according to claim 1, characterized in that, The task corresponds to a multi-level slicing request. The subtask group is uniquely determined by the task, the LOD level, and the bounding box. The subtask is uniquely determined by the subtask group and the tile row and column numbers.
3. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 1, characterized in that, The database state machine stores a unique identifier, status code, LOD level, bounding box, storage location of the produced object, and number of retries for each task, subtask group, and subtask, respectively. The atomic update with state conditions is an update statement that only takes effect when the current state is in the expected state. When the number of rows affected by the update statement is zero, the current state advancement is abandoned.
4. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 1, characterized in that, When the worker process crashes, the new worker process reads its subtask groups and subtasks from the database state machine and continues to execute; when the distributed scheduling device crashes, the newly started distributed scheduling device restores the records of the task, the subtask group and the subtask from the database state machine, rolls back or advances records in intermediate states to a safe state, and takes over subsequent scheduling.
5. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 1, characterized in that, When any subtask group at any LOD level meets the closing condition, a hierarchical verification of the LOD level is triggered. The hierarchical verification is executed in parallel with the slice construction of other LOD levels. The closing condition includes all subtask groups under the corresponding LOD level entering the closed state or the abnormal final state.
6. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 5, characterized in that, The hierarchical verification includes, in sequence: tile file integrity verification, physical layer geometric precision verification, source data and cached tile color difference verification, and functional consistency verification. Only after the current level of verification is passed can the next level of verification be allowed.
7. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 5, characterized in that, Once all subtask groups at all LOD levels have been completed and all the hierarchical verifications have passed, the corresponding subtasks are marked as ready for release, triggering the byte-level encapsulation of the tile container and the tile pyramid is released to the outside world.
8. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 6, characterized in that, When any level of verification fails, the exception handling is executed according to the failure level, including: when the tile file integrity verification fails, the corresponding subtask is re-rendered and the tile file integrity verification is performed again; when the physical layer geometric precision verification fails, the tile is re-rendered and spatially adjacent tiles are included in the alignment re-check; when the source data and cached tile color difference verification fails, the comparison range is expanded to the adjacent LOD level; when the functional consistency verification fails, style hit investigation and threshold review are performed.
9. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 1, characterized in that, The worker process performs rendering through a pool of rendering subprocesses. The main process of the worker process is responsible for communication, task acquisition, subprocess management, and status reporting, but does not perform rendering. When a rendering subprocess crashes, the main process re-enqueues the subtasks of the rendering subprocess that are in transit and adds a new rendering subprocess.
10. The distributed multi-level slicing pipeline and its hierarchical verification method according to claim 1, characterized in that, During system operation, the generated online operating indicators and historical cumulative indicators are written to independent storage. The online operating indicators are first written to a memory queue and then batch-fed to the database according to a preset period. The liveness detection operation is performed based on the liveness table in memory. The historical cumulative indicators are written to a statistical table or statistical database that is independent of the online operating indicators.
Citation Information
Patent Citations
Distributed map slicing method and device, storage medium and server
CN111159325A
Map slicing method and device based on distributed cluster, equipment and medium
CN113032509A
