A parallel and efficient map tile management and distribution method

By employing a multi-level caching architecture and a parallel request processing mechanism, the problems of complex and costly map tile storage architecture are solved, enabling efficient tile data storage and retrieval, and improving the performance and availability of map services.

CN123138345APending Publication Date: 2026-11-20ROCKET FORCE UNIV OF ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611139186.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies for map tile storage are complex, costly, have low storage and query performance, lack high-concurrency access capabilities, have low caching efficiency, and suffer from unreasonable request scheduling, leading to server crashes and performance bottlenecks.

Method used

It adopts a multi-level caching architecture (L1 memory cache, L2 distributed cache, L3 storage layer), a parallel request processing mechanism, an intelligent prefetching mechanism, and space-aware load balancing. Through the listening module, processing module, cache manager, storage manager, load balancer, and prefetch manager, it achieves efficient tile data storage and retrieval.

Benefits of technology

It significantly improves the performance and availability of map tile services, supports high-concurrency access, intelligent cache management, spatially aware load balancing, improves cache hit rate and query efficiency, and reduces storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138345A_ABST
    Figure CN123138345A_ABST
Patent Text Reader

Abstract

The application discloses a parallel and efficient map tile management and distribution method, and relates to the technical field of geographic information systems (GIS) and spatial databases. The method comprises the following steps: receiving tile reading requests sent by a plurality of clients, and analyzing current request metadata and historical request metadata corresponding to each tile reading request; performing primary retrieval in a first cache of a target server according to the plurality of current request metadata, and sending map tile data to the corresponding client in the case of retrieving the map tile data; in the case of not retrieving the map tile data, performing secondary retrieval in a second cache of a server cluster in a multi-thread mode according to the plurality of current request metadata and the plurality of historical request metadata, and sending the map tile data to the corresponding client in the case of retrieving the map tile data, so as to solve the problems of complex storage architecture, high cost, low storage and query performance in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of Geographic Information Systems (GIS) and spatial database technology, and more specifically, to a parallel and efficient method for map tile management and distribution. Background Technology

[0002] With the rapid development of internet map services, map tile technology has become one of the core technologies of Web Geographic Information Systems (WebGIS). Map tiles are image units that divide a map into fixed-size sections (usually 256x256 pixels), organized in a pyramid-like hierarchical structure, allowing users to browse the map at different zoom levels. Mainstream map service providers (such as Google Maps, Mapbox, and OpenStreetMap) widely use tile technology to provide map services. However, the global map tile data volume is enormous (TB or even PB levels), and tiles in popular areas (such as large cities and tourist attractions) receive a large number of concurrent requests. Therefore, employing appropriate methods for storing and retrieving large amounts of tile data is crucial.

[0003] Existing technologies typically use file system storage: its storage principle is to organize tile files using directories, but performance degrades when the file volume is huge; database storage: uses formats such as MBTiles to store data in SQLite, but concurrency performance is limited; distributed storage: uses distributed file systems such as HDFS and Ceph, but the architecture is complex and costly. Furthermore, traditional file storage faces problems such as inode exhaustion (inode exhaustion refers to the complete use of inode resources in a Linux file system, resulting in the system being unable to create new files or directories even if there is still a large amount of disk storage space (blocks) remaining) and excessive file numbers, while database storage also faces problems such as excessively large single-table data volumes and decreased query performance.

[0004] There is currently no effective solution to at least one of the problems existing in the above-mentioned prior art, namely complex storage architecture, high cost, and low storage and query performance. Summary of the Invention

[0005] The main objective of this application is to provide a parallel and efficient method for map tile management and distribution, in order to solve the problems of complex storage architecture, high cost, and low storage and query performance in the existing technology.

[0006] To achieve the above objectives, according to one aspect of the embodiments of this application, a parallel and efficient map tile management and distribution method is proposed, comprising: receiving tile reading requests sent by multiple clients, and parsing the current request metadata and historical request metadata corresponding to each tile reading request from the multiple tile reading requests; performing an initial retrieval in a first cache of a target server based on the multiple current request metadata, and if map tile data corresponding to the current request metadata is retrieved, sending the map tile data to the corresponding client; if map tile data is not retrieved, performing a secondary retrieval in a second cache of a server cluster using a multi-threaded approach based on the multiple current request metadata and multiple historical request metadata, and if map tile data corresponding to the current request metadata is retrieved, sending the map tile data to the corresponding client.

[0007] According to another aspect of the embodiments of this application, a parallel and efficient map tile management and distribution device is also provided, comprising: a receiving unit, configured to receive tile reading requests sent by multiple clients, and parse the current request metadata and historical request metadata corresponding to each tile reading request from the multiple tile reading requests; an initial retrieval unit, configured to perform an initial retrieval in a first cache of a target server based on the multiple current request metadata, and if map tile data corresponding to the current request metadata is retrieved, send the map tile data to the corresponding client; and a secondary retrieval unit, configured to perform a secondary retrieval in a second cache of a server cluster using a multi-threaded approach based on the multiple current request metadata and multiple historical request metadata if no map tile data is retrieved, and if map tile data corresponding to the current request metadata is retrieved, send the map tile data to the corresponding client.

[0008] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores computer instructions for causing a computer to perform the above-described parallel and efficient map tile management and distribution method.

[0009] According to another aspect of the embodiments of this application, an electronic device is also provided, the electronic device including: at least one processor, and a memory communicatively connected to the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the above-described parallel and efficient map tile management and distribution method.

[0010] In this application, the above-mentioned parallel and efficient map tile management and distribution method solves the problems of complex storage architecture, high cost, and low storage and query performance in the prior art. Attached Figure Description

[0011] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application. In the drawings:

[0012] Figure 1 A flowchart illustrating an optional parallel and efficient map tile management and distribution method provided in this application; Figure 2 A schematic diagram of another optional parallel and efficient map tile management and distribution device provided in this application. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0015] In addition to the problems described in the background section, the prior art also has the following problems: 1. Lack of high-concurrency access capability: A single tile server cannot withstand tens or even hundreds of thousands of concurrent connections, and sudden traffic surges (such as holidays or major events) can cause server crashes. Current technologies address this issue by vertical scaling: increasing the hardware resources (CPU, memory, bandwidth) of a single server, which is not only costly but also has performance bottlenecks; horizontal scaling: increasing the number of servers, but requires effective load balancing strategies; CDN acceleration: caching tiles to CDN edge nodes, but its effect is limited for dynamically generated tiles. 2. Low caching efficiency: Traditional LRU and other grandchild-replacing algorithms are not suitable for the access patterns of tile data because tile access has spatial and temporal locality, which existing caching algorithms do not fully utilize; the cache hit rate is low, and a large number of requests are penetrated to the backend storage. Current technologies address this problem by using the LRU algorithm, which only considers the most recent access time and does not consider access frequency and spatial relationships; the LFU algorithm, which only considers access frequency and does not consider time decay; and hybrid algorithms, such as ARC and LIRS, but none of them are optimized for tile data. 3. Inefficient request scheduling: Tile reading requests have spatial continuity (e.g., users will continuously request adjacent tiles when browsing a map), but existing load balancing algorithms (such as round-robin and random) do not consider spatial relationships. Requests from the same area are distributed to different servers, resulting in cache duplication and low efficiency. Although the round-robin algorithm used in existing technologies is simple, it does not consider server load and request characteristics. The least connections algorithm used considers server load but not request characteristics. The consistent hashing algorithm used considers request characteristics but cannot consider spatial relationships.

[0016] To address the problems of complex storage architecture, high cost, and low storage and query performance in existing technologies, as well as at least one of the aforementioned issues, this application provides a parallel and efficient map tile management and distribution method. Furthermore, this application also provides a parallel and efficient map tile management and distribution system. The overall architecture of this system includes: a listening module for listening on a specified port (default 8080); a processing module for asynchronously processing multiple tile read requests using an asynchronous thread pool (thread pool size defaults to the number of CPU cores x 2); and the parallel and efficient map tile management and distribution system also integrates a cache manager (including L1 cache). The application includes a cache manager that implements a hybrid LRU-LFU algorithm, supporting TTL expiration and prefetching; an L2 cache manager that implements consistent hashing distribution, supporting batch operations and data compression; an L3 cache manager that supports multiple storage formats and provides a unified data access interface; a storage manager; a load balancer; and a prefetch manager. The cache manager uses in-memory caching and distributed caching to store tile data; the storage manager uses a storage database to store tile data; the load balancer is used for space-aware load balancing across multiple reference servers, resolving load balancing among multiple reference servers in a server cluster; and the prefetch manager is used to implement prefetching operations for each tile read request. Additionally, this application includes a monitoring module for collecting performance metrics and supporting adaptive scheduling. This application creates a thread pool with a maximum number of worker threads (usually twice the number of CPU cores) to asynchronously process requests and improve concurrency performance. The cache manager in this application is responsible for managing the L1 and L2 caches, following the tiered strategy of "L1 is the fastest but has the smallest capacity, L2 is next, and L3 (persistent storage layer) is the slowest". The storage manager is used to access persistent storage (such as disks, databases, and storage of raw tile data), and the load balancer is used to maintain load balancing in the spatial dimension, distributing requests to different nodes based on spatial location.

[0017] As an alternative implementation method, please refer to Figure 1This document illustrates a flowchart of a parallel and efficient map tile management and distribution method provided in an embodiment of this application. The method includes at least one of the following steps (S102 to S106): S102, receiving tile reading requests sent by multiple clients, and parsing the current request metadata and historical request metadata corresponding to each tile reading request from the multiple tile reading requests; S104, performing an initial search in the first cache of the target server based on the multiple current request metadata, and if map tile data corresponding to the current request metadata is found, sending the map tile data to the corresponding client; S106, if map tile data is not found, performing a secondary search in the second cache of the server cluster using a multi-threaded approach based on the multiple current request metadata and multiple historical request metadata, and if map tile data corresponding to the current request metadata is found, sending the map tile data to the corresponding client.

[0018] It should be noted that the aforementioned parallel and efficient map tile management and distribution method can be understood, but is not limited to, as a map tile storage and retrieval method. Similarly, the parallel and efficient map tile management and distribution system and device corresponding to this method can also be understood or referred to as a map tile storage and retrieval system and device. In S102 above, the client can be a mobile client, a computer client, or any other client that allows users to send tile retrieval requests. Each client corresponds to a target user (which can be understood, but is not limited to, a target account). The target users for each client can be the same or different. Upon receiving a tile retrieval request, the target server (a high-performance parallel tile server; the target server in this application and multiple reference servers in the server cluster all support multi-level caching, asynchronous processing, load balancing, and intelligent prefetching) first parses the request path (format: / tiles / {zoom} / {x} / {y}) of each received GET request (i.e., tile retrieval request).(The `{format}` part of the request path refers to the tile level corresponding to the tile, the x-coordinate is the tile row number in the tile level, and the y-coordinate is the tile column number in the tile level; that is, each tile in the tile level has both a row number and a column number). The y-coordinate and the subsequent file format (i.e., the `{format}` part) are separated from the request path to parse the current request metadata corresponding to each tile read request. Then, an asynchronous initial retrieval (also known as asynchronous processing) is performed based on the current request metadata for each tile read request, and the initial retrieval results are obtained. While waiting for the initial retrieval results, the target server also sets an initial retrieval time period for each tile read request. If map tile data corresponding to the currently requested metadata is retrieved within the specified time period, it is considered a successful initial retrieval. At this point, the map tile data will be sent to the corresponding client. Upon initial success, tile prefetching will be performed on the initially retrieved metadata (or the corresponding tile read request). This prefetching process involves retrieving tiles adjacent to the tiles corresponding to the currently requested metadata. This prefetching not only performs prefetch queries in the target server's first cache (L1) but also in the reference servers within the server cluster. This tile prefetching process will be explained in detail in the subsequent solution description. Furthermore, this application will... The successfully retrieved map tile data updates the first cached tile data cached in the first cache of the target server and the second cached tile data cached in the server cluster. This update includes updating the tile metadata of the first and second cached tile data related to the map tile data, as well as updating the statistical number of requests to the first and second cached tile data related to the map tile data. The aforementioned tile metadata update (used to cache a preset number of first cached tile data with relatively recent request times and high request frequencies in the first cache) includes: the latest request time (compared to the current system time) corresponding to the map tile data is later than (i.e., the latest request time is closer to the first request time). If, based on the current system time, the first request time of the first cached tile data (i.e., the latest request time of the first cached tile data), and the number of first cached tile data cached in the first cache does not meet the preset quantity, the map tile data, along with the latest request time and the latest request count (plus the current request), are backfilled to the first cache. If the latest request time of the map tile data is later than the first request time of the first cached tile data, and the number of first cached tile data cached in the first cache meets the preset quantity, the first cached tile data corresponding to the earliest first request time (the time interval furthest from the current system time) in the first cache is updated and cached in the second cache of the reference server.

[0019] The aforementioned current request metadata includes the tile level, tile row number, and tile column number. It should be noted that the tile row number and tile column number together constitute the tile coordinates of the corresponding tile. After obtaining the current request metadata, this application will also verify the validity of the parameters. The method for verifying parameter validity can be by comparing the tile coordinates and level corresponding to the corresponding tile storage method in existing technologies, or by comparing with preset tiles and levels, or other methods, which are not limited in this application. The aforementioned historical request metadata includes tile read requests sent to the stored tile data up to the current system timestamp within a preset time period or a preset number of times. The aforementioned historical request metadata includes the tile coordinates, tile level, and number of requests for each requested tile. It should be noted that the aforementioned map tile data is the tile data corresponding to any tile read request.

[0020] If no map tile data is found, this application performs a secondary search in the second cache (L2) and storage database (L3) of multiple reference servers in the server cluster. If map tile data is found, it is sent to the corresponding client. Simultaneously, if map tile data is found in the secondary search, tile prefetching (i.e., prefetching adjacent tiles) is performed for the tile indicated by the corresponding tile read request. The number of tiles prefetched can be 8 or 10, and this application does not limit this. This application records the recent preset number of tile access records for each target user (including tile level zoom, tile coordinates (x, y), and access / request timestamp). These tile access records can be used to analyze the user's movement patterns (also known as access patterns) to predict the tiles the user might access next, providing a basis for tile prefetching. This application uses a dictionary + list structure to record user tile access records, with each user ID (target user) corresponding to an access record queue with a maximum length of a preset length (e.g., 50). The historical request metadata of this application includes tile access records for each target user. When a target user accesses a tile, this application generates surrounding coordinates through a double loop and uses a thread pool to asynchronously execute a prefetching task, thereby proactively prefetching tiles around the tile accessed by the user (e.g., the 8 surrounding tiles). This way, when the user moves across the map, adjacent tiles are preloaded, significantly reducing request latency. It should be noted that when performing tile prefetching, this application first checks the L1 cache (i.e., the target server's first cache). If the tile exists, it is skipped (because it is already in the L1 cache, there is no need to modify the cached tile data). If the prefetched tile does not exist in the L1 cache, it searches in the L2 cache (i.e., the reference server's second cache). If it exists, it is skipped; otherwise, it searches in the L3 cache (i.e., the storage database of the corresponding reference server). If it exists, the found prefetched tile data is cached in the L2 cache. It should be noted that the prefetched tile data in this application is only stored in the L2 cache. This operation is to avoid polluting the L1 cache. This application supports MBTiles format for storing tile data in the second cache. The prefetching in this application enables seamless scrolling when users access the map.

[0021] The embodiments described in this application solve the problems of complex storage architecture, high cost, and low storage and query performance in existing technologies. Furthermore, this method achieves efficient storage and querying of tile data by establishing a multi-level caching architecture (L1 memory cache, L2 distributed cache, and L3 storage layer); supports high-concurrency access through a parallel request processing mechanism; predicts and prefetches tiles based on user behavior analysis and spatial relationships through an intelligent prefetching mechanism; and optimizes request distribution through spatially aware load balancing. Compared to existing technologies, this invention has advantages such as high concurrency processing capabilities, intelligent cache management, and spatially aware load balancing, significantly improving the performance and availability of map tile services.

[0022] As an optional implementation, the above-mentioned initial retrieval in the first cache of the target server based on multiple current request metadata includes: S1, grouping multiple tile read requests according to multiple current request metadata and / or multiple historical request metadata to obtain multiple first request groups; S2, determining any first request group that has not been initially retrieved as the current first request group, determining the current request metadata corresponding to the current first request group as the first request metadata, and determining the historical request metadata corresponding to the current first request group as the first historical metadata; S3, initially retrieving the map tile data corresponding to the first request group in the first cache of the target server based on the first request metadata and the first historical metadata.

[0023] The grouping method for multiple tile read requests in S1 above includes two methods. Method 1: Clustering multiple tile read requests according to spatial proximity. Specifically, this involves determining the spatial proximity index between the requested tiles for each tile read request based on the current request metadata corresponding to each tile read request (spatial proximity includes both adjacent tiles and adjacent tile levels; that is, both adjacent tile levels and adjacent tiles themselves indicate spatial proximity between the requested tiles); and grouping multiple tile read requests according to the spatial proximity between them. The application requires grouping multiple tile read requests. When grouping multiple tile read requests based on the current request metadata, it employs spatial clustering algorithms such as DBSCAN. It calculates the tile distance based on the current request metadata (including tile coordinates) corresponding to each tile read request, obtaining the spatial proximity index between each requested tile and other requested tiles. Clustering sensitivity is controlled by preset parameters: tile read requests with a distance less than a preset sensitivity threshold are grouped into the same group. The final range grouping list, i.e., multiple first request groups, contains a set of spatially adjacent tile read requests (i.e., multiple spatially adjacent tile read requests).

[0024] Method 2: Group multiple tile read requests according to spatial relationships (each time a user accesses a tile (when sending a tile read request), their access path (the tile coordinates and tile level of the accessed tile) is recorded, and spatial relationships can be understood as, but are not limited to, predictions of the access path; tile coordinates are grouped according to the predicted access path). Specifically: determine the requesting user corresponding to each tile read request; determine the user's historical request metadata corresponding to each requesting user from multiple historical request metadata; determine the predicted trajectory corresponding to each requesting user based on the user's historical request metadata (it should be noted that the predicted trajectory can be the movement trajectory determined based on the user's historical request metadata, or it can include the predicted trajectory of the next predicted tile determined based on the movement trajectory); determine the trajectory overlap degree corresponding to each requesting user based on the predicted trajectory corresponding to each requesting user; and group multiple tile read requests according to the trajectory overlap degree between each requesting user and other requesting users to obtain multiple first request groups. The above grouping is used to avoid loading the same tile data when a user requests multiple adjacent map tile data at the same time. Grouping also allows for parallel processing of requests from different groups, improving throughput. Furthermore, requests that are spatially close often have the opportunity to share data or reuse computations, and grouping can reduce resource waste (such as the number of database queries and memory usage).

[0025] In steps S2 and S3 above, this application uses a thread pool to submit processing tasks (initial retrieval tasks) for each group. Each first request group corresponds to one thread, achieving parallel computation at the group level. After all thread tasks are completed, the results of each group are collected sequentially and merged into a final result list. Based on the final result list, the map tile data corresponding to the tile reading request in each first request group is sent to the client corresponding to the tile reading request. The thread pool is used in this application for batch processing of tile reading requests, and the grouping is also for subsequent tile pre-fetching.

[0026] S3 specifically includes: S3-1, determining multiple target users corresponding to the current first request group, and determining the movement mode corresponding to each target user based on the first historical metadata corresponding to each target user; S3-2, obtaining the prefetch range corresponding to each movement mode, and performing prefetch retrieval corresponding to each tile read request in the current first request group based on the movement mode and prefetch range to obtain prefetch tile information; S3-3, updating the server cluster based on the prefetch tile information, and performing prefetch retrieval in the second cache of the server cluster based on the movement mode and prefetch range if the prefetch retrieval does not find the prefetch tile information.

[0027] The specific operations in S3-1 above (the target user or reference user in this application can be understood as, but is not limited to, an account, such as a target account or a reference account) include: determining the reference user corresponding to each tile reading request based on multiple tile reading requests in the current first request group; filtering the multiple reference users to obtain multiple target users; determining the first historical metadata corresponding to each target user from multiple first historical metadata records; and determining the movement pattern corresponding to each target user based on the first historical metadata records corresponding to each target user. The movement pattern is used to indicate the movement direction and movement distance of each first historical metadata record of the target user (i.e., the tile movement direction from one tile read to the next tile read, and the tile distance between two adjacent tile reads).

[0028] The prefetch range corresponding to each movement mode may be the same or different. This application will obtain the prefetch range corresponding to each movement mode and perform prefetch retrieval corresponding to each tile read request in the current first request group based on the movement mode and the corresponding prefetch range. In this application, the server cluster will be updated based on the prefetched tile information retrieved by the prefetch retrieval, specifically including: determining the current reference server in the server cluster corresponding to the current first request group; and updating the second cache of the current reference server based on the prefetched tile information.

[0029] The above S3-1 to S3-3 describe the intelligent prefetching mechanism adopted in this application, which includes two methods. Method 1: Prefetching based on user behavior. Prefetching is for faster response. Usually, a user request contains only one tile's data, but the user does not actually only want to request a single tile, but rather requests the tile and the surrounding tiles. Therefore, this application, while retrieving the tile requested by the user, prefetches and stores the tiles within a certain range around the tile (including a certain range of x, y, and zoom (i.e., the tile coordinates and tile level of the surrounding tiles)) in L2, so that subsequent requests can be responded to more quickly. The prefetching process in this application includes: this application records the requested tile each time the user requests a tile (i.e., when the user requests a specific tile (the request includes the tile level zoom, column index x, and row index y), the timestamp and spatial coordinates (zoom, x, y) of this access are recorded) to analyze the user's tile reading movement pattern. This application uses a dictionary to store the access trajectories of all users. The key is the user ID, and the value is the user's access record (i.e., the timestamp and spatial coordinate of the accessed tile). An empty list is created for each user as an initial trajectory container, and the current access information is added to the end of the corresponding trajectory list in dictionary form (stored according to the reading frequency and direction of the read tile coordinates). Simultaneously, when recording each user's access / read records, this application maintains a certain number of recent access records (referred to as the first preset number, to distinguish it from other preset numbers below, e.g., 100 times). Old records are automatically truncated; when the number of records exceeds 100, only the last 100 are retained to avoid unlimited memory growth. This application comprehensively considers the LRU score; the older the record, the higher the score. When truncating old records, tile access records with higher comprehensive scores are deleted. The comprehensive score is obtained by combining the LRU and LFU scores, and different weights are assigned to the LRU and LFU scores when calculating the comprehensive score. During prefetching, this application predicts a second preset number of tiles. If the number of metadata corresponding to the first historical metadata of the target user is less than 2, prefetching is not performed because the first historical metadata is too small to accurately analyze the user's tile reading movement pattern. However, if the number of metadata corresponding to the first historical metadata of the target user is greater than or equal to 2, the target user's movement pattern is determined: that is, the target user's movement direction, movement speed (frequency), and movement distance (the tile distance between each adjacent tile read) are calculated (the tile movement characteristics (such as movement direction and movement speed) of the target user's most recently read tile are calculated). Candidate tiles are generated based on the movement direction and movement speed (specifically, based on the current tile coordinates (i.e., the spatial coordinates of the currently read tile), combined with the movement direction, movement speed, and movement distance in the movement pattern, adjacent tiles and their spatial coordinates are calculated and determined).Essentially, the displacement vector included in the movement pattern indicates the direction and distance of movement, while the time interval indicates the access frequency. This application calculates the Euclidean distance velocity `speed = math.sqrt(dx)` when determining the movement pattern. dx + dy dy) / dt, where dx is the difference in tile column index between two adjacent tile reads in the multiple first historical metadata records corresponding to the target user, dy is the difference in tile row index between two adjacent tile reads in the multiple first historical metadata records corresponding to the target user, and dt is the interval between two adjacent tile reads in the multiple first historical metadata records corresponding to the target user; then, the target user's movement pattern is analyzed based on the read history list corresponding to the multiple first historical metadata records corresponding to the target user. The read history list includes multiple read history data records, and each read history data record includes dx, dy, and speed.

[0030] It should be noted that during the prefetching retrieval process, this application obtains initial prefetched tile information and then verifies the validity of the spatial coordinates of each prefetched tile in the prefetched tile information (such as whether it exceeds the boundary). The validity verification rules can be preset, and this application does not impose any restrictions. At the same time, when the number of prefetched tiles in the prefetched tile information is greater than the preset number of prefetched tiles, this application will sort the multiple prefetched tiles from high to low according to the movement speed (which can be understood as, but is not limited to, the user's access frequency), and take the prefetched tile information of the multiple prefetched tiles with higher access frequency as the final prefetched tile information.

[0031] The second method of intelligent prefetching mechanism is prefetching based on spatial relationships. The logic of prefetching based on spatial relationships is as follows: taking the currently read tile as the center, generate the coordinates of all adjacent tiles within a specified radius (default 1), and asynchronously trigger the preloading operation; the spatial range of prefetching is formed by the offsets of dx and dy generated by a double loop (2 radius+1)X((2) radius+1).

[0032] Through the above-described embodiments of this application, it is possible to prefetch the tiles corresponding to the tiles requested by the user in the current request, thereby prefetching the tiles that the user may access next or in the future to achieve early caching, thereby improving the response speed when the user accesses the tiles next time and reducing cache stuttering.

[0033] As an optional implementation, a secondary retrieval is performed in the second cache of the server cluster using a multi-threaded approach based on multiple current request metadata and multiple historical request metadata. This includes: S1, obtaining the tile information and server priority stored by each of the multiple reference servers; S2, determining the matching degree between each second request group and the multiple reference servers based on the multiple tile information and multiple current request metadata. The server cluster includes multiple reference servers, each corresponding to one thread. The second request group is the request group among the multiple first request groups for which map tile data was not retrieved; S3, assigning a reference server to each second request group based on multiple matching degrees and multiple server priorities, and determining any second request group that has not undergone secondary retrieval as the current second request group, determining the historical request metadata corresponding to the current second request group as the second historical metadata, and determining the reference server corresponding to the current second request group as the current server; S4, performing a secondary retrieval in the second cache of the current server based on the current request metadata and the second historical metadata corresponding to the current second request group. Each reference server includes one second cache.

[0034] The operations in S1 to S4 above can be understood, but are not limited to, as using a multi-level caching + thread pool asynchronous processing architecture to efficiently handle tile read requests. Upon receiving a tile read request, the task is submitted asynchronously via the thread pool, and the process blocks while waiting for the result. In this application, the cache / storage layers are queried sequentially, and if a match is not found, the data is backfilled at each layer to ensure that frequently accessed data is retained in L1 as much as possible. If no map tile data corresponding to the tile read request is found in either L1 or L2, the application loads the original data from the storage manager (L3), identifies the loaded original data as map tile data, sends it to the corresponding client, and simultaneously backfills it into L1 and L2 (for pre-warming the cache and avoiding repeated access to slow storage). During updates, the application updates L1 and L2 based on the map tile data and updates L2 based on the pre-fetched tile data. The aforementioned matching degree is used to indicate the coverage of the tile data cached in the second cache of the reference server to the corresponding tiles in the second request group. The matching degree can be determined based on the coverage: if the second cache of the reference server caches all the tiles to be requested in the second request group, then the coverage is 100% and the matching degree is 1; if the second cache of the reference server caches 2 out of the 5 tiles to be requested in the second request group, then the coverage is 40% and the matching degree is 0.4. The matching degree can also be determined by: determining the bounding boxes corresponding to multiple current request metadata based on multiple current request metadata (the bounding box is a bounding box formed by all the tiles to be requested in the second request group, such as the minimum bounding box or the minimum bounding rectangle); determining the reference bounding boxes corresponding to multiple reference servers based on multiple tile information (the bounding boxes formed by the tiles contained in the multiple tile information); and determining the matching degree based on the volume ratio of the bounding box and the multiple reference bounding boxes.

[0035] The storage in S1 above can be understood as, but is not limited to, storage and caching. Each reference server includes a second cache (i.e., L2 above) and a storage database (i.e., L3 above). Each reference server has a server priority, which can be determined based on server performance, server load, and whether the tile information cached / stored within the server contains the tile information requested in the request group. Each reference server has a server matching degree for each second request group. When finally allocating a reference server to a second request group, it is done according to the reference server's priority and the matching degree between the reference server and the second request group. When multiple reference servers have the same server priority, allocation is based on the matching degree between the reference server and the second request group; when multiple matching degrees are the same, allocation is based on the server priority; when both the server priority and matching degree are different, a reference server is allocated to each second request group by combining preset server priority weights and matching degree weights.

[0036] When determining server priority, a server score is calculated. This score is determined by assigning individual scores to factors such as server load, network latency, and storage space (lower load, higher score; lower network latency, higher score; more storage space, higher score). A comprehensive score is then calculated based on these multiple scores, and the server priority is determined accordingly. When the server load is too high, this application will also migrate part of the load to other servers by creating shards on other servers, thereby balancing the server load.

[0037] The above S4 includes: S4-1, performing a secondary search in the second cache of the current server based on the current request metadata corresponding to the current second request group, and sending the map tile data to the corresponding client if the map tile data corresponding to the current second request group is found; S4-2, performing a prefetch search in the first cache of the target server and the second cache of the current server based on the second historical metadata to obtain prefetched tile information, and backfilling and updating the first cache and the second cache of the current server based on the prefetched tile information and map tile data. The operation in S4 can be understood, but is not limited to, as follows: if the target server's first cache does not find the data, a secondary search is performed in the second cache of the corresponding reference server. Furthermore, this application performs a prefetch search operation regardless of whether it is the initial search, the secondary search, or the subsequent tertiary search.

[0038] The aforementioned backfill update can be understood, but is not limited to, updating the retrieved prefetched tile information in the second cache of the current server, and updating the prefetch probability of the tile corresponding to the prefetched tile information. It can be understood that after performing prefetch retrieval and obtaining the prefetched tile information, the backfill update can be an update of the second cache of the current server or an update of the first cache of the target server, which can be set according to actual needs. This application does not impose any restrictions. However, this application adopts a preferred method of updating the second cache from the current server, because the first cache only caches frequently accessed tiles and those whose access time is closest to the current system time on the target server. However, the target server's cache space is limited and cannot cache too much tile data. If too much data is cached, it will affect the response to access. Therefore, this application will cache the prefetched tile information corresponding to the tile read request in the reference server corresponding to the tile read request. In this way, updating the reference server in the server can improve the matching degree between the reference server and the user's corresponding tile reading request when the user makes subsequent accesses. The map tile data can be used to update the tile data cached in the first cache of the target server. If the data in the map tile data is tile data already cached in the first cache, the access frequency (or reading frequency) of the corresponding tile data in the second cache can be updated. If the data in the map tile data is tile data not cached in the first cache, then the access frequency and tile reading timestamp of each tile in the map tile data can be determined by combining the tile coordinates, tile level, tile reading timestamp, etc. included in the map tile data to determine the tile data in the second cache or storage database of the current server, and the tile reading timestamp of each tile in the map tile data can be updated accordingly. This ensures that the first cache always stores tile data with high access frequency and access time closest to the current time.

[0039] The above S4 further includes: S4-3, if the map tile data corresponding to the current second request group is not found, and / or the prefetch tile information is not found, perform three searches in the storage database of the current server based on the current request metadata and the second historical metadata corresponding to the current second request group; S4-4, if the map tile data corresponding to the current second request group is found, send the map tile data to the corresponding client; S4-5, perform prefetch retrieval in the first cache of the target server, the second cache of the current server, and the storage database of the current server based on the second historical metadata to obtain the prefetch tile information; S4-6, backfill and update the first cache of the target server and the second cache of the current server based on the prefetch tile information and the map tile data.

[0040] S4-3 to S4-6 above can be understood, but is not limited to, that if the retrieval is unsuccessful in the first cache of the target server and the second cache of the current server and / or the prefetch retrieval is unsuccessful, three retrievals are performed in the storage database of the current server, and after the three retrievals are successful, the same sending and prefetching operations as above, as well as the backfilling and updating operations are performed.

[0041] Through S1-S4, this application can realize multi-level retrieval for multi-level cache, and can also realize multi-level tile prefetching operation for multi-level cache. Moreover, this method does not require a particularly complex storage architecture, solving the problems of complex storage architecture, high cost, and low storage and query performance in the prior art.

[0042] As an optional implementation, the above-mentioned prefetching retrieval of the target server's first cache and the current server's second cache based on the second historical metadata to obtain prefetched tile information includes: S1, counting the amount of metadata of the second historical metadata, and if the amount of metadata meets a preset number, determining the movement trajectory of the target user corresponding to the second historical metadata based on the second historical metadata, the movement trajectory including the target user's historical access coordinates and historical access timestamps; S2, determining the target user's movement pattern based on the second historical metadata; and predicting the prefetched tile information corresponding to the target user based on the movement pattern; S3, if the amount of metadata does not meet the preset number, determining the prefetched tile information based on the second historical metadata using a spatial adjacency method.

[0043] The above-mentioned preset quantity, for example, 3; the process of determining the movement pattern in S2 includes calculating the vector (dx, dy) and speed (distance / time) of each movement of the target user, using the DBSCAN clustering algorithm to cluster the movement vectors, identifying the movement direction (such as moving east, moving southeast), and then determining the movement pattern including the main direction vector, average speed and the spatial location of the last visited tile. The user behavior-based prefetching in this application can be understood, but is not limited to, as follows: if a user has a historical movement pattern (such as moving eastward, i.e., the amount of historical metadata is sufficient to analyze the user's movement pattern), then tiles extending along the main direction are used as candidate prefetch tiles. Then, based on the confidence level of the candidate prefetch tiles (calculated based on historical access frequency, directional consistency, and tile distance), the prefetch tile information of the final target number of prefetch tiles is determined from the candidate prefetch tiles. If the amount of metadata does not meet the preset number, then the movement pattern is determined as the preset movement pattern. For the preset movement pattern, this application will prioritize the selection of the prefetch tile information of a preset number of tiles around the current tile according to the Manhattan distance (such as the tile information of 8 tiles in the surrounding neighborhood).

[0044] The above-described implementation method, as described in this application, enables accurate prefetching retrieval for scenarios with sufficient historical data and scenarios with insufficient historical data, further improving and ensuring the response speed for subsequent accesses by users with or without historical access records.

[0045] As an optional implementation, the above-mentioned method for obtaining the server priority of multiple reference servers includes: S1, obtaining the server performance of each reference server, the cache load of the second cache and the storage load of the storage database in each reference server, and obtaining the current network latency; S2, determining the reference server priority of each reference server based on the multiple server performance, multiple cache loads and multiple storage loads; S3, obtaining the historical scheduling information corresponding to each reference server, and analyzing the historical scheduling effect of each reference server based on the historical scheduling information; S4, adjusting the priority of each reference server based on the multiple historical scheduling effects to obtain the server priority corresponding to each reference server.

[0046] When determining the priority of the reference server in S2 above, the priority can be determined based on the weight corresponding to each factor (server performance, cache load, storage load, etc.), or other methods can be used. This application does not limit this method. The above historical scheduling effect is used to indicate the response speed of each reference server in each previous (historical) access / read process of the user.

[0047] The above-described embodiments of this application can solve the problem of accurately determining and adjusting different reference servers in real time, so as to ensure that each server is in the optimal state for processing read requests.

[0048] As an optional implementation, before receiving tile read requests from multiple clients, the method further includes: S1, obtaining tile information corresponding to multiple tiles to be stored, and determining the spatial proximity of the multiple tiles to be stored based on the tile information; S2, obtaining the current system timestamp and the city / region information corresponding to each tile to be stored; S3, determining the access hotspot value of each tile to be stored under the current system timestamp based on the current system timestamp and the city / region information; S4, grouping the multiple tiles to be stored based on the access hotspot value and spatial proximity, and storing the multiple tiles to be stored and each tile to be stored in multiple layers based on the grouping results, wherein the multi-layer storage includes storage in the first cache in the target server and storage in the second cache in the server cluster.

[0049] The above S1 to S4 can be understood, but are not limited to, as the storage process when this application performs three-layer storage. The operations in the above S2 to S3 can be understood, but are not limited to, as determining whether each tile to be stored is in a peak access period under the current system timestamp. Whether it is in a peak access period is related not only to the city area information corresponding to the tile to be stored, but also to the current system timestamp. Therefore, the access hotspot value of each tile to be stored under the current system timestamp will be determined based on the current system timestamp and city area information. It is determined that when this application performs multi-layer storage, the tiles with high access frequency and high spatial proximity in the tile data to be stored will first be cached in the first cache of the target server. When the number of the first cache reaches the preset cache number, the tiles to be stored will be stored in the second cache of the corresponding reference server in the server cluster and the storage database according to the grouping result.

[0050] This application groups multiple tiles to be stored based on access hotspot values ​​and spatial proximity to obtain a first group corresponding to a first cache, a second group corresponding to a second cache, and a third group corresponding to a third cache. When storing in the first cache, this application calculates the overall score (i.e., the combined LRU and LFU score) of each tile in the first group, and, combined with a preset quantity, stores a preset number of tiles with lower overall scores in the first cache. When storing in the second cache, if there are remaining tiles in the first group, these are placed in the second group, and a Redis cluster connection is created. The tiles in the second group are serialized and compressed to obtain a compressed result. The compressed result is stored in Redis with an expiration time (TTL). When storing in the storage layer (L3), this application creates a storage directory and initializes a database connection pool. It then determines each tile in the third group... The data source includes MBTiles files and a file system. The storage method corresponding to the data source is determined based on the data source (MBTiles data sources use MBTiles format for tile-level storage, while file system data sources use a file system with a hierarchical directory structure). If the data source is an MBTiles file, the first tile details of the tile to be stored are obtained from the MBTiles file, along with the MBTiles file path. The MBTiles file and the corresponding first tile details are then stored in tiles according to the tile level (the specific tile-level method can use existing methods, and this application does not limit this) in the MBTiles file in L3. If the data source is a file system, the second tile details of the tile to be stored are obtained from the file system; the tile file path corresponding to each second tile detail is also obtained. Multiple second tile details are stored in the file directory of L3 using a directory hierarchy.

[0051] This application employs a three-level caching architecture for multi-level caching (the multi-level caching architecture creates and stores relevant tile data before receiving tile read requests). L1: Memory cache (used to store hot tile data (i.e., the most recently accessed tile data). This memory cache uses an improved LRU+LFU hybrid algorithm (combining the advantages of the two classic cache eviction policies, Least Recently Used (LRU) and Least Frequently Used (LFU), aiming to manage cache space more efficiently and improve cache hit rate. Its core idea is to dynamically adjust the eviction policy based on data access patterns, considering both data access time and frequency, as well as the spatial relationship of tiles (prefetching adjacent tiles)), and supports TTL (Time To Live). L1: Time to Live (TTL) expiration (TTL expiration means that a data packet or message is automatically discarded or deleted by the system after the set time to live. Its core function is to prevent the network from endlessly looping or accumulating data or messages), active expiration, and active real-time updates with access), hit rate > 80%; L2: Distributed storage (using Redis / Memcached cluster, based on consistent hashing distributed tile data, supporting data compression (reducing network transmission), supporting batch operations (reducing network round trips) and serialization), hit rate > 60%; L3: Storage layer (using distributed database, supporting storage of MBTiles files and multiple projections, supporting file indexing (for fast location), and also supporting multiple data sources (satellite images, street maps, topographic maps, etc.) and persistent storage), supporting data sharding and replication, and L1 and L2 can communicate with each other, and L2 and L3 can communicate with each other. When querying, L1 is checked first. If the result is found, the query result is returned. If the result is not found, L2 is checked (this means that the tile data did not originally appear in L1 (it was deleted, or it has not been accessed for a long time). If the result is found in L2, the tile data will be returned to the requester and populated back into L1 (i.e., L1 is updated). If the result is not found in L1 or L2, L3 is checked). When requesting a single tile, the tile number coordinates and tile level are included. When requesting multiple tiles, the tile number coordinates and their respective tile levels are included; or a tile range and the tile level corresponding to each tile range are included.

[0052] As an optional implementation, after updating the first cache and the current server's second cache based on the prefetched tile information, the method further includes: constructing or updating a tile semantic dependency graph, wherein the nodes of the tile semantic dependency graph are map nodes, and the edges are the semantic association weights between corresponding two tiles. The semantic association weights are determined based on at least one of the following indicators: spatial adjacency (the degree to which two map tiles are geographically adjacent or similar), hierarchical parent-child relationship (the inclusion relationship between upper and lower level tiles in a pyramid tile structure), historical co-access probability (the probability that two tiles are accessed consecutively or at close intervals in historical access records), and semantic category similarity. (The similarity of geographic features (POIs, roads, buildings, waterways, etc.) included in two tiles in terms of semantic categories); Based on the tile semantic dependency graph, semantic consistency analysis is performed on the tile set stored in the second cache of each reference server to determine the semantic clustering index corresponding to each second cache (measuring the degree of clustering of tiles stored in a cache partition on the semantic dependency graph); the second cache with a semantic clustering index lower than a preset clustering threshold is determined as the target cache, and the tiles stored in the target cache are migrated and adjusted according to the tile semantic dependency graph, so that the tile subsets stored in each second cache after adjustment form a high-cohesion subgraph in the tile semantic dependency graph. In addition, when it is detected that the tile data stored in the first cache is updated, the associated tile set affected by the update is determined based on the tile semantic dependency graph, and a cache invalidation notification is sent to the target reference server that stores the associated tiles to trigger the target reference server to update the cache consistency of the associated tiles.

[0053] It should be noted that the above-mentioned initial retrieval in the first cache of the target server based on multiple current request metadata also includes: obtaining the historical hit rate of the first cache of the target server, the historical hit rate of the second cache of each reference server, and the current network latency status to construct a current system state vector; inputting the current system state vector into a pre-trained retrieval strategy model, wherein the retrieval strategy model is a neural network model based on reinforcement learning, and its output is a retrieval action decision, which includes at least one of the following: querying only the first cache, querying the first and second caches in parallel, skipping the first cache and directly querying the second cache, and speculatively querying the storage database while querying the cache; executing the corresponding retrieval operation according to the retrieval action decision, and collecting the latency data and hit data of this retrieval operation as a reward signal, and incrementally updating the retrieval strategy model based on the reward signal, wherein the reward signal is obtained by weighting and summing the preset weight coefficients corresponding to the retrieval latency (the total time from the client sending a tile read request to receiving the tile data), the number of cache misses (the number of times the requested tile data is not found in the cache and the lower-level storage (second-level cache or database) needs to be queried), and the number of cache hits (the number of times the requested tile data is successfully found in the cache).

[0054] Through the above-described embodiments of this application, fast and accurate multi-layer storage of tile data can be achieved, enabling different regions to store different tile data. This application supports hundreds of thousands or even millions of concurrent connections, solving the problem of high-concurrency access pressure; it supports PB-level efficient storage and querying, optimizes tile data storage, improves caching efficiency, and achieves intelligent cache management and prefetching; it achieves space-aware load balancing and optimizes request scheduling. Simultaneously, this application reduces backend storage pressure through multi-level caching and fully utilizes multi-core CPU resources through parallel processing, increasing single-machine QPS from 10,000 to over 100,000. The solution implemented in this application reduces the average response time from 100ms to 20ms, and the prefetch accuracy during the prefetching process is >70%, reducing user waiting time, while adaptively adjusting strategies to adapt to different access patterns.

[0055] In addition to the effects mentioned above, this application also balances server load, achieving a load balancing rate of >90% and avoiding hot servers; optimizes spatial continuity to reduce cache duplication; dynamically adjusts strategies to adapt to traffic changes; supports heterogeneous server clusters; supports data sharding and replication, ensuring service is not affected by single points of failure; supports dynamic expansion without downtime; supports cross-data center deployment; provides automatic fault recovery with service availability >99.9%; supports petabyte-level data storage; supports multiple projections and multiple data sources; supports data compression, saving over 50% of storage space; and supports incremental updates and version management.

[0056] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0057] According to another aspect of the present invention, a parallel and efficient map tile management and distribution apparatus for implementing the above-described parallel and efficient map tile management and distribution method is also provided, such as... Figure 2 As shown, the device includes: a receiving unit 202, configured to receive tile reading requests sent by multiple clients, and parse the current request metadata and historical request metadata corresponding to each tile reading request from the multiple tile reading requests; an initial retrieval unit 204, configured to perform an initial retrieval in the first cache of the target server based on the multiple current request metadata, and send the map tile data to the corresponding client if the map tile data corresponding to the current request metadata is retrieved; and a secondary retrieval unit 206, configured to perform a secondary retrieval in the second cache of the server cluster using a multi-threaded approach based on the multiple current request metadata and multiple historical request metadata if the map tile data corresponding to the current request metadata is retrieved, and send the map tile data to the corresponding client if the map tile data corresponding to the current request metadata is retrieved.

[0058] The specific execution methods of each unit in the above device embodiments have been described in detail in the embodiments related to the method, and will not be elaborated further here. According to another aspect of the present invention, an electronic device for implementing a file upload method based on the HarmonyOS system is also provided. This electronic device can be a terminal device or a server. This embodiment uses a terminal device as an example for illustration. The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to cause the at least one processor to perform the steps in any of the above method embodiments. The electronic device can be located in at least one of a plurality of network devices in a computer network. The processor can be configured to execute the file upload method based on the HarmonyOS system through a computer program.

[0059] Optionally, those skilled in the art will understand that the structures described above are merely illustrative, and the electronic device may also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a PAD, or other terminal device. The above description does not limit the structure of the electronic device. For example, the electronic device may include more or fewer components (such as a network interface) or have a different configuration than described above.

[0060] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the parallel and efficient map tile management and distribution device in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the above-mentioned parallel and efficient map tile management and distribution method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. As an example, the above-mentioned memory may include, but is not limited to, the receiving unit 202, the initial retrieval unit 204, and the secondary retrieval unit 206 in the above-mentioned parallel and efficient map tile management and distribution device. In addition, it may include, but is not limited to, other module units in the above-mentioned parallel and efficient map tile management and distribution device, which will not be described in detail in this example. The above-mentioned transmission device is used to receive or send data via a network. Specific examples of the above-mentioned network may include wired networks and wireless networks. In one example, the transmission device includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 606 is a Radio Frequency (RF) module used for wireless communication with the Internet. Furthermore, the aforementioned electronic device also includes a display and a connection bus for connecting the various module components within the electronic device.

[0061] Obviously, those skilled in the art should understand that the various units or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using program code executable by a computing device.

[0062] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A parallel and efficient method for map tile management and distribution, characterized in that, include: Receive tile read requests sent by multiple clients, and parse the current request metadata and historical request metadata corresponding to each tile read request from the multiple tile read requests; An initial retrieval is performed in the first cache of the target server based on multiple current request metadata, and if map tile data corresponding to the current request metadata is retrieved, the map tile data is sent to the corresponding client; If the map tile data is not found, a second retrieval is performed in the second cache of the server cluster using a multi-threaded approach based on multiple current request metadata and multiple historical request metadata. If the map tile data corresponding to the current request metadata is found, the map tile data is sent to the corresponding client.

2. The method according to claim 1, characterized in that, An initial retrieval is performed in the first cache of the target server based on multiple current request metadata, including: The multiple tile read requests are grouped according to the multiple current request metadata and / or the multiple historical request metadata to obtain multiple first request groups; Any first request group that has not been searched for the first time is determined as the current first request group, the current request metadata corresponding to the current first request group is determined as the first request metadata, and the historical request metadata corresponding to the current first request group is determined as the first historical metadata. Based on the first request metadata and the first historical metadata, the map tile data corresponding to the first request group is initially retrieved from the first cache of the target server.

3. The method according to claim 2, characterized in that, After performing an initial retrieval of the map tile data corresponding to the first request group in the first cache of the target server based on the first request metadata and the first historical metadata, the method further includes: Identify multiple target users corresponding to the current first request group, and determine the movement mode corresponding to each target user based on the first historical metadata corresponding to each target user; Obtain the prefetch range corresponding to each of the aforementioned movement modes, and perform a prefetch retrieval corresponding to each tile read request in the current first request group based on the movement mode and the prefetch range to obtain prefetch tile information; The server cluster is updated based on the prefetched tile information, and if the prefetch retrieval does not find the prefetched tile information, a prefetch retrieval is performed in the second cache of the server cluster based on the movement mode and the prefetch range.

4. The method according to claim 2, characterized in that, Based on multiple current request metadata and multiple historical request metadata, a secondary retrieval is performed in the second cache of the server cluster using a multi-threaded approach, including: Obtain tile information and server priority stored by each of the multiple reference servers; The matching degree between each second request group and the multiple reference servers is determined based on multiple tile information and multiple current request metadata. The server cluster includes multiple reference servers, each of which corresponds to a thread. The second request group is a request group among the multiple first request groups for which map tile data has not been retrieved. The reference server is assigned to each second request group according to multiple matching degrees and multiple server priorities, and any second request group that has not been searched twice is determined as the current second request group, the historical request metadata corresponding to the current second request group is determined as the second historical metadata, and the reference server corresponding to the current second request group is determined as the current server. A secondary retrieval is performed in the second cache of the current server based on the current request metadata and the second historical metadata corresponding to the current second request group, wherein each reference server includes a second cache.

5. The method according to claim 4, characterized in that, A secondary retrieval is performed in the second cache of the current server based on the current request metadata and the second historical metadata corresponding to the current second request group, including: A secondary retrieval is performed in the second cache of the current server based on the current request metadata corresponding to the current second request group. If the map tile data corresponding to the current second request group is retrieved, the map tile data is sent to the corresponding client. Based on the second historical metadata, a prefetch retrieval is performed in the first cache of the target server and the second cache of the current server to obtain prefetched tile information, and the first cache and the second cache of the current server are backfilled and updated based on the prefetched tile information and the map tile data.

6. The method according to claim 5, characterized in that, The secondary retrieval in the second cache of the current server based on the current request metadata and the second historical metadata corresponding to the current second request group also includes: If the map tile data corresponding to the current second request group is not found, and / or the prefetched tile information is not found, three searches are performed in the storage database of the current server based on the current request metadata and the second historical metadata corresponding to the current second request group. If the map tile data corresponding to the current second request group is retrieved, the map tile data is sent to the corresponding client; Based on the second historical metadata, prefetch retrieval is performed in the first cache of the target server, the second cache of the current server, and the storage database of the current server to obtain prefetched tile information; The first cache of the target server and the second cache of the current server are backfilled and updated based on the prefetched tile information and the map tile data.

7. The method according to claim 5, characterized in that, Based on the second historical metadata, a prefetch retrieval is performed in the first cache of the target server and the second cache of the current server to obtain prefetched tile information, including: The number of metadata in the second historical metadata is counted, and if the number of metadata meets the preset number, the movement trajectory of the target user corresponding to the second historical metadata is determined based on the second historical metadata. The movement trajectory includes the target user's historical access coordinates and historical access timestamps. The movement pattern of the target user is determined based on the second historical metadata; and the prefetched tile information corresponding to the target user is predicted based on the movement pattern. If the amount of metadata does not meet the preset quantity, the prefetched tile information is determined by spatial adjacency based on the second historical metadata.

8. The method according to claim 4, characterized in that, Obtain the server priority of multiple reference servers, including: Obtain the server performance of each of the reference servers, the cache load of the second cache and the storage load of the storage database in each of the reference servers, and obtain the current network latency; The reference server priority of each reference server is determined based on the performance of the multiple servers, the cache load, and the storage load. Obtain historical scheduling information corresponding to each of the reference servers, and analyze the historical scheduling effect of each of the reference servers based on the historical scheduling information; The priority of each reference server is adjusted based on the historical scheduling results to obtain the server priority corresponding to each reference server.

9. The method according to claim 1, characterized in that, Before receiving tile read requests from multiple clients, it also includes: Obtain information about multiple tiles to be stored, and determine the spatial proximity of the multiple tiles to be stored based on the information about the multiple tiles to be stored. Obtain the current system timestamp and the city area information corresponding to each of the tiles to be stored; Based on the current system timestamp and the city area information, determine the access hotspot value of each tile to be stored under the current system timestamp; The multiple tiles to be stored are grouped according to the access hotspot value and the spatial proximity, and the multiple tiles to be stored and each tile to be stored are stored in multiple layers according to the grouping results. The multi-layer storage includes the storage of the first cache in the target server and the storage of the second cache in the server cluster.

10. The method according to claim 5, characterized in that, After backfilling and updating the first cache and the current server's second cache based on the prefetched tile information, the following steps are also included: Construct a tile semantic dependency graph, wherein the nodes of the tile semantic dependency graph are map tiles, and the edges are the semantic association weights between corresponding two tiles; Based on the tile semantic dependency graph, semantic consistency analysis is performed on the tile set stored in the second cache of each reference server to determine the semantic clustering index corresponding to each second cache. The second cache with a semantic clustering index lower than the preset clustering threshold is identified as the target cache, and the tiles stored in the target cache are migrated and adjusted according to the tile semantic dependency graph.