Grid-based time-series aggregation query methods, devices, equipment, and media

By generating regional grid index data and cache identifiers, the data query process across time periods and grid systems is optimized, solving the inefficiency problem caused by repeated matching and aggregation in existing technologies, and realizing efficient long-time series data query.

CN123068447APending Publication Date: 2026-11-10CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611221644.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies require repeated regional grid matching and data aggregation when querying fine-grained long-time-series data that spans time periods and grid systems, resulting in low query efficiency.

Method used

By generating regional grid index data, receiving data query requests, determining the target grid system data and query sub-period data, generating cache identifiers to retrieve cached aggregation results; if no cached aggregation results are retrieved, obtaining the grid time series data corresponding to each query sub-period, performing time and spatial dimension aggregation, generating regional sub-period aggregation data, and organizing the target aggregation results in chronological order.

Benefits of technology

It reduces redundant grid matching and data reading processing, and improves the query efficiency of long time-series grid data, especially significantly improving query efficiency in fintech and healthcare business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068447A_ABST
    Figure CN123068447A_ABST
Patent Text Reader

Abstract

This invention relates to the field of data query technology, and discloses a method, apparatus, device, and medium for aggregation query based on grid time series. The method includes: generating regional grid index data based on regional data and grid system data; receiving a data query request, determining the target grid system data and the query sub-period data, generating a cache identifier, and retrieving cached aggregation results; if no cached aggregation results are found, acquiring grid time series data, performing time and spatial dimension aggregation to generate regional sub-period aggregation data; organizing the regional sub-period aggregation data according to time order, generating the target aggregation result, writing it to the cache layer, and then sending it to the requesting end. This invention can be applied to business scenarios such as fintech and healthcare, reducing duplicate grid matching through regional grid indexing, processing cross-period data through segmented aggregation, and reusing existing results through caching, thereby improving the query efficiency of long-time-series grid data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data query technology, and in particular to a grid-based time-series aggregation query method, apparatus, device, and medium. Background Technology

[0002] Existing technologies for querying long-term time-series grid data for specific regions typically require repeated matching of region boundaries and grid cells during each query, and separate reading and aggregation of time-series data across time periods and grid systems. When the query time range is long or involves multiple grid systems, the amount of data location and aggregation processing increases significantly, resulting in low query efficiency for long-term time-series data in fine-grained regions.

[0003] In the fintech sector, insurance institutions need to query cross-year meteorological grid data by administrative village, insured area, or disaster-affected area when conducting agricultural insurance underwriting, risk assessment, and claims verification. Since different grid systems may be used for different historical periods, existing technologies require repeatedly determining the grid location of the area coverage and processing data from different time periods for each query, making it difficult to quickly complete long-term time-series data queries for fine-grained areas.

[0004] In the healthcare sector, medical and public health institutions need to query long-term environmental grid data by community, village, or healthcare service area when conducting regional disease surveillance, environmental exposure assessments, and health risk analyses. Existing technologies, when processing data across time periods and grid systems, also require repeated spatial location and temporal aggregation, resulting in low processing efficiency for querying long-term regional health data. Summary of the Invention

[0005] The main objective of this invention is to provide a grid-based time-series aggregation query method, apparatus, device, and storage medium, which aims to solve the technical problem that existing technologies require repeated regional grid matching and data aggregation when querying fine-grained long-time-series data across time periods and grid systems, resulting in low query efficiency.

[0006] To achieve the above objectives, the present invention provides an aggregation query method based on grid time series, comprising: Acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; Receive a data query request sent by the requesting end, and determine the target grid system data and the query sub-period data based on the data query request and the grid system data; A cache identifier is generated based on the data query request and the target grid system data. The cache aggregation result is retrieved from the cache layer according to the cache identifier. When the cache aggregation result is retrieved, the cache aggregation result is sent to the requesting end. When no cached aggregation results are found, the grid time series data corresponding to each query sub-period is obtained based on the data query request, the target grid system data, and the regional grid index data. Based on the data query request, the grid time series data is aggregated in the time dimension to generate grid time aggregated data. Based on the query sub-period data and the target grid system data, the grid time aggregated data is aggregated in the spatial dimension to generate regional sub-period aggregated data corresponding to each query sub-period. Organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

[0007] Furthermore, to achieve the above objectives, the present invention provides a grid-based time-series-based aggregation query device, comprising: The regional grid index generation module is used to acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; The grid time period matching module is used to receive data query requests sent by the requesting end, and determine the target grid system data and query sub-time period data based on the data query requests and the grid system data; The cache query module is used to generate a cache identifier based on the data query request and the target grid system data, retrieve cache aggregation results from the cache layer according to the cache identifier, and send the cache aggregation results to the requesting end when the cache aggregation results are retrieved. The time-series data reading module is used to obtain the grid time-series data corresponding to each query sub-period based on the data query request, the target grid system data, and the regional grid index data when no cached aggregation results are retrieved. The spatiotemporal aggregation module is used to perform time-dimensional aggregation on the grid time series data based on the data query request to generate grid time aggregated data, and to perform spatial-dimensional aggregation on the grid time aggregated data based on the query sub-period data and the target grid system data to generate regional sub-period aggregated data corresponding to each query sub-period. The aggregation result output module is used to organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a grid-based time-series aggregation query program stored in the memory and executable on the processor, wherein the grid-based time-series aggregation query program, when executed by the processor, implements the steps of the grid-based time-series aggregation query method as described above.

[0009] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a grid-based time-series aggregation query program, wherein the grid-based time-series aggregation query program, when executed by a processor, implements the steps of the grid-based time-series aggregation query method as described above.

[0010] Beneficial Effects: This invention relates to the field of data query technology, and discloses a method, apparatus, device, and medium for aggregation query based on grid time series. The method includes: generating regional grid index data based on regional data and grid system data; receiving a data query request, determining the target grid system data and query sub-time period data, and generating a cache identifier to retrieve cached aggregation results; if no cached aggregation results are found, acquiring the grid time series data corresponding to each query sub-time period, performing time-dimensional aggregation and spatial-dimensional aggregation to generate regional sub-time period aggregation data; organizing the regional sub-time period aggregation data according to time order, generating the target aggregation result, writing it to the cache layer, and then sending it to the requesting end. This invention can be applied to business scenarios such as fintech and healthcare. By reducing duplicate grid matching through regional grid indexing, processing cross-time period data through segmented aggregation, and reusing existing results through caching, it reduces the amount of data reading and repeated aggregation processing, thereby improving the query efficiency of long-time series grid data. Attached Figure Description

[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of an application environment for a grid-based time-series-based aggregation query method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an embodiment of the grid-based time-series aggregation query method of the present invention; Figure 3 for Figure 2 A detailed flowchart of step S10; Figure 4 for Figure 2 A detailed flowchart of step S20; Figure 5 for Figure 2 A detailed flowchart of step S30; Figure 6 for Figure 2A detailed flowchart of step S40; Figure 7 for Figure 2 A detailed flowchart of step S50; Figure 8 for Figure 2 A detailed flowchart of step S60; Figure 9 This is a schematic diagram of the functional modules of a preferred embodiment of the grid-based time-series aggregation query device of the present invention; Figure 10 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 11 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0012] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0013] The grid-based time-series-based aggregation query method provided in this invention can be applied to applications such as... Figure 1 In this application environment, the client communicates with the server via a network. The server can generate regional grid index data based on regional data and grid system data from the client; receive data query requests, determine the target grid system data and query sub-time period data, and generate a cache identifier to retrieve cached aggregation results; if no cached aggregation results are found, obtain the grid time-series data corresponding to each query sub-time period, perform time-dimensional aggregation and spatial-dimensional aggregation, and generate regional sub-time period aggregated data; organize the regional sub-time period aggregated data in chronological order, generate the target aggregation result, write it to the cache layer, and then send it to the requesting end. This invention can be applied to business scenarios such as fintech and healthcare. By reducing duplicate grid matching through regional grid indexing, processing cross-time period data through segmented aggregation, and reusing existing results through caching, it reduces the amount of data reading and duplicate aggregation processing, thereby improving the query efficiency of long-time-series grid data. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0014] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the grid-based time-series aggregation query method provided by the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0015] like Figure 2 As shown, the grid-based time-series-based aggregation query method proposed in this invention includes the following steps: S10, acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; In this embodiment, regional data can be provided by a spatial database, regional boundary database, or geographic information service interface, and the regional coverage is represented by closed coordinate sequences, planar geometric objects, or spatial masks. After reading the regional data, the coordinate integrity, boundary closure status, and geometric validity are checked, and duplicate coordinates, boundary breaks, or self-intersections are corrected. Grid system data can be provided by grid file metadata, data catalogs, or configuration libraries, and is used to represent the spatial arrangement, coverage, and spatial reference relationships of grid cells. When regional data and grid system data use different spatial references, they are converted into a data format that allows for spatial comparison, and then the inclusion, intersection, or coverage relationships between the regional coverage and each grid cell are determined. Based on the spatial comparison results, the grid positions corresponding to the same region are deduplicated and aggregated, and the correspondence between regions and grid positions is encoded as regional grid index data. Regional grid index data can be stored using index tables, key-value records, bitmaps, or compressed location sequences, where the index key is used to distinguish between regions and grid systems, and the index value is used to record the corresponding grid positions.

[0016] In cases where the region boundary has a complex shape and high accuracy requirements, a vector intersection method is used to determine the correspondence between the region and the grid cells. The region boundary is transformed to the spatial reference used by the grid system, grid cells that may intersect with the region boundary are screened, geometric intersection is determined for each grid cell boundary and the region boundary, and the locations of intersecting grid cells are written into the index record.

[0017] When there are a large number of regions with a fixed grid structure, a raster mask method is used to generate regional grid index data. The region boundaries are converted into mask data according to the spatial arrangement of the grid system. The grid positions covered by the region are extracted based on the effective positions in the mask, and the index results are saved through bitmaps or continuous position intervals to reduce the number of spatial comparisons and the amount of index data.

[0018] In the fintech business, agricultural insurance underwriting platforms can read administrative village boundaries and meteorological grid metadata, and collect the meteorological grid locations covered by administrative villages into regional grid index data, so that each insured area has a clear grid location record.

[0019] In the field of healthcare, public health management platforms can read community management boundaries and environmental monitoring grid data, determine the location of temperature, air quality or humidity grids covered by each community through vector intersection or raster masking, and form index records between community and environmental grids.

[0020] This embodiment improves the efficiency of determining the location of the region grid by pre-establishing the correspondence between the region and the grid location and forming the correspondence into directly searchable region grid index data. This reduces the processing workload caused by repeatedly performing region boundary verification, spatial reference conversion and grid intersection judgment.

[0021] S20, receive a data query request sent by the requesting end, and determine the target grid system data and the query sub-period data based on the data query request and the grid system data; In this embodiment, the requesting end can be a business application, a data interface, or a batch task program. The data query request carries query conditions such as region identifier, query time range, and data elements. Upon receipt, the request fields, time format, and time boundaries are validated, and the time data is converted into a unified time base.

[0022] The grid system data records the identifier and applicable time range of each grid system. Overlap between the query time range and each applicable time range is determined, and grid system data with overlapping time ranges are retained to form the target grid system data. When the query time range spans multiple grid systems, the query sub-periods are divided based on the time intersections, and each query sub-period is associated with its corresponding grid system. Time boundaries can use left-closed, right-open intervals to avoid duplicate assignment of the same time point; when applicable time ranges overlap, the corresponding grid system can be determined based on data version or preset priority.

[0023] When the applicable time ranges of each grid system are continuous and do not overlap, the target grid system data is filtered using the intersection of time intervals. The query time range is compared with each applicable time range, and the non-empty intersection is taken as the query sub-time period. The correspondence between the query sub-time period and the grid system identifier is recorded.

[0024] When the applicable time ranges of multiple grid systems overlap, a combination of priority filtering and time segmentation is used to determine the allocation. Priority is set according to data version, spatial resolution, or update time, and overlapping intervals are assigned to grid systems with higher priority, while the remaining time intervals are continued to be matched. If there are time intervals not covered by any grid system, a missing marker can be added to the corresponding interval.

[0025] In the fintech business, when insurance institutions conduct agricultural insurance underwriting risk assessments or claims verifications, data query requests may include administrative village identifiers and multi-year meteorological query time ranges. When multi-year meteorological data uses different grid systems, query sub-periods are divided according to the applicable time range of each grid system, and a correspondence between each query sub-period and the meteorological grid system is established.

[0026] In the healthcare sector, when public health management agencies conduct long-term analyses of community high-temperature exposure or air pollution, data query requests may include community identification and monitoring time range. When an environmental grid product undergoes a version switch, the target grid system data is determined based on the applicable time range of each version, and the monitoring time range is divided into corresponding query sub-periods.

[0027] This embodiment unifies the query time base and determines the target grid system data and query sub-period data based on the applicable time range of each grid system. This enables the query time range across grid systems to have clear time boundaries and grid affiliation, reducing grid system misselection, time overlap, and boundary duplication.

[0028] S30, generate a cache identifier based on the data query request and the target grid system data, retrieve the cache aggregation result from the cache layer according to the cache identifier, and send the cache aggregation result to the requesting end when the cache aggregation result is retrieved; In this embodiment, the format of the region identifier, query time range, feature type, aggregation granularity, and statistical method in the data query request is standardized, and the grid system identifier, data version, or applicable time period marker is read from the target grid system data. Each field is arranged in a fixed order, and the character encoding, time format, null value representation, and grid system identifier order are standardized to form a parameter sequence that can stably represent the content of a query. The parameter sequence is hashed or deterministically encoded to generate a cache identifier, ensuring that query requests with the same content and target grid system data receive the same identifier, while different identifiers are obtained when any field changes.

[0029] The caching layer uses a cache identifier as the retrieval key. Cache entries store the cached aggregation results corresponding to the queried content, and can include expiration dates, data versions, and write times. After retrieving a cached entry, the version information and validity status are verified. If the usage conditions are met, the cached aggregation results are read and serialized according to the data format supported by the requesting end before being sent. Cached aggregation results can be stored as structured records, time-series arrays, or compressed data blocks, and are restored to a data structure that the requesting end can parse before sending.

[0030] When the number of query parameters is fixed and the request frequency is high, a cache parameter sequence is generated using a fixed field order. The region identifier, query time range, feature type, aggregation granularity, statistical method, and sorted grid system identifier are sequentially concatenated. The concatenated result is hashed and encoded, and this encoded result serves as the cache identifier. The cache layer uses a key-value structure to store the cache aggregation results, and single-time location is completed based on the cache identifier.

[0031] When query fields can be expanded and the number of fields included in different requests varies, a normalized structure encoding is used to generate cache identifiers. Valid query fields and target grid system data are written into an ordered field set. Request and transmission markers that do not affect the query results are removed. The ordered field set is then deterministically serialized, and cache identifiers are generated again. Cache entries include a data version and expiration date; cache entries with inconsistent versions or that have exceeded their expiration date are not considered sendable results.

[0032] In the fintech business, when insurance institutions repeatedly conduct underwriting risk analysis or claims verification for the same administrative village, the same meteorological element, and the same statistical period, they generate cache identifiers for the query conditions and the target meteorological grid system. When valid regional meteorological aggregation results exist in the cache layer, the results are directly sent to the insurance business request end.

[0033] In the healthcare sector, when public health management agencies repeatedly conduct high-temperature exposure or air quality analyses for the same community, the same environmental element, and the same monitoring period, they generate cache identifiers based on regional conditions, temporal conditions, and the environmental grid system. After retrieving valid aggregated environmental data, the structured results are sent to the public health service requesting client.

[0034] This embodiment unifies the expression of query fields and target grid system fields, enabling the same query content to be stably mapped to the same cache identifier. The cache identifier is then used to directly locate the cached aggregation result, reducing redundant data location and aggregation processing and improving response efficiency in scenarios involving repeated queries and batch queries.

[0035] S40, when no cached aggregation result is found, obtain the grid time series data corresponding to each query sub-period based on the data query request, the target grid system data and the regional grid index data; In this embodiment, failure to retrieve cached aggregation results includes situations where the corresponding entry does not exist in the cache layer, the cached entry is invalid, or the cached content does not match the current query conditions. Based on the data query request, the target region, query time range, and feature type are read. The data storage location, data format, and feature fields corresponding to each query sub-time period are determined based on the target grid system data. Finally, the grid position of the target region under each target grid system is read based on the regional grid index data.

[0036] Each query sub-period defines a data reading range. The time range is determined by the query sub-period, the spatial range by the grid location, and the feature range by the correspondence between feature types and fields in the target grid system. Grid data is read according to the time range, spatial range, and feature range, and the grid location, timestamps, and feature values ​​are retained to form grid time-series data associated with each query sub-period. When different query sub-periods correspond to different target grid systems, the corresponding data storage locations and field structures are used for reading to avoid data mixing across grid systems.

[0037] When grid data is stored in separate files according to time, a file location and range reading method is used to obtain the grid time series data. The grid data file to be accessed is determined based on the query sub-time period, the row and column positions are determined based on the regional grid index data, only the data of the target feature at the corresponding time and row and column positions are read, and the results are collected and read according to the query sub-time period.

[0038] When grid data is stored as a block array or object, a data block location method is used to obtain grid time-series data. Target data blocks are determined based on the query sub-period, grid location, and feature fields. Multiple target data blocks are read in parallel, and grid point data from each data block within the same query sub-period are merged. When a data block contains irrelevant grid locations, only the grid locations indicated by the regional grid index data are retained.

[0039] In the fintech business sector, after the insurance business client initiates a multi-year precipitation data query for an administrative village, it can read the precipitation grid time series data for each query sub-period based on the grid location corresponding to the administrative village and the meteorological grid system used in each historical period. This data is then used for underwriting risk analysis or claims verification.

[0040] In the field of healthcare, after a public health management platform initiates a multi-year temperature or air quality data query for a community, it can read the time series data of environmental grid points within each query sub-period based on the community's corresponding environmental grid location and the data version for different time periods, for data preparation for regional environmental exposure analysis.

[0041] This embodiment determines the time range and feature range through data query requests, determines the data location and field structure through target grid system data, and directly determines the spatial reading location through regional grid index data. This can reduce the amount of reading irrelevant time, irrelevant features, and irrelevant grid data, and enable each query sub-period across grid systems to obtain the corresponding grid time series data, thereby improving the efficiency of reading long time series data.

[0042] S50, based on the data query request, the grid time series data is aggregated in the time dimension to generate grid time aggregated data, and based on the query sub-period data and the target grid system data, the grid time aggregated data is aggregated in the spatial dimension to generate regional sub-period aggregated data corresponding to each query sub-period. In this embodiment, the time aggregation granularity and statistical method in the data query request are used to determine the time window and the data processing scope within the window. The grid time series data includes grid location, timestamp, and feature value. It is grouped according to grid location, and then each feature value is assigned to the corresponding time window according to the timestamp. The data in the same grid location and the same time window are processed by accumulation, mean, extreme value, or count to generate grid time aggregated data.

[0043] The query sub-period data is used to distinguish different time ranges, while the target grid system data is used to determine the grid spatial structure corresponding to each query sub-period. Grid time aggregation data within the same query sub-period and the same time window are spatially grouped according to grid location. This can be done using an equal-weighting method or by setting spatial weights based on the coverage of grid cells within the region. After weighted aggregation of the data at each grid location, regional sub-period aggregation data associated with the query sub-period is formed.

[0044] When the grid spatial resolution is high and the coverage area of ​​each grid cell within a region is similar, an equal-weight aggregation method is used to summarize the grid temporal aggregation data within the same time window. Each grid location is assigned the same weight, and after normalization, a weighted average is applied. This method is suitable for scenarios where boundary grids have minimal impact on the regional results.

[0045] In situations where the grid spatial resolution is low and there is significant overlap between the region boundary and grid cells, an area-weighted aggregation method is adopted. The spatial weight is determined based on the coverage area of ​​each grid cell within the region. The grid time aggregation data under the same query sub-period and the same time window are weighted and summarized to reduce the bias of the boundary grid on the regional results.

[0046] In the field of fintech business, when agricultural insurance institutions query the precipitation data of administrative villages over many years, they can accumulate the precipitation time series data of each meteorological grid location by year or month, and then generate regional sub-period aggregated data based on the spatial weight of each grid location within the administrative village, which is used for underwriting risk assessment and disaster loss verification.

[0047] In the field of healthcare, when public health management agencies conduct community high-temperature exposure analysis, they can perform mean or extreme value processing on the temperature time series data of each environmental grid location on a daily basis, and then spatially summarize the grid time aggregation data within the community to form the community temperature aggregation results corresponding to each monitoring sub-period.

[0048] This embodiment generates grid time-aggregated data by grid location and time window, and then performs regional aggregation according to query sub-time periods and grid spatial relationships. This can compress the amount of time-series data before spatial processing and make data under different grid systems form regional results respectively, thereby improving the aggregation efficiency of long-time-series grid data and regional statistical consistency.

[0049] S60, organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

[0050] In this embodiment, the query sub-period data records the time boundaries of each query sub-period and their correspondence with the regional sub-period aggregated data. The regional sub-period aggregated data are arranged according to the start time of each sub-period, and the time window, feature type, and statistical results corresponding to each aggregated value are retained, ensuring that data generated by different grid systems are organized along a unified time axis. When only one regional sub-period aggregated data is included, this data is encapsulated as the target aggregated result; when multiple regional sub-period aggregated data are included, they are sequentially concatenated according to time boundaries, and duplicate boundaries of adjacent sub-periods are removed to form a continuous target aggregated result.

[0051] The cache identifier serves as the retrieval key for the target aggregation result within the cache layer. The target aggregation result is converted into structured data or compressed data blocks, mapped to the cache identifier, and then written to the cache entry. After writing, the target aggregation result is converted into a data format supported by the requesting client and sent to the requesting client via the data interface.

[0052] When the query time range corresponds to only one sub-period, a direct encapsulation method is used to generate the target aggregation result. The aggregated data of the regional sub-period is arranged according to the time window, written into the result object, and the result object is saved with the cache identifier as the retrieval key, reducing unnecessary concatenation operations.

[0053] When the query time range spans multiple query sub-periods, a stable sorting and segmented concatenation method is used to generate the target aggregation result. The aggregated data for each query sub-period is arranged according to its start time, and the segmented data is concatenated according to a unified time interval boundary. Duplicate time records are deduplicated, and the aggregation value corresponding to each time window is retained. When the data volume is large, the target aggregation result is serialized into blocks and written to the cache layer. Upon transmission, the complete result is restored according to the block order.

[0054] In the field of fintech business, when insurance institutions query cross-year precipitation aggregation data of administrative villages, they can arrange the regional sub-period aggregation data formed by different meteorological grid periods according to year and month, generate continuous target aggregation results, write them into the cache layer and send them to the underwriting risk analysis or claims verification request end.

[0055] In the field of healthcare, when public health management agencies query community high-temperature exposure data over many years, they can organize community temperature aggregate data according to the query sub-period corresponding to the environmental grid version, form a continuous time series, write it into the cache layer, and send it to the regional health risk analysis request terminal.

[0056] This embodiment organizes regional sub-time period aggregated data according to the time order of the query sub-time periods, which can form a target aggregated result with continuous time and clear grid source. By establishing a mapping between the cache identifier and the target aggregated result and writing it into the cache layer, the same query can directly reuse the existing results, reduce repeated organization and transmission processing, and improve the result return efficiency.

[0057] In one embodiment, such as Figure 3 As shown, step S10 above includes: S101, acquire regional data and grid system data, wherein the regional data includes target region identifier and spatial boundary vector data, and the grid system data includes grid system identifier, coordinate system, grid start point coordinates and spatial resolution; S102, convert the spatial boundary vector data of each target area to the coordinate system of each grid system, and generate the grid boundary data of each target area in each grid system; S103, Based on the grid starting point coordinates and the spatial resolution, determine the candidate grid range corresponding to each grid boundary data, and determine the grid row and column number covered by each target area under each grid system according to the intersection relationship between each grid boundary data and each grid cell within the corresponding candidate grid range; S104: Collect the grid row and column numbers covering the same target area under the same grid system according to the grid position order, and generate a list of grid row and column numbers; S105, associate the target area identifier, the grid system identifier, and the grid row and column number list to generate a regional grid index record, summarize the regional grid index records, and generate regional grid index data.

[0058] In this embodiment, the target region identifier in the region data is used to distinguish different spatial objects and serves as the region retrieval field in the region grid index record. The spatial boundary vector data uses closed coordinate sequences, planar geometric objects, or composite planar geometric objects to represent the spatial extent of the target region. After reading the spatial boundary vector data, the order of coordinate points, boundary closure status, geometric validity, and spatial reference information are verified. Duplicate coordinate points, unclosed boundaries, and self-intersecting boundaries are corrected to ensure that the region boundary can participate in subsequent coordinate transformations and spatial intersection judgments.

[0059] Grid system identifiers are used to distinguish grid datasets with different spatial structures. Coordinate systems are used to determine the spatial reference for grid coordinates, grid start coordinates are used to determine the reference position for grid row and column arrangement, and spatial resolution is used to represent the size of a single grid cell along the coordinate axis. Grid system data can also be combined with the row and column increment direction and effective coverage to determine the actual position of grid cells, avoiding row and column positioning deviations caused by differences in coordinate axis direction or spatial units.

[0060] When spatial boundary vector data and the grid system use different coordinate systems, the boundary coordinates are transformed point by point to the corresponding grid system's coordinate system according to coordinate transformation parameters, while maintaining the connectivity between boundary points, thus generating grid boundary data. Grid boundary data is generated separately for each target region and for each grid system, enabling the same target region to independently determine its coverage location in grid structures with different spatial references and resolutions. After coordinate transformation, the extent, closure state, and geometric validity of the grid boundary data are verified to eliminate abnormal boundaries caused by transformation errors.

[0061] Based on the outer bound of the grid boundary data, the grid start coordinates, and the spatial resolution, the coordinates of the boundary range are converted into candidate start row and column numbers and candidate end row and column numbers to form candidate grid ranges. The candidate start position is rounded outwards to retain grid cells near the boundary, while the candidate end position is rounded to cover the upper limit of the boundary, avoiding omission of grid cells intersecting with the region edge. When a candidate grid range exceeds the effective coverage of the grid system, the excess portion is truncated to the effective row and column range.

[0062] The spatial boundaries of each grid cell within the candidate grid area are generated based on the grid start coordinates, spatial resolution, and corresponding grid row and column numbers. Geometric intersection is performed between each grid cell boundary and the corresponding grid boundary data. Grid cells with area intersection, boundary intersection, or that meet preset coverage conditions are identified as grid cells to be covered by the target area, and their corresponding grid row and column numbers are recorded. For grid cells that only touch at the boundary, their inclusion can be determined based on spatial accuracy requirements; for partially covered grid cells, the intersection area or coverage ratio can be added to preserve the spatial relationship between the region boundary and the grid cell.

[0063] The grid row and column numbers obtained for the same target area under the same grid system are deduplicated and arranged according to row priority, column priority, or spatial encoding order to generate a list of grid row and column numbers. When the grid row and column numbers are consecutive, they can be stored using row and column intervals or compressed integer sequences; when the grid positions are discrete, they can be stored using ordered position sets. The sorted list of grid row and column numbers maintains a stable data arrangement, avoiding different index contents for the same area and the same grid system due to different traversal orders.

[0064] The target region identifier, grid system identifier, and grid row and column number list are written into the regional grid index record according to their correspondence. The target region identifier and grid system identifier are used together to uniquely identify an index record, and the grid row and column number list is used to record the corresponding set of spatial locations. Regional grid index records from different target regions and different grid systems are aggregated to form regional grid index data. Regional grid index data can be stored using index tables, key-value records, or compressed index files, ensuring a clear correspondence between the target region and the grid positions in different grid systems.

[0065] This embodiment transforms spatial boundary vector data to the coordinate system of each grid system and narrows down the candidate grid range to be judged by using grid starting coordinates and spatial resolution, which can reduce the number of irrelevant grid cells involved in spatial intersection judgment. By collecting and associating target area identifiers, grid system identifiers and grid row and column number lists, a stable spatial correspondence between the target area and each grid system can be pre-formed, thereby reducing the processing load caused by subsequent repeated coordinate transformation, grid positioning and geometric intersection judgment, and improving the efficiency and consistency of determining the location of the regional grid.

[0066] In one embodiment, such as Figure 4 As shown, step S20 above includes: S201, Receive a data query request sent by the requesting end, extract the query start time and query end time from the data query request, and generate a query time range based on the query start time and the query end time; S202, Extract the grid system identifier and applicable time period corresponding to each grid system from the grid system data; S203, compare the query time range with each applicable time period, and determine the grid system data corresponding to the applicable time period that overlaps with the query time range as the target grid system data; S204, determine the overlapping time range between the query time range and the applicable time period in the data of each target grid system, and determine each overlapping time range as the query sub-time period corresponding to the data of each target grid system; S205 associates each query sub-time period with the corresponding grid system identifier to generate query sub-time period data.

[0067] In this embodiment, the requesting end submits a data query request through a data interface, carrying the query start time and query end time. Upon receiving the request, the data type, time precision, time zone information, and chronological order of the time field are verified. Time values ​​in different formats are converted to a unified time base, and it is confirmed that the query start time is no later than the query end time. The query start time and query end time together define the continuous time interval to be queried, forming the query time range. The time interval can be represented using a closed interval or a semi-open interval. Boundary rules are kept consistent throughout the same processing to avoid omissions or duplicates of boundary moments.

[0068] The grid system identifier in the grid system data is used to distinguish grid data sets with different spatial structures, data sources, or data versions. The applicable time period records the time range within which the corresponding grid system can provide valid data. After reading each grid system identifier and applicable time period, the time format and interval boundaries of the applicable time periods are standardized to enable direct comparison between each applicable time period and the query time range. Records in the grid system data that do not have a valid applicable time period configured or whose applicable time periods are abnormal are not included in the time overlap judgment.

[0069] The query time range is intersected with each applicable time period separately. If the end boundary of the query time range is not earlier than the start boundary of the applicable time period, and the start boundary of the query time range is not later than the end boundary of the applicable time period, the two time ranges overlap. Grid system data corresponding to overlapping applicable time periods are retained as target grid system data; grid system data without overlap are excluded. When the query time range overlaps with only one applicable time period, the target grid system data contains one grid system; when the query time range spans multiple applicable time periods, the target grid system data contains multiple grid systems.

[0070] Each query sub-period is obtained by intersecting the query time range with the applicable time period in the corresponding target grid system data. The starting boundary of the query sub-period is the later of the query start time and the applicable time period start time, and the ending boundary is the earlier of the query end time and the applicable time period end time. The resulting query sub-periods fall within the query time range and do not exceed the applicable time period of the corresponding grid system. When multiple applicable time periods overlap, the overlapping time ranges corresponding to each target grid system are retained; when adjacent applicable time periods connect at the same boundary, a unified interval opening and closing method is used to eliminate boundary duplication.

[0071] Each query sub-time period is associated with the grid system identifier that generated it. The association includes at least the sub-time period's start time, end time, and grid system identifier. The association results are organized according to time boundaries or grid system identifiers to generate query sub-time period data. The query sub-time period data clearly records each time interval after the query time range is divided and the corresponding grid system for each time interval, avoiding confusion regarding the applicable time relationships of different grid systems.

[0072] This embodiment uses a unified query time range and the time base of the applicable time period of each grid system, and uses the interval overlap relationship to filter the target grid system data, which can exclude grid systems that are not related to the query time. By finding the intersection of the query time range and each applicable time period, and associating each query sub-time period with the grid system identifier, query sub-time period data with clear time boundaries and clear grid affiliation can be formed, reducing time mismatch, boundary duplication and data range confusion in cross-grid system queries.

[0073] In one embodiment, such as Figure 5 As shown, step S30 above includes: S301, extract the target area identifier, query start time, query end time, element type, time aggregation granularity and statistical method from the data query request, generate a query time range based on the query start time and the query end time, and extract the grid system identifier of each grid system from the target grid system data; S302, arrange the grid system identifiers according to a preset order, and combine the target area identifier, the query time range, the feature type, the time aggregation granularity, the statistical method, and the arranged grid system identifiers according to a preset field order to generate a cache parameter sequence; S303, perform hash processing on the cache parameter sequence to generate a cache identifier; S304, Match cache entries in the cache layer according to the cache identifier. When a cache entry is matched, read the cache aggregation result and cache validity period from the cache entry, and obtain the current time. S305, when the current time is within the cache validity period, send the cache aggregation result to the requesting end; S306, when no cached entry is matched, or when a cached entry is matched but the current time is not within the cache validity period, it is determined that no cached aggregation result was retrieved.

[0074] In this embodiment, the target region identifier, query start time, query end time, feature type, time aggregation granularity, and statistical method are read from the data query request. The target region identifier is used to distinguish the spatial object targeted by the query; the query start time and query end time are unified by time format, time zone, and time precision to form the query time range; the feature type is used to distinguish the category of data to be queried; the time aggregation granularity is used to distinguish the requirement of organizing data by day, month, or other time scales; the statistical method is used to distinguish the result format such as cumulative, average, extreme value, or count. The identifiers of each grid system are read from the target grid system data to ensure that the cached content is consistent with the grid systems participating in the query.

[0075] Each grid system identifier is sorted according to a preset order to avoid different cache parameter sequences arising from different reading orders within the same group of grid systems. The target area identifier, query time range, feature type, time aggregation granularity, statistical method, and sorted grid system identifiers are combined according to a fixed field order. During the combination process, character encoding, time format, null value format, and field separator format can be standardized. Alternatively, a structured serialization method can be used to save field names, field lengths, and field values ​​to prevent different field combinations from generating identical sequences.

[0076] The cache parameter sequence is hashed and converted into a fixed-length cache identifier. The same query conditions and target grid system data generate the same cache identifier; changes in any participating field generate different cache identifiers. The cache identifier serves as the retrieval key for the cache layer, used to locate the cache entry storing the cache aggregation result. The cache layer can employ in-memory key-value storage, distributed key-value storage, or local cache files. Each cache entry must at least store the cache aggregation result and the cache expiration date.

[0077] After a cached entry is matched, the cache aggregation result and cache expiration date are read, and the current time is collected. The cache expiration date can be represented by the expiration time or a valid time range. When the current time is within the cache expiration date, the cache aggregation result is converted into a data format supported by the requesting client and sent to the requesting client. If no cached entry is matched, or the current time has exceeded the cache expiration date, the search status is determined as no cache aggregation result was retrieved, so expired data will not be sent as the current query result.

[0078] This embodiment, by unifying the arrangement and encoding of query fields and grid system identifiers, can ensure that the same query content consistently generates the same cache identifier. By directly locating cache entries through cache identifiers and filtering available results in conjunction with cache validity periods, the processing volume caused by repeated retrieval and aggregation can be reduced. At the same time, it avoids sending expired cache results, thereby improving the response efficiency and result validity of repeated queries.

[0079] In one embodiment, such as Figure 6As shown, step S40 above includes: S401, extract the target area identifier and feature type from the data query request, and extract the grid system identifier, grid data file location and feature mapping relationship of each target grid system from the target grid system data; S402, based on the target area identifier and the grid system identifier of each target grid system, match the area grid index record in the area grid index data, and read the grid row and column number list corresponding to each target grid system from each area grid index record; S403, based on the query sub-period data, determine the target grid system corresponding to each query sub-period; according to the grid data file location of the target grid system corresponding to each query sub-period, determine the grid data file corresponding to each query sub-period; and based on the feature type and the feature mapping relationship of the target grid system corresponding to each query sub-period, determine the feature field identifier corresponding to each query sub-period. S404 generates a time reading range corresponding to each query sub-period based on each query sub-period, generates spatial reading location data corresponding to each query sub-period based on the grid row and column number list of the target grid system corresponding to each query sub-period, and combines the grid data file, time reading range, spatial reading location data and feature field identifier corresponding to each query sub-period to generate a data reading task corresponding to each query sub-period. S405, based on the grid data file, time reading range, spatial reading location data and feature field identifier in the data reading task corresponding to each query sub-period, read the grid point time series data corresponding to each query sub-period, collect the grid point time series data according to each query sub-period, and generate the grid time series data corresponding to each query sub-period.

[0080] In this embodiment, "no cache aggregation result found" includes situations where the cache layer does not have a cache entry matching the cache identifier, or where a matched cache entry has exceeded its expiration date. The target region identifier in the data query request is used to determine the spatial region corresponding to the data to be read, and the feature type is used to indicate the category of data to be read. The grid system identifier in the target grid system data is used to distinguish data sets with different spatial structures, the grid data file location is used to locate the data storage object, and the feature mapping relationship is used to establish the correspondence between feature types and fields within the file. The grid data file location can be represented by a file path, object storage address, partition directory, or path template, and the feature field identifier can be represented by a variable name, band number, data column identifier, or data layer identifier.

[0081] Using the target region identifier and the identifiers of each grid system as joint matching criteria, the regional grid index records are searched from the regional grid index data. Each regional grid index record records the grid locations covered by a target region under a grid system. After matching, the corresponding list of grid row and column numbers is read. The list of grid row and column numbers can be saved as an ordered set of row and column numbers, a continuous range of row and column numbers, or a compressed position sequence. After reading, boundary checks and duplicate position removal are performed to ensure that the spatial read position is within the valid row and column range of the corresponding grid system.

[0082] The query sub-period data records the association between each query sub-period and the target grid system. Based on this association, the location of the grid data file, feature mapping relationship, and grid row and column number list of the corresponding target grid system are selected for each query sub-period. When grid data files are stored according to time partitions, one or more grid data files to be accessed are determined based on the overlap between the query sub-period and the file time partitions; when using path templates for storage, the time field in the query sub-period is substituted into the path template to generate the specific file location. The corresponding field is searched in the feature mapping relationship based on the feature type to determine the data reading fields for each query sub-period.

[0083] The start and end boundaries of the query sub-period constitute the time reading range, and the grid row and column number list is converted into spatial reading location data. The spatial reading location data can be organized by continuous row and column intervals or by discrete grid locations, allowing the reading operation to skip grid cells outside the target area. Grid data files, time reading ranges, spatial reading location data, and feature field identifiers are combined by query sub-period to form independent data reading tasks. When a query sub-period involves multiple files, the file set and the corresponding time segments for each file can be recorded within the same data reading task to avoid reading data beyond the query sub-period.

[0084] When there is no data write dependency between data reading tasks, parallel reading is performed using concurrent threads, asynchronous input / output, or distributed task units. The reading range is constrained by the time reading range, spatial reading location data, and feature field identifiers, extracting only grid point data corresponding to the time, grid location, and feature. The reading results retain the grid row and column numbers, timestamps, and feature values, and are aggregated according to the query sub-period. When the same query sub-period involves multiple files or data blocks, they are merged based on the timestamps, and duplicate records are removed to form the grid time-series data corresponding to each query sub-period.

[0085] This embodiment directly matches the regional grid index records by using the target region identifier and the grid system identifier, which avoids repeatedly making spatial judgments about the region boundary and grid cells. By defining the reading range together by the grid data file, time reading range, spatial reading location data, and feature field identifier, the amount of data read from irrelevant files, irrelevant time periods, irrelevant grid locations, and irrelevant fields can be reduced. By reading the data reading tasks of each query sub-time period in parallel, the reading time of grid time-series data across time periods and grid systems can be shortened, while maintaining an accurate correspondence between each query sub-time period and the target grid system.

[0086] In one embodiment, such as Figure 7 As shown, step S50 above includes: S501, extract the target region identifier, time aggregation granularity and statistical method from the data query request, extract the target spatial boundary vector data from the region data based on the target region identifier, and extract the coordinate system, grid start coordinates and spatial resolution of each target grid system from the target grid system data, wherein the spatial resolution is characterized by the grid cell size; S502, based on the query sub-period data, determine each query sub-period, divide time windows within each query sub-period according to the time aggregation granularity, read grid row and column numbers and time series time markers from the grid time series data corresponding to each query sub-period, group the grid time series data according to the grid row and column numbers, and assign the grouped grid time series data to the time window corresponding to each time series time marker according to each time series time marker, and generate time grouping data associated with each query sub-period, each time window and each grid row and column number; S503, Perform statistical processing on the time group data according to the statistical method to generate grid time aggregate data associated with each query sub-period, each time window and each grid row and column number; S504, for each target mesh system, the spatial resolution of the target mesh system is compared with the corresponding preset resolution threshold. When the spatial resolution is less than or equal to the preset resolution threshold, the same initial spatial weight is set for each mesh row and column number corresponding to the target mesh system. When the spatial resolution is greater than the preset resolution threshold, the target spatial boundary vector data is converted to the coordinate system of the target mesh system. Each mesh cell is determined based on the mesh start coordinates, the spatial resolution, and each mesh row and column number corresponding to the target mesh system. The intersection area between each mesh cell and the converted target spatial boundary vector data is determined, and each intersection area is set as the initial spatial weight corresponding to each mesh row and column number. S505, normalize each initial spatial weight corresponding to each target grid system to generate spatial weight data corresponding to each target grid system; S506, based on the query sub-period data, determine the target grid system corresponding to each query sub-period. According to the grid row and column number, associate the grid time aggregation data corresponding to the same query sub-period and the same time window with the spatial weight data of the target grid system corresponding to the query sub-period. Based on the spatial weight corresponding to each grid row and column number, perform weighted summation on the grid time aggregation data corresponding to each grid row and column number under the same query sub-period and the same time window to generate regional sub-period aggregation data corresponding to each query sub-period.

[0087] In this embodiment, the target region identifier, time aggregation granularity, and statistical method are read from the data query request. The target region identifier is used to locate a unique spatial object in the regional data; the time aggregation granularity is used to determine the length and boundaries of the time window, which can be set according to days, ten-day periods, months, quarters, or custom time intervals; the statistical method is used to determine the processing caliber of each element value within the time window, which can be cumulative, average, maximum, minimum, or valid record count. After the query parameters are formatted and validated, the time aggregation granularity and statistical method remain consistent across all query sub-periods.

[0088] Retrieve region data based on the target region identifier, and read the spatial boundary vector data associated with the target region identifier to form the target spatial boundary vector data. The target spatial boundary vector data can consist of a single planar object, multiple mutually separated planar objects, or composite planar objects containing internal voids. After reading, check the coordinate sequence closure and geometric validity, and correct for duplicate coordinates, boundary breaks, and self-intersection positions to ensure that the boundary data can participate in coordinate transformation and area intersection calculations.

[0089] The coordinate system, grid start coordinates, and spatial resolution of each target grid system are read from the target grid system data. The coordinate system is used to determine the grid spatial reference, the grid start coordinates are used to determine the reference position for row and column arrangement, and the spatial resolution is expressed by the size of the grid cell along the coordinate axis. When different target grid systems use different spatial units, the spatial resolution and the corresponding preset resolution threshold are standardized to ensure that resolution comparison has a consistent measurement basis.

[0090] Each query sub-period is determined based on the query sub-period data, and time windows are divided within each query sub-period according to the time aggregation granularity. The time window boundaries adopt a consistent open and closed interval form. When adjacent time windows share a boundary, only the boundary time marker is assigned to one of the time windows. When the remaining time of a query sub-period is less than a complete time window, the remaining time can be set as an independent end time window, so that the grid time series data within the query sub-period all have a clear time assignment.

[0091] In gridded time-series data, grid row and column numbers are used to distinguish different spatial locations, while time-series time stamps are used to determine the time window to which each feature value belongs. Gridded time-series data is grouped according to grid row and column numbers, and then each group is assigned to its corresponding time window based on the time-series time stamps, forming time-grouped data that can be simultaneously linked and queried based on sub-periods, time windows, and grid row and column numbers. When duplicate time records exist within the same time window for the same grid row and column number, duplicates can be removed based on the time stamps; records lacking valid feature values ​​are not included in the corresponding statistics.

[0092] Data for each time group is processed using statistical methods. Cumulative processing sums the valid feature values ​​within the time window; averaging processing generates an average result based on the valid feature values ​​and their quantities; extreme value processing selects the maximum or minimum value from the valid feature values; and counting processing counts the number of records that meet the data validity criteria. The processing results are associated with the query sub-period, time window, and grid row and column numbers to form grid time aggregated data, ensuring that each grid position retains an aggregated value corresponding to the statistical method within each time window.

[0093] For each target grid system, the spatial resolution is compared with a corresponding preset resolution threshold. When the spatial resolution is less than or equal to the preset resolution threshold, the grid cell size is smaller, and the same initial spatial weight is assigned to the row and column numbers of each grid participating in spatial aggregation under that target grid system. The same initial spatial weight ensures that each grid location has a consistent participation ratio in the region results.

[0094] When the spatial resolution exceeds a preset resolution threshold, the target spatial boundary vector data is transformed to the coordinate system of the target grid system, preserving the connection relationships and planar structure of the transformed boundary points. Based on the grid starting point coordinates, spatial resolution, and the row and column numbers of each grid cell, the spatial boundary of the corresponding grid cell is determined. The area intersection operation is performed between each grid cell and the transformed target spatial boundary vector data. The intersection area is used as the initial spatial weight for the corresponding grid row and column numbers, ensuring that grid cells with larger coverage areas within the region receive a higher participation ratio, while partially covered boundary grids receive a participation ratio commensurate with their coverage area.

[0095] The initial spatial weights of each target grid system are normalized separately. For the same target grid system, the initial spatial weight of each grid row and column number is proportionally converted to the total initial spatial weight of all initial spatial weights under that target grid system to form spatial weight data. Different target grid systems are not merged for normalization to avoid changes in the weight distribution within each query sub-period due to differences in the number of grids and spatial resolution.

[0096] Based on the query sub-period data, the target grid system for each query sub-period is determined. Grid time aggregation data within the same query sub-period and time window are associated with corresponding spatial weight data according to the grid row and column numbers. Each grid time aggregation value is weighted according to the spatial weight corresponding to the same grid row and column number. The weighted results for the same query sub-period and time window are then summarized to generate regional sub-period aggregation data. Regional sub-period aggregation data retains the correlation between query sub-periods, time windows, and statistical methods, ensuring that regional results generated by different target grid systems maintain their respective time ranges and spatial weight calibers.

[0097] This embodiment aggregates grid time-series data by time dimension according to grid row and column numbers and time windows, which can reduce the number of data records involved in processing before spatial aggregation. By selecting equal weighting or area weighting methods according to spatial resolution and performing weight normalization in each target grid system, fine-grained grids can reduce area intersection operations, and coarse-grained grids can participate in aggregation according to the actual coverage of the region. By querying the correspondence between sub-time periods and target grid systems to generate regional sub-time period aggregated data, data mixing between different grid structures can be reduced, improving the aggregation efficiency of long-time-series grid data and the accuracy of regional statistics.

[0098] In one embodiment, such as Figure 8 As shown, step S60 above includes: S601, extract the start time and end time of each query sub-period from the query sub-period data; S602, Sort the aggregated data of each region's sub-time according to the order of the start time of each sub-time, and generate an aggregated data sequence; S603, when the aggregated data sequence includes aggregated data for one regional sub-period, the aggregated data for the regional sub-period is determined as the target aggregation result; when the aggregated data sequence includes aggregated data for multiple regional sub-periods, the splicing position is determined according to the sub-period end time corresponding to the previous regional sub-period aggregated data and the sub-period start time corresponding to the next regional sub-period aggregated data, and the aggregated data for each regional sub-period in the aggregated data sequence is spliced ​​according to each splicing position to generate the target aggregation result; S604, extract the data update cycle of each target grid system from the target grid system data, determine the shortest data update cycle among the data update cycles as the cache validity period, obtain the cache write time, determine the cache validity period based on the cache write time and the cache validity period, and write the cache identifier, the target aggregation result and the cache validity period into the cache entry; S605, write the cache entry into the cache layer and send the target aggregation result to the requesting end.

[0099] In this embodiment, the time boundaries of each queried sub-time period and their correspondence with the regional sub-time period aggregated data are recorded in the query sub-time period data. After reading the start time and end time of the sub-time period, the time format, time zone and time precision are unified, and the start time is verified to be no later than the end time, so that the regional sub-time period aggregated data generated by different target grid systems can be arranged under the same time base.

[0100] The aggregated data for regional sub-periods are stably sorted from earliest to latest according to the start time of the sub-period. When the start times of sub-periods are the same, a fixed sorting order can be determined based on the end time of the sub-period or the grid system identifier to avoid different results due to different writing order of the same data. Each data item after sorting retains its corresponding time boundary, time window, and aggregate value, forming an aggregated data sequence.

[0101] When the aggregated data sequence contains only one regional sub-time period aggregated data, that data is directly encapsulated as the target aggregation result. When the aggregated data sequence contains multiple regional sub-time period aggregated data, the sub-time period end time and sub-time period start time corresponding to two adjacent data items are read, and the end position of the previous data item and the access position of the next data item are determined accordingly. When adjacent time boundaries are continuous, they are directly concatenated according to the time window order; when boundary times are repeated, one boundary position is retained to avoid the same time window from appearing repeatedly; when there is a time interval between adjacent sub-time periods, the original time range of each data item is maintained, and unaggregated data is not added. After concatenation, the target aggregation result saves each time window and its aggregation value in a unified time order.

[0102] The data update cycle represents the time interval at which data content in each target grid system is updated or rewritten. When multiple target grid systems participate in a query, the shortest data update cycle is selected as the cache validity period, ensuring that existing cached results become invalid promptly when any target grid system reaches its update time. The cache write time is the actual time when a cache entry is written to the cache layer; the cache validity period is determined based on the cache write time and the cache validity period.

[0103] Cache entries use a cache identifier as the retrieval key, the target aggregation result as the cache content, and record the cache expiration time. The target aggregation result can be converted into a structured byte sequence or compressed data block before writing, and the cache expiration time can be recorded as the expiration time. After the cache entry is completely written to the cache layer, the target aggregation result is serialized according to the data format supported by the requesting end and sent to the requesting end through the data interface.

[0104] This embodiment arranges and splices the aggregated data of regional sub-time periods according to the time boundaries of the query sub-time periods, which can form a target aggregation result with a clear time order and non-repeating boundaries; by determining the effective duration of the cache with the shortest data update cycle, the cache period can be kept consistent with the grid data with a high update frequency; by writing the cache identifier, target aggregation result and cache validity period into the cache entry, the target aggregation result can be directly reused within the validity period, reducing the processing volume caused by repeatedly organizing regional sub-time period aggregated data and improving the return efficiency of query results.

[0105] In one embodiment, in the historical meteorological risk assessment scenario for agricultural insurance, insurance institutions integrate national administrative village boundary data with meteorological grid data from multiple historical periods into a unified data service platform. The administrative village boundary data includes village identifiers and village polygonal boundaries. The meteorological grid data uses spatial resolutions of 1 km, 3 km, and 10 km for different historical periods and is stored in NetCDF (Network Common Data Format) files. Each grid system registers its grid system identifier, applicable start and end dates, coordinate system, grid start coordinates, spatial resolution, meteorological file storage path, and meteorological element mapping relationships, enabling precipitation, temperature, and wind speed data from different periods to be located according to the corresponding grid structure.

[0106] For each administrative village, the village's polygonal boundary is transformed to the coordinate system of each grid system. Based on the grid's starting coordinates and spatial resolution, the candidate grid range that the village boundary might cover is determined, and the intersection of grid cells within the candidate range with the village boundary is assessed. All grid row and column numbers covered by the same village under the same grid system are deduplicated and sorted according to grid location, stored as an array field as a list of grid row and column numbers. The village identifier, grid system identifier, and the list of grid row and column numbers are then written into a single regional grid index record. Thus, only one index record is retained for each administrative village under a single grid system, eliminating the need to pre-generate extensive statistical results based on village, date, and meteorological indicators. When village administrative divisions are adjusted or the grid system is updated, only the index record for the affected area is regenerated.

[0107] When insurance institutions conduct agricultural insurance underwriting risk assessments, premium rate calculations, or post-disaster claims verification, the requesting party submits a data query request. For example, a request to query the cumulative rainfall in July of each year for a specific administrative village over the past thirty years might include the village identifier, query start date, query end date, rainfall element type, annual time aggregation granularity, and summation method. The data service platform compares the query time range with the applicable time periods of each grid system, selects target grid systems with overlapping time periods, and divides the query time range into query sub-periods corresponding to 1km, 3km, and 10km grids, respectively. Each query sub-period is associated with the corresponding grid system identifier, ensuring that long-term queries spanning multiple meteorological grid versions have a clear time range and data source.

[0108] The village identifier, query time range, meteorological element type, time aggregation granularity, statistical method, and sorted target grid system identifier are combined into a cache parameter sequence according to a fixed field order. This cache parameter sequence is then hashed to generate a cache identifier. If a cache entry matching the cache identifier exists and has not exceeded its validity period, the village-level cache aggregation result is directly read and sent to the insurance business request end to display risk assessment results or support claims review. If no valid cache entry is found, the regional grid index records are queried based on the village identifier and each target grid system identifier to retrieve the list of grid row and column numbers corresponding to the village under each target grid system.

[0109] Based on the target grid system associated with each query sub-period, the NetCDF file storage path and meteorological element mapping relationship are read from the target grid system data, and the precipitation element type is converted into variable field identifiers within the file. The time reading range is determined by the query sub-period, and the spatial reading location is determined by the grid row and column number list. The grid data file, time reading range, spatial reading location, and variable field identifiers are combined into a data reading task. The data reading task for each query sub-period accesses the corresponding NetCDF file in parallel, extracting only the daily precipitation values ​​of the village coverage grid locations within the query period, while retaining the timestamp and grid row and column numbers, forming grid time-series data corresponding to each query sub-period.

[0110] For each grid row and column number, daily precipitation values ​​are grouped by year and July time window. Effective precipitation values ​​within the same grid location and the same July of the same year are summed to generate the cumulative July precipitation for each grid location. If the query is for high-temperature days, the daily maximum temperature is read, and the number of days meeting the temperature conditions within each time window is calculated according to the temperature conditions set for insurance business. After time-dimensional aggregation, spatial-dimensional aggregation is performed based on the grid system corresponding to each query sub-period. For high-resolution grids such as 1km, the same initial spatial weight is set for each grid location; for coarse-grained grids such as 10km, the initial spatial weight is set based on the intersection area of ​​the grid cell and the village polygon boundary. The initial spatial weights within each target grid system are normalized, and then the aggregated values ​​of each grid location under the same query sub-period and the same year time window are weighted and summarized to form village-level regional sub-period aggregated data.

[0111] The aggregated data for each regional sub-period is arranged according to the start time of the queried sub-period. When the query involves only one grid system, the regional sub-period aggregated data directly forms the target aggregated result. When the query spans multiple grid systems, the splicing position is determined based on the start and end times of adjacent queried sub-periods, and the village-level aggregated data from each historical period are spliced ​​in chronological order to form a complete 30-year annual July cumulative precipitation sequence. The data service platform selects the shortest update cycle from the data update cycles of each target grid system as the cache validity period, determines the cache validity period based on the cache write time, and writes the cache identifier, target aggregated result, and cache validity period into the cache entry. After the target aggregated result is sent to the insurance business request end, it can be used for administrative village underwriting risk classification, insurance premium adjustment, disaster impact analysis, claims condition verification, and regional insurance portfolio risk assessment.

[0112] In one embodiment, a grid-based time-series aggregation query device is provided, which corresponds one-to-one with the grid-based time-series aggregation query method described in the above embodiments. (Refer to...) Figure 9 , Figure 9 This is a schematic diagram of the functional modules of a preferred embodiment of the grid-based time-series aggregation query device of the present invention. The grid-based time-series aggregation query device includes: a regional grid index generation module 10, a grid time period matching module 20, a cache query module 30, a time-series data reading module 40, a spatiotemporal aggregation module 50, and an aggregation result output module 60. Detailed descriptions of each functional module are as follows: The regional grid index generation module 10 is used to acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data. The grid time period matching module 20 is used to receive a data query request sent by the requesting end, and determine the target grid system data and the query sub-time period data based on the data query request and the grid system data. The cache query module 30 is used to generate a cache identifier based on the data query request and the target grid system data, retrieve cache aggregation results from the cache layer according to the cache identifier, and send the cache aggregation results to the requesting end when the cache aggregation results are retrieved. The time-series data reading module 40 is used to obtain the grid time-series data corresponding to each query sub-period based on the data query request, the target grid system data, and the regional grid index data when no cached aggregation result is retrieved. The spatiotemporal aggregation module 50 is used to perform time-dimensional aggregation on the grid time series data based on the data query request to generate grid time aggregated data, and to perform spatial-dimensional aggregation on the grid time aggregated data based on the query sub-period data and the target grid system data to generate regional sub-period aggregated data corresponding to each query sub-period. The aggregation result output module 60 is used to organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate a target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

[0113] In one embodiment, the region grid index generation module 10 is specifically used for: Acquire regional data and grid system data. The regional data includes target region identifier and spatial boundary vector data. The grid system data includes grid system identifier, coordinate system, grid start coordinates, and spatial resolution. The spatial boundary vector data of each target region are transformed to the coordinate system of each grid system to generate the grid boundary data of each target region in each grid system. Based on the grid starting point coordinates and the spatial resolution, the candidate grid range corresponding to each grid boundary data is determined. Based on the intersection relationship between each grid boundary data and each grid cell within the corresponding candidate grid range, the grid row and column numbers covered by each target region under each grid system are determined. The grid row and column numbers covering the same target area under the same grid system are collected in order of grid location to generate a list of grid row and column numbers; Associate the target area identifier, the grid system identifier, and the grid row and column number list to generate a regional grid index record. Summarize the regional grid index records to generate regional grid index data.

[0114] In one embodiment, the grid time period matching module 20 is specifically used for: Receive a data query request sent by the requesting end, extract the query start time and query end time from the data query request, and generate a query time range based on the query start time and query end time; Extract the grid system identifier and applicable time period corresponding to each grid system from the grid system data; The query time range is compared with each applicable time period, and the grid system data corresponding to the applicable time period that overlaps with the query time range is determined as the target grid system data. Determine the overlapping time range between the query time range and the applicable time period in the data of each target grid system, and determine each overlapping time range as the query sub-time period corresponding to the data of each target grid system; Each query sub-time period is associated with its corresponding grid system identifier to generate query sub-time period data.

[0115] In one embodiment, the cache query module 30 is specifically used for: Extract the target area identifier, query start time, query end time, feature type, time aggregation granularity, and statistical method from the data query request; generate a query time range based on the query start time and the query end time; and extract the grid system identifier of each grid system from the target grid system data. Arrange the grid system identifiers according to a preset order, and combine the target area identifier, the query time range, the feature type, the time aggregation granularity, the statistical method, and the arranged grid system identifiers according to a preset field order to generate a cache parameter sequence; The cache parameter sequence is hashed to generate a cache identifier; The cache entry is matched in the cache layer according to the cache identifier. When a cache entry is matched, the cache aggregation result and cache validity period are read from the cache entry, and the current time is obtained. When the current time is within the cache validity period, the cache aggregation result is sent to the requesting end; If no cached entry is matched, or if a cached entry is matched but the current time is not within the cache validity period, it is determined that no cached aggregation result was retrieved.

[0116] In one embodiment, the timing data reading module 40 is specifically used for: Extract the target region identifier and feature type from the data query request, and extract the grid system identifier, grid data file location and feature mapping relationship of each target grid system from the target grid system data; Based on the target region identifier and the grid system identifier of each target grid system, the region grid index record is matched in the region grid index data, and the list of grid row and column numbers corresponding to each target grid system is read from each region grid index record; Based on the query sub-period data, the target grid system corresponding to each query sub-period is determined. According to the grid data file location of the target grid system corresponding to each query sub-period, the grid data file corresponding to each query sub-period is determined. Based on the feature type and the feature mapping relationship of the target grid system corresponding to each query sub-period, the feature field identifier corresponding to each query sub-period is determined. Based on each query sub-period, a time reading range corresponding to each query sub-period is generated. Based on the grid row and column number list of the target grid system corresponding to each query sub-period, spatial reading location data corresponding to each query sub-period is generated. The grid data file, time reading range, spatial reading location data and feature field identifier corresponding to each query sub-period are combined to generate a data reading task corresponding to each query sub-period. Based on the grid data file, time reading range, spatial reading location data, and feature field identifier in the data reading task corresponding to each query sub-period, the grid point time series data corresponding to each query sub-period is read, and the grid point time series data is collected according to each query sub-period to generate the grid time series data corresponding to each query sub-period.

[0117] In one embodiment, the spatiotemporal aggregation module 50 is specifically used for: Extract the target region identifier, time aggregation granularity and statistical method from the data query request; extract the target spatial boundary vector data from the region data based on the target region identifier; extract the coordinate system, grid start coordinates and spatial resolution of each target grid system from the target grid system data; the spatial resolution is characterized by the grid cell size. Based on the query sub-period data, each query sub-period is determined. Time windows are divided within each query sub-period according to the time aggregation granularity. The grid row and column numbers and time stamps are read from the grid time series data corresponding to each query sub-period. The grid time series data is grouped according to the grid row and column numbers. The grouped grid time series data is assigned to the time window corresponding to each time stamp according to each time stamp. Time grouping data associated with each query sub-period, each time window, and each grid row and column number is generated. The statistical data of each time group is statistically processed according to the statistical method described above to generate grid time aggregate data associated with each query sub-period, each time window and each grid row and column number; For each target mesh system, the spatial resolution of the target mesh system is compared with the corresponding preset resolution threshold. When the spatial resolution is less than or equal to the preset resolution threshold, the same initial spatial weight is set for each mesh row and column number corresponding to the target mesh system. When the spatial resolution is greater than the preset resolution threshold, the target spatial boundary vector data is converted to the coordinate system of the target mesh system. Each mesh cell is determined based on the mesh start coordinates, the spatial resolution, and each mesh row and column number corresponding to the target mesh system. The intersection area between each mesh cell and the converted target spatial boundary vector data is determined, and each intersection area is set as the initial spatial weight corresponding to each mesh row and column number. The initial spatial weights corresponding to each target grid system are normalized to generate spatial weight data corresponding to each target grid system. Based on the query sub-period data, the target grid system corresponding to each query sub-period is determined. According to the grid row and column number, the grid time aggregation data corresponding to the same query sub-period and the same time window is associated with the spatial weight data of the target grid system corresponding to the query sub-period. Based on the spatial weight corresponding to each grid row and column number, the grid time aggregation data corresponding to each grid row and column number under the same query sub-period and the same time window is weighted and summarized to generate the regional sub-period aggregation data corresponding to each query sub-period.

[0118] In one embodiment, the aggregation result output module 60 is specifically used for: Extract the start and end times of each sub-period from the query sub-period data; The aggregated data for each region's sub-time period is sorted according to the order of the start times of each sub-time period, generating an aggregated data sequence; When the aggregated data sequence includes aggregated data for one regional sub-period, the aggregated data for that regional sub-period is determined as the target aggregation result; when the aggregated data sequence includes aggregated data for multiple regional sub-periods, the splicing position is determined based on the sub-period end time corresponding to the previous regional sub-period aggregated data and the sub-period start time corresponding to the next regional sub-period aggregated data, and the aggregated data for each regional sub-period in the aggregated data sequence is spliced ​​according to each splicing position to generate the target aggregation result; Extract the data update cycle of each target grid system from the target grid system data, determine the shortest data update cycle among the data update cycles as the cache validity period, obtain the cache write time, determine the cache validity period based on the cache write time and the cache validity period, and write the cache identifier, the target aggregation result and the cache validity period into the cache entry; The cached entries are written into the cache layer, and the target aggregation result is sent to the requesting end.

[0119] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides deterministic and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements server-side functions or steps of a grid-based time-series aggregate query method.

[0120] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a grid-based time-series aggregation query method.

[0121] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; Receive a data query request sent by the requesting end, and determine the target grid system data and the query sub-period data based on the data query request and the grid system data; A cache identifier is generated based on the data query request and the target grid system data. The cache aggregation result is retrieved from the cache layer according to the cache identifier. When the cache aggregation result is retrieved, the cache aggregation result is sent to the requesting end. When no cached aggregation results are found, the grid time series data corresponding to each query sub-period is obtained based on the data query request, the target grid system data, and the regional grid index data. Based on the data query request, the grid time series data is aggregated in the time dimension to generate grid time aggregated data. Based on the query sub-period data and the target grid system data, the grid time aggregated data is aggregated in the spatial dimension to generate regional sub-period aggregated data corresponding to each query sub-period. Organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

[0122] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, and a computer program is stored thereon, which, when executed by a processor, performs the following steps: Acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; Receive a data query request sent by the requesting end, and determine the target grid system data and the query sub-period data based on the data query request and the grid system data; A cache identifier is generated based on the data query request and the target grid system data. The cache aggregation result is retrieved from the cache layer according to the cache identifier. When the cache aggregation result is retrieved, the cache aggregation result is sent to the requesting end. When no cached aggregation results are found, the grid time series data corresponding to each query sub-period is obtained based on the data query request, the target grid system data, and the regional grid index data. Based on the data query request, the grid time series data is aggregated in the time dimension to generate grid time aggregated data. Based on the query sub-period data and the target grid system data, the grid time aggregated data is aggregated in the spatial dimension to generate regional sub-period aggregated data corresponding to each query sub-period. Organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

[0123] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0124] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0126] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0127] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A grid-based time-series-based aggregation query method, characterized in that, Includes the following steps: Acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; Receive a data query request sent by the requesting end, and determine the target grid system data and the query sub-period data based on the data query request and the grid system data; A cache identifier is generated based on the data query request and the target grid system data. The cache aggregation result is retrieved from the cache layer according to the cache identifier. When the cache aggregation result is retrieved, the cache aggregation result is sent to the requesting end. When no cached aggregation results are found, the grid time series data corresponding to each query sub-period is obtained based on the data query request, the target grid system data, and the regional grid index data. Based on the data query request, the grid time series data is aggregated in the time dimension to generate grid time aggregated data. Based on the query sub-period data and the target grid system data, the grid time aggregated data is aggregated in the spatial dimension to generate regional sub-period aggregated data corresponding to each query sub-period. Organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

2. The grid-based time-series-based aggregation query method as described in claim 1, characterized in that, Acquire regional data and grid system data, and generate regional grid index data based on the regional data and grid system data, including: Acquire regional data and grid system data. The regional data includes target region identifier and spatial boundary vector data. The grid system data includes grid system identifier, coordinate system, grid start coordinates, and spatial resolution. The spatial boundary vector data of each target region are transformed to the coordinate system of each grid system to generate the grid boundary data of each target region in each grid system. Based on the grid starting point coordinates and the spatial resolution, the candidate grid range corresponding to each grid boundary data is determined. Based on the intersection relationship between each grid boundary data and each grid cell within the corresponding candidate grid range, the grid row and column numbers covered by each target region under each grid system are determined. The grid row and column numbers covering the same target area under the same grid system are collected in order of grid location to generate a list of grid row and column numbers; Associate the target area identifier, the grid system identifier, and the grid row and column number list to generate a regional grid index record. Summarize the regional grid index records to generate regional grid index data.

3. The grid-based time-series-based aggregation query method as described in claim 1, characterized in that, Receiving a data query request from the requesting end, and determining the target grid system data and the query sub-period data based on the data query request and the grid system data, including: Receive a data query request sent by the requesting end, extract the query start time and query end time from the data query request, and generate a query time range based on the query start time and query end time; Extract the grid system identifier and applicable time period corresponding to each grid system from the grid system data; The query time range is compared with each applicable time period, and the grid system data corresponding to the applicable time period that overlaps with the query time range is determined as the target grid system data. Determine the overlapping time range between the query time range and the applicable time period in the data of each target grid system, and determine each overlapping time range as the query sub-time period corresponding to the data of each target grid system; Each query sub-time period is associated with its corresponding grid system identifier to generate query sub-time period data.

4. The aggregation query method based on grid time series as described in claim 1, characterized in that, A cache identifier is generated based on the data query request and the target grid system data. A cache aggregation result is retrieved from the cache layer according to the cache identifier. When the cache aggregation result is retrieved, it is sent to the requesting end, including: Extract the target area identifier, query start time, query end time, feature type, time aggregation granularity, and statistical method from the data query request; generate a query time range based on the query start time and the query end time; and extract the grid system identifier of each grid system from the target grid system data. Arrange the grid system identifiers according to a preset order, and combine the target area identifier, the query time range, the feature type, the time aggregation granularity, the statistical method, and the arranged grid system identifiers according to a preset field order to generate a cache parameter sequence; The cache parameter sequence is hashed to generate a cache identifier; The cache entry is matched in the cache layer according to the cache identifier. When a cache entry is matched, the cache aggregation result and cache validity period are read from the cache entry, and the current time is obtained. When the current time is within the cache validity period, the cache aggregation result is sent to the requesting end; If no cached entry is matched, or if a cached entry is matched but the current time is not within the cache validity period, it is determined that no cached aggregation result was retrieved.

5. The grid-based time-series-based aggregation query method as described in claim 1, characterized in that, When no cached aggregation result is found, based on the data query request, the target grid system data, and the regional grid index data, the grid time series data corresponding to each query sub-period is obtained, including: Extract the target region identifier and feature type from the data query request, and extract the grid system identifier, grid data file location and feature mapping relationship of each target grid system from the target grid system data; Based on the target region identifier and the grid system identifier of each target grid system, the region grid index record is matched in the region grid index data, and the list of grid row and column numbers corresponding to each target grid system is read from each region grid index record; Based on the query sub-period data, the target grid system corresponding to each query sub-period is determined. According to the grid data file location of the target grid system corresponding to each query sub-period, the grid data file corresponding to each query sub-period is determined. Based on the feature type and the feature mapping relationship of the target grid system corresponding to each query sub-period, the feature field identifier corresponding to each query sub-period is determined. Based on each query sub-period, a time reading range corresponding to each query sub-period is generated. Based on the grid row and column number list of the target grid system corresponding to each query sub-period, spatial reading location data corresponding to each query sub-period is generated. The grid data file, time reading range, spatial reading location data and feature field identifier corresponding to each query sub-period are combined to generate a data reading task corresponding to each query sub-period. Based on the grid data file, time reading range, spatial reading location data, and feature field identifier in the data reading task corresponding to each query sub-period, the grid point time series data corresponding to each query sub-period is read, and the grid point time series data is collected according to each query sub-period to generate the grid time series data corresponding to each query sub-period.

6. The aggregation query method based on grid time series as described in claim 1, characterized in that, Based on the data query request, the grid time series data is aggregated in the time dimension to generate grid time aggregated data. Then, based on the query sub-period data and the target grid system data, the grid time aggregated data is aggregated in the spatial dimension to generate regional sub-period aggregated data corresponding to each query sub-period, including: Extract the target region identifier, time aggregation granularity and statistical method from the data query request; extract the target spatial boundary vector data from the region data based on the target region identifier; extract the coordinate system, grid start coordinates and spatial resolution of each target grid system from the target grid system data; the spatial resolution is characterized by the grid cell size. Based on the query sub-period data, each query sub-period is determined. Time windows are divided within each query sub-period according to the time aggregation granularity. The grid row and column numbers and time stamps are read from the grid time series data corresponding to each query sub-period. The grid time series data is grouped according to the grid row and column numbers. The grouped grid time series data is assigned to the time window corresponding to each time stamp according to each time stamp. Time grouping data associated with each query sub-period, each time window, and each grid row and column number is generated. The statistical data of each time group is statistically processed according to the statistical method described above to generate grid time aggregate data associated with each query sub-period, each time window and each grid row and column number; For each target mesh system, the spatial resolution of the target mesh system is compared with the corresponding preset resolution threshold. When the spatial resolution is less than or equal to the preset resolution threshold, the same initial spatial weight is set for each mesh row and column number corresponding to the target mesh system. When the spatial resolution is greater than the preset resolution threshold, the target spatial boundary vector data is converted to the coordinate system of the target mesh system. Each mesh cell is determined based on the mesh start coordinates, the spatial resolution, and each mesh row and column number corresponding to the target mesh system. The intersection area between each mesh cell and the converted target spatial boundary vector data is determined, and each intersection area is set as the initial spatial weight corresponding to each mesh row and column number. The initial spatial weights corresponding to each target grid system are normalized to generate spatial weight data corresponding to each target grid system. Based on the query sub-period data, the target grid system corresponding to each query sub-period is determined. According to the grid row and column number, the grid time aggregation data corresponding to the same query sub-period and the same time window is associated with the spatial weight data of the target grid system corresponding to the query sub-period. Based on the spatial weight corresponding to each grid row and column number, the grid time aggregation data corresponding to each grid row and column number under the same query sub-period and the same time window is weighted and summarized to generate the regional sub-period aggregation data corresponding to each query sub-period.

7. The grid-based time-series-based aggregation query method as described in claim 1, characterized in that, Organize the regional sub-time period aggregated data according to the time order corresponding to the queried sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end, including: Extract the start and end times of each sub-period from the query sub-period data; The aggregated data for each region's sub-time period is sorted according to the order of the start times of each sub-time period, generating an aggregated data sequence; When the aggregated data sequence includes aggregated data for one regional sub-period, the aggregated data for that regional sub-period is determined as the target aggregation result; when the aggregated data sequence includes aggregated data for multiple regional sub-periods, the splicing position is determined based on the sub-period end time corresponding to the previous regional sub-period aggregated data and the sub-period start time corresponding to the next regional sub-period aggregated data, and the aggregated data for each regional sub-period in the aggregated data sequence is spliced ​​according to each splicing position to generate the target aggregation result; Extract the data update cycle of each target grid system from the target grid system data, determine the shortest data update cycle among the data update cycles as the cache validity period, obtain the cache write time, determine the cache validity period based on the cache write time and the cache validity period, and write the cache identifier, the target aggregation result and the cache validity period into the cache entry; The cached entries are written into the cache layer, and the target aggregation result is sent to the requesting end.

8. A grid-based time-series aggregation query device, characterized in that, The grid-based time-series aggregation query device includes: The regional grid index generation module is used to acquire regional data and grid system data, and generate regional grid index data based on the regional data and the grid system data; The grid time period matching module is used to receive data query requests sent by the requesting end, and determine the target grid system data and query sub-time period data based on the data query requests and the grid system data; The cache query module is used to generate a cache identifier based on the data query request and the target grid system data, retrieve cache aggregation results from the cache layer according to the cache identifier, and send the cache aggregation results to the requesting end when the cache aggregation results are retrieved. The time-series data reading module is used to obtain the grid time-series data corresponding to each query sub-period based on the data query request, the target grid system data, and the regional grid index data when no cached aggregation results are retrieved. The spatiotemporal aggregation module is used to perform time-dimensional aggregation on the grid time series data based on the data query request to generate grid time aggregated data, and to perform spatial-dimensional aggregation on the grid time aggregated data based on the query sub-period data and the target grid system data to generate regional sub-period aggregated data corresponding to each query sub-period. The aggregation result output module is used to organize the regional sub-time period aggregated data according to the time order corresponding to the query sub-time period data, generate the target aggregation result, associate the target aggregation result with the cache identifier and write it into the cache layer, and send the target aggregation result to the requesting end.

9. A computer device, characterized in that, The computer device includes a memory, a processor, and a grid-based time-series aggregation query program stored in the memory and executable on the processor, wherein the grid-based time-series aggregation query program, when executed by the processor, implements the steps of the grid-based time-series aggregation query method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a grid-based time-series aggregation query program, which, when executed by a processor, implements the steps of the grid-based time-series aggregation query method as described in any one of claims 1-7.