Method, system, terminal and storage medium for generating spatiotemporal K function graph based on allocation and aggregation

By constructing multiple matrices and performing data point access, range query and element allocation methods, the problem of low efficiency in generating spatiotemporal K function graphs in the prior art is solved, and more efficient spatiotemporal K function graph generation is achieved.

CN120256495BActive Publication Date: 2025-08-12SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510733555.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-08-12
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

The prior art cannot effectively reduce the time complexity when generating space-time K function graphs, resulting in low generation efficiency.

Method used

A spatiotemporal K function diagram is generated by constructing multiple matrices and performing data point access, range query, element allocation and numerical calculations.

Benefits of technology

While maintaining the precise solution and the same spatial complexity, the time complexity of generating space-time K function graphs is significantly reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256495B_ABST
    Figure CN120256495B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and discloses a method, system, terminal, and storage medium for generating a space-time K-function graph based on allocation and aggregation. The method comprises: obtaining a location dataset of a target area, constructing a first matrix, performing data point access on the location dataset to obtain an access result, and performing a range query based on the access result to obtain a first range query set; constructing a second matrix, and performing element allocation on the second matrix based on the first range query set to obtain a target second matrix; constructing a third matrix, performing numerical calculations on all elements in the third matrix to obtain a target calculation result, and optimizing the first matrix based on the target calculation result to obtain a target first matrix; and generating a space-time K-function graph based on the minimum and maximum values of the space-time K-function of the target first matrix and a randomly generated dataset. The present invention reduces the time complexity of generating the space-time K-function graph while maintaining an exact solution and the same spatial complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, system, terminal and computer-readable storage medium for generating a spatiotemporal K function graph based on allocation and aggregation. Background Art

[0002] The space-time K function is an important tool in geographic information systems and has been used in many fields, such as geography, transportation science, urban planning, etc. The definition of the space-time K function is that given a spatial threshold and a time threshold, all data points within the spatial threshold and the time threshold (that is, the space-time threshold pair) are counted from each space-time data point in the location data set; by calculating the space-time K function, the corresponding space-time K function graph is generated. The space-time K function graph is an analysis tool that combines time and space dimensions. It is mainly used to detect and study clustering or dispersion patterns in space-time data; it is suitable for detecting space-time anomalies, and by calculating the spatial distribution and temporal changes of point patterns, it can identify abnormal phenomena or patterns. It is of great significance in geographical research and can provide an in-depth understanding of the space-time characteristics and anomaly detection of geographic flows (for example, population mobility, climate change, etc.). Since the generation of the space-time K function graph requires the calculation of each space-time threshold pair (space threshold-time threshold pair) at the same time, L +1 space-time K function, and the time complexity of each space-time K function is Therefore, when considering a pair of space threshold and time threshold, the time complexity is Because generating a spatiotemporal K function graph requires considering ST ( S is the total number of spatial thresholds, T is the total number of time thresholds) space-time threshold pairs, so its total time complexity is Given its huge time complexity, when generating the spatiotemporal K-function graph, a large computational bottleneck is encountered in large-scale datasets and a large number of spatiotemporal threshold pairs, resulting in low efficiency in generating the spatiotemporal K-function graph.

[0003] At present, although the existing technology has proposed a variety of methods to address the above-mentioned problems, such as fast function-related methods, fast kernel density visualization-related methods, and fast indexing methods, the fast K-function-related methods combine parallel / distributed methods or modern hardware methods with existing methods, and cannot reduce the time complexity of solving K-function-related problems; the fast kernel density visualization-related methods are based on the kernel aggregation of calculated data points, which cannot reduce the time complexity or can only provide approximate results for solving kernel density visualization problems; and the index structure of the fast indexing method cannot reduce the time complexity of generating spatiotemporal K-function graphs.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0005] The main purpose of the present invention is to provide a method, system, terminal and storage medium for generating a spatiotemporal K-function graph based on allocation and aggregation, aiming to solve the problem that the existing technology cannot reduce the time complexity of generation when generating a spatiotemporal K-function graph, resulting in low generation efficiency of the spatiotemporal K-function graph.

[0006] To achieve the above objectives, the present invention provides a method for generating a spatiotemporal K-function graph based on allocation and aggregation, the method comprising the following steps:

[0007] Acquire a location dataset of a target area, construct a first matrix based on the location dataset, perform data point access on the location dataset to obtain access results, and perform a range query based on the access results to obtain a first range query set;

[0008] constructing a second matrix according to the location data set, and allocating elements of the second matrix according to the first range query set to obtain a target second matrix;

[0009] constructing a third matrix according to the position data set, performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result, and optimizing the first matrix according to the target calculation result to obtain a target first matrix;

[0010] A randomly generated data set is obtained, and a corresponding space-time K function graph is generated according to the target first matrix and the minimum value and maximum value of the space-time K function of the randomly generated data set.

[0011] Optionally, the method for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the steps of obtaining a location dataset of a target area, constructing a first matrix based on the location dataset, performing data point access on the location dataset to obtain access results, and performing a range query based on the access results to obtain a first range query set, specifically include:

[0012] Obtaining a user's spatiotemporal K-function graph generation requirement, determining a target area according to the spatiotemporal K-function graph generation requirement, and obtaining a location dataset of the target area;

[0013] constructing a first matrix according to the position data set, and initializing all elements of the first matrix;

[0014] Access the target data points of the initialized location data set to obtain access results, and perform a range query on the target data points based on the access results to obtain a first range query set.

[0015] Optionally, the method for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the step of constructing a second matrix based on the location dataset and allocating elements of the second matrix based on the first range query set to obtain a target second matrix, specifically includes:

[0016] Obtaining a total spatial threshold value and a total temporal threshold value of the position data set, constructing a second matrix according to the total spatial threshold value and the total temporal threshold value, and initializing all elements of the second matrix;

[0017] Accessing all data points in the first range query set to obtain a target access result, and acquiring a maximum spatial threshold and a maximum time threshold of the target access result;

[0018] A maximum range query set is obtained according to the maximum spatial threshold and the maximum time threshold, and data points of the maximum range query set are assigned elements to the initialized second matrix to obtain a target second matrix.

[0019] Optionally, the method for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the step of constructing a third matrix based on the position data set and performing numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result, specifically includes:

[0020] determining a matrix specification according to the total number of spatial thresholds and the total number of time thresholds, and constructing a third matrix according to the matrix specification;

[0021] Perform numerical calculations on all elements in the third matrix according to the target second matrix according to a calculation formula to obtain a target calculation result.

[0022] Optionally, in the method for generating a spatiotemporal K-function graph based on allocation and aggregation, the step of performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result is specifically as follows:

[0023] ;

[0024] in, is the third matrix Rank The data points of the column, The second matrix of the target Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the number of rows of the matrix, is the number of columns of the matrix.

[0025] Optionally, the method for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the step of optimizing the first matrix according to the target calculation result to obtain a target first matrix, specifically includes:

[0026] Obtaining all target elements of the first matrix, and adding all the target elements to the target calculation results respectively to obtain processing results;

[0027] The first matrix is optimized according to the processing result to obtain a target first matrix.

[0028] Optionally, the method for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the step of obtaining a randomly generated data set and generating a corresponding spatiotemporal K-function graph according to the target first matrix and the spatiotemporal K-function minimum and the spatiotemporal K-function maximum of the randomly generated data set, specifically includes:

[0029] Obtaining a randomly generated data set, performing an extreme value calculation on the space-time K function of the randomly generated data set, and obtaining a minimum value and a maximum value of the space-time K function;

[0030] A function graph is generated according to the target first matrix, the minimum value of the space-time K function, and the maximum value of the space-time K function to obtain a space-time K function graph.

[0031] Optionally, the method for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the system for generating a spatiotemporal K-function graph based on allocation and aggregation includes:

[0032] a data query module, configured to construct a first matrix, obtain a location dataset of a target area, perform data point access on the location dataset to obtain an access result, and perform a range query based on the access result to obtain a first range query set;

[0033] a data allocation module, configured to construct a second matrix according to the position data set, and allocate elements of the second matrix according to the first range query set to obtain a target second matrix;

[0034] a data aggregation module, configured to construct a third matrix based on the position data set, perform numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result, and optimize the first matrix based on the target calculation result to obtain a target first matrix;

[0035] The function graph generation module is used to obtain a randomly generated data set and generate a corresponding space-time K function graph according to the target first matrix and the space-time K function minimum value and space-time K function maximum value of the randomly generated data set.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a space-time K function graph generation program based on allocation and aggregation stored on the memory and runnable on the processor, and when the space-time K function graph generation program based on allocation and aggregation is executed by the processor, the steps of the space-time K function graph generation method based on allocation and aggregation as described above are implemented.

[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a space-time K function graph generation program based on allocation and aggregation, and when the space-time K function graph generation program based on allocation and aggregation is executed by a processor, the steps of the space-time K function graph generation method based on allocation and aggregation as described above are implemented.

[0038] In the present invention, a location dataset of a target area is obtained, a first matrix is constructed based on the location dataset, data point access is performed on the location dataset to obtain access results, and a range query is performed based on the access results to obtain a first range query set; a second matrix is constructed based on the location dataset, and elements of the second matrix are allocated based on the first range query set to obtain a target second matrix; a third matrix is constructed based on the location dataset, and numerical calculations are performed on all elements in the third matrix based on the target second matrix to obtain a target calculation result, and the first matrix is optimized based on the target calculation result to obtain a target first matrix; a randomly generated dataset is obtained, and a corresponding space-time K function graph is generated based on the minimum and maximum space-time K functions of the target first matrix and the randomly generated dataset. The present invention reduces the time complexity of generating the space-time function graph while maintaining an exact solution and the same spatial complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a schematic diagram of the calculation method of the space-time K function in the prior art;

[0040] Figure 2 is a schematic diagram of a space-time K function diagram of the prior art;

[0041] Figure 3 is a schematic diagram of a range query set in an embodiment of the present invention;

[0042] Figure 4 It is a flow chart of a preferred embodiment of the method for generating a spatiotemporal K function graph based on allocation and aggregation of the present invention;

[0043] Figure 5 is a schematic diagram of a distribution method in an embodiment of the present invention;

[0044] Figure 6 is a schematic diagram of a second matrix in an embodiment of the present invention;

[0045] Figure 7 is a schematic diagram of generating a third matrix based on a target first matrix in an embodiment of the present invention;

[0046] Figure 8 is a schematic diagram of the time required to generate a spatiotemporal K function graph when the size of a data set is changed in an embodiment of the present invention;

[0047] Figure 9 is a schematic diagram of the time required to generate a spatiotemporal K function graph when the number of spatial thresholds is changed in an embodiment of the present invention;

[0048] Figure 10 is a schematic diagram of the time required to generate a spatiotemporal K function graph when the number of time thresholds is changed in an embodiment of the present invention;

[0049] Figure 11 is a schematic diagram of the time required to generate a spatiotemporal K-function graph when the number of randomly generated data sets is changed in an embodiment of the present invention;

[0050] Figure 12 It is a structural diagram of a preferred embodiment of the system for generating a spatiotemporal K-function graph based on allocation and aggregation according to the present invention;

[0051] Figure 13 Schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0053] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), such directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0054] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features specified as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0055] The definition of the space-time K function is: given a spatial threshold and time thresholds , count all data points within the spatial threshold and time threshold from each spatiotemporal data point in the location dataset. Therefore, given a size of Location dataset ,in, is the first spatial point, is the time of the first spatial point, is the second spatial point, is the time of the second spatial point, For the A point in space, For the The time of a spatial point, the corresponding space-time K function is:

[0056] ;

[0057] in, For location dataset The space-time K function, For the A point in space, For the The time of a spatial point, For the j A point in space, For the j The time of a spatial point, is the Euclidean distance function, is the indicator function, that is, as long as and If all conditions are met, the value is 1, and if all other conditions are met, the value is 0. Figure 1 As shown in part (b), due to the point set 、 and respectively 、 and The spatial and temporal thresholds are within the range, so Figure 1 Part (b) of the space-time The value of the function is 2+2+2=6. In contrast, Figure 1 In part (a), no data point lies within the spatial and temporal thresholds for each data point, so the value of its spatiotemporal K function is 0. Generally, under the same spatial and temporal thresholds, a larger spatiotemporal K function value indicates a more clustered dataset. Conversely, a smaller spatiotemporal K function value indicates a more dispersed dataset.

[0058] To verify whether the location dataset has clustered or dispersed characteristics within those spatial and temporal thresholds, the user selects Space thresholds ( )and Time threshold ( ),generate The size is (same as the original location dataset) randomly generated dataset (i.e. ) and at each spatiotemporal threshold Among them and , is the number of rows of the matrix, is the number of columns of the matrix, calculate 、 and ,in, and They refer to The minimum and maximum values of the space-time K function are given by the following formula:

[0059] ;

[0060] ;

[0061] in, To randomly generate a data set The space-time K function, To randomly generate a data set The space-time K function, To generate a random dataset Finally, under different time-space threshold pairs, users are based on 、 and The value of generates a space-time K function graph, such as Figure 2 As shown, Figure 2 As long as The plane ratio If the plane is high, the location dataset will have clustering characteristics at the corresponding spatial and temporal thresholds. On the other hand, if The plane ratio refers to If the plane is low, the location dataset will have scattered characteristics at the corresponding spatial threshold and time threshold.

[0062] Since generating the spatiotemporal K function graph requires calculating the space-time K functions, and the time complexity of each space-time K function is Therefore, when considering a pair of space-time thresholds, the corresponding time complexity is Because generating a spatiotemporal K function graph requires considering time-space threshold pairs, so its total time complexity is Given its huge time complexity, generating spatiotemporal K-function graphs encounters a large computational bottleneck in large-scale datasets and a large number of spatiotemporal threshold pairs. It is impossible to reduce the time complexity of generation, resulting in low generation efficiency of spatiotemporal K-function graphs.

[0063] Afterwards, the space-time K function can be Expressed as:

[0064] ;

[0065] in, for The range query set, the corresponding expression is:

[0066] .

[0067] Therefore, the present invention proposes a DNA (Distribution aNd Aggregation) method to reduce the time complexity of generating a spatiotemporal K function graph. Figure 2 It can be seen that generating a spatiotemporal K function graph requires considering for each data set The value of the space-time K function of the space threshold-time threshold pair. Therefore, the main concept of DNA is to derive the value of the space-time K function using the maximum space threshold. and the maximum time threshold hour Range query set is fully inclusive In other spatial threshold-temporal threshold pairs (e.g. and ,in and ) range query set, such as Figure 3 As shown, that is: ; Therefore, just find (For example, Figure 3 of ) then there is enough information to obtain the rest (For example, Figure 3 of ), without repeatedly calculating different .

[0068] The method for generating a spatiotemporal K function graph based on allocation and aggregation described in the preferred embodiment of the present invention is as follows: Figure 4 As shown, the method for generating a spatiotemporal K-function graph based on allocation and aggregation includes the following steps:

[0069] Step S10: Acquire a location dataset of a target area, construct a first matrix based on the location dataset, perform data point access on the location dataset to obtain access results, and perform a range query based on the access results to obtain a first range query set.

[0070] The step S10 includes:

[0071] Step S11: obtaining a user's spatiotemporal K-function graph generation requirement, determining a target area according to the spatiotemporal K-function graph generation requirement, and obtaining a location dataset of the target area;

[0072] Step S12: constructing a first matrix according to the position data set, and initializing all elements of the first matrix;

[0073] Step S13: Access the target data points in the initialized location data set to obtain access results, and perform a range query on the target data points based on the access results to obtain a first range query set.

[0074] Specifically, in an embodiment of the present invention, the user's spatiotemporal K function graph generation requirement is obtained, the target area is determined according to the spatiotemporal K function graph generation requirement, and a position data set of the target area is obtained, for example, a position data set, and a first matrix is constructed according to the position data set, that is, , and initialize all elements of the first matrix to 0; then, you need to access the first data points , that is, access the target data point of the initialized position data set to obtain the access result, and perform a range query on the target data point based on the access result to obtain the first range query set, that is, The query method used is the RQS (Range-Query-based Solution) method, which searches for these data points by combining different tree index structures.

[0075] Step S20: construct a second matrix according to the location data set, and allocate elements of the second matrix according to the first range query set to obtain a target second matrix.

[0076] The step S20 includes:

[0077] Step S21: Obtain the total number of spatial thresholds and the total number of time thresholds of the position data set, construct a second matrix according to the total number of spatial thresholds and the total number of time thresholds, and initialize all elements of the second matrix;

[0078] Step S22: Access all data points in the first range query set to obtain a target access result, and acquire a maximum spatial threshold and a maximum temporal threshold of the target access result;

[0079] Step S23: obtaining a maximum range query set according to the maximum spatial threshold and the maximum time threshold, and performing element allocation on the data points of the maximum range query set to the initialized second matrix to obtain a target second matrix.

[0080] Specifically, in getting After that, we only need to create a Matrix (i.e., the second matrix), and Each point is assigned to the corresponding and In the embodiment of the present invention, it is implemented by the allocation method, such as Figure 5 Specifically, the total number of spatial thresholds of the location data set (i.e. ) and the total number of time thresholds (i.e. ), construct a second matrix according to the total number of spatial thresholds and the total number of time thresholds, and transform all elements of the second matrix (i.e. ) is initialized to 0, where and ); Then, all data points in the first range query set (i.e. ) to perform access processing, obtain a target access result, and obtain the maximum space threshold of the target access result (for example, Figure 5 middle ) and maximum time thresholds (e.g., Figure 5 middle ); obtain the maximum range query set according to the maximum spatial threshold and the maximum time threshold (for example, Figure 5 middle ), and the data points of the maximum range query set are assigned to the initialized second matrix to obtain the target second matrix, where, and , then The value of is increased by 1. When this step is completed, we can get:

[0081] ;

[0082] The purpose is to have existing methods that are different and Chinese Computing , which will result in a lot of repeated calculations. The allocation method of the present invention is to first calculate the maximum , then Each data point in the set is assigned to the corresponding data point to avoid repeated calculations, such as Figure 6 The matrix shown ,in The result is , because in Figure 6 Satisfy at the same time and There are only 2 data points. Figure 3 As shown, due to the spatial threshold and time thresholds There are regularities (for example: and ), so assigning each data point only requires time, that is, to allocate all The points in the Therefore, the time required for this process is .

[0083] Step S30: construct a third matrix based on the position data set, perform numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result, and optimize the first matrix based on the target calculation result to obtain a target first matrix.

[0084] The step S30 includes:

[0085] Step S31: determining a matrix specification according to the total number of the spatial thresholds and the total number of the time thresholds, and constructing a third matrix according to the matrix specification;

[0086] Step S32: performing numerical calculations on all elements in the third matrix according to the target second matrix according to a calculation formula to obtain a target calculation result;

[0087] Step S33: Acquire all target elements of the first matrix, and add all the target elements to the target calculation result to obtain a processing result;

[0088] Step S34: performing removal processing on the second matrix and the third matrix according to the processing result to obtain a target processing result, and obtaining a target first matrix according to the target processing result.

[0089] Specifically, after obtaining the target second matrix, a third matrix (ie, matrix ), and calculate the corresponding aggregation value. In an embodiment of the present invention, this is achieved through an aggregation method, specifically, determining a matrix specification based on the total number of spatial thresholds and the total number of time thresholds, and constructing a third matrix based on the position data set according to the matrix specification. Represents ; performing numerical calculations on all elements in the third matrix according to the target second matrix according to a calculation formula to obtain a target calculation result; wherein, performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result is specifically:

[0090] ;

[0091] in, is the third matrix Rank The data points of the column, The second matrix of the target Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the number of rows of the matrix, is the number of columns of the matrix; when After that, this is The value of ,like Figure 7 As shown, 8 represents Figure 6 The aggregate value of the dark area in the second target matrix, 17 represents Figure 6 Aggregate values of dark and light areas in the second target matrix.

[0092] Afterwards, all target elements of the first matrix are obtained, and all the target elements are added to the target calculation result to obtain the processing result; the first matrix is optimized according to the processing result, for example, the second matrix and the third matrix are removed to obtain the target first matrix, until all data points of the position data set are visited. When this algorithm is completed, (in and ) is the value of the space-time K function of the space threshold-time threshold pair, and the corresponding time complexity is . Therefore, the time complexity of processing a data point is , so processing a data set ( data points) is Since generating a spatiotemporal K function graph requires processing data sets, so the time complexity is , which is faster than the time complexity of existing methods. Much lower.

[0093] Step S40: Obtain a randomly generated data set, and generate a corresponding space-time K function graph according to the target first matrix and the minimum and maximum values of the space-time K function of the randomly generated data set.

[0094] The step S40 includes:

[0095] Step S41: Obtain a randomly generated data set, perform maximum value calculation on the spatiotemporal K function of the randomly generated data set, and obtain a minimum value and a maximum value of the spatiotemporal K function;

[0096] Step S42: Generate a function graph based on the target first matrix, the minimum value of the space-time K function, and the maximum value of the space-time K function to obtain a space-time K function graph.

[0097] Specifically, in an embodiment of the present invention, a randomly generated data set is obtained, for example, ; Calculate the maximum value of the space-time K function of the randomly generated data set to obtain the minimum value of the space-time K function (using ) and the maximum value of the space-time K function (denoted by denoted); wherein, the formula for calculating the minimum value of the space-time K function is:

[0098] ;

[0099] The formula for calculating the maximum value of the space-time K function is:

[0100] ;

[0101] in, To generate a random dataset The space-time K function, To generate a random dataset The space-time K function, To generate a random dataset Then, a function graph is generated according to the target first matrix, the minimum value of the space-time K function and the maximum value of the space-time K function to obtain a space-time K function graph.

[0102] Furthermore, in order to test whether the present invention reduces the time complexity of generating the space-time function graph, the accurate space-time function graph is generated by different methods when changing different parameter values, such as Figures 8 to 11 As shown, DNA (Distribution and Aggregation) is the present invention, RQS kd (Range-Query-basedSolution K-Dimension, kd-tree based on range query) and RQS ball (Range-Query-based SolutionBall, ball tree based on range query) is the existing index structure; Figure 8 The time required to generate the spatiotemporal K-function graph when the size of the dataset is changed, where the number of spatial thresholds is 5, the number of temporal thresholds is 5, and the number of randomly generated datasets is 1; Figure 9 The time required to generate the spatiotemporal K-function graph when the number of spatial thresholds is changed, where the number of temporal thresholds is 5 and the number of randomly generated data sets is 1; Figure 10 The time required to generate the spatiotemporal K-function graph when the number of temporal thresholds is changed, where the number of spatial thresholds is 5 and the number of randomly generated data sets is 1; Figure 11 The time required to generate the spatiotemporal K function graph when the number of randomly generated data sets is changed, where the number of spatial thresholds is 5 and the number of temporal thresholds is 5, is given by Figures 8 to 11 As known, the present invention not only reduces the time complexity of generating the spatiotemporal K-function graph, but also maintains the same space complexity and maintains the exact solution.

[0103] Further, if Figure 12 As shown, based on the above-mentioned method for generating a spatiotemporal K-function graph based on allocation and aggregation, the present invention also provides a system for generating a spatiotemporal K-function graph based on allocation and aggregation, wherein the system for generating a spatiotemporal K-function graph based on allocation and aggregation includes:

[0104] The data query module 51 is configured to construct a first matrix, obtain a location dataset of a target area, perform data point access on the location dataset to obtain access results, and perform a range query based on the access results to obtain a first range query set.

[0105] a data allocation module 52 configured to construct a second matrix according to the location data set, and allocate elements of the second matrix according to the first range query set to obtain a target second matrix;

[0106] a data aggregation module 53 configured to construct a third matrix based on the position data set, perform numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result, and optimize the first matrix based on the target calculation result to obtain a target first matrix;

[0107] The function graph generation module 54 is used to obtain a randomly generated data set and generate a corresponding space-time K function graph according to the target first matrix and the minimum and maximum values of the space-time K function of the randomly generated data set.

[0108] Further, if Figure 13 As shown, based on the above-mentioned method for generating a spatiotemporal K function graph based on allocation and aggregation, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 13 Only some of the components of the terminal are shown, but it should be understood that implementation of all of the shown components is not required, and more or fewer components may be implemented instead.

[0109] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal. Furthermore, the memory 20 may include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software installed on the terminal and various types of data, such as program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is about to be output. In one embodiment, the memory 20 stores a program 40 for generating a spatiotemporal K-function graph based on allocation and aggregation. The program 40 for generating a spatiotemporal K-function graph based on allocation and aggregation can be executed by the processor 10, thereby implementing the method for generating a spatiotemporal K-function graph based on allocation and aggregation in the present application.

[0110] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, configured to execute program code or process data stored in the memory 20, such as executing the allocation and aggregation-based spatiotemporal K-function graph generation method.

[0111] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components of the terminal communicate with each other via a system bus.

[0112] In one embodiment, when the processor 10 executes the allocation and aggregation-based spatiotemporal K-function graph generation program 40 in the memory 20, the following steps are implemented:

[0113] Acquire a location dataset of a target area, construct a first matrix based on the location dataset, perform data point access on the location dataset to obtain access results, and perform a range query based on the access results to obtain a first range query set;

[0114] constructing a second matrix according to the location data set, and allocating elements of the second matrix according to the first range query set to obtain a target second matrix;

[0115] constructing a third matrix according to the position data set, performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result, and optimizing the first matrix according to the target calculation result to obtain a target first matrix;

[0116] A randomly generated data set is obtained, and a corresponding space-time K function graph is generated according to the target first matrix and the minimum value and maximum value of the space-time K function of the randomly generated data set.

[0117] The step of obtaining a location dataset of a target area, constructing a first matrix based on the location dataset, performing data point access on the location dataset to obtain access results, and performing a range query based on the access results to obtain a first range query set specifically includes:

[0118] Obtaining a user's spatiotemporal K-function graph generation requirement, determining a target area according to the spatiotemporal K-function graph generation requirement, and obtaining a location dataset of the target area;

[0119] constructing a first matrix according to the position data set, and initializing all elements of the first matrix;

[0120] Access the target data points of the initialized location data set to obtain access results, and perform a range query on the target data points based on the access results to obtain a first range query set.

[0121] The step of constructing a second matrix according to the location data set and allocating elements of the second matrix according to the first range query set to obtain a target second matrix specifically includes:

[0122] Obtaining a total spatial threshold value and a total temporal threshold value of the position data set, constructing a second matrix according to the total spatial threshold value and the total temporal threshold value, and initializing all elements of the second matrix;

[0123] Accessing all data points in the first range query set to obtain a target access result, and acquiring a maximum spatial threshold and a maximum time threshold of the target access result;

[0124] A maximum range query set is obtained according to the maximum spatial threshold and the maximum time threshold, and data points of the maximum range query set are assigned elements to the initialized second matrix to obtain a target second matrix.

[0125] The step of constructing a third matrix based on the position data set and performing numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result specifically includes:

[0126] determining a matrix specification according to the total number of spatial thresholds and the total number of time thresholds, and constructing a third matrix according to the matrix specification;

[0127] Perform numerical calculations on all elements in the third matrix according to the target second matrix according to a calculation formula to obtain a target calculation result.

[0128] The method of performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result is specifically:

[0129] ;

[0130] in, is the third matrix Rank The data points of the column, The second matrix of the target Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the number of rows of the matrix, is the number of columns of the matrix.

[0131] The step of optimizing the first matrix according to the target calculation result to obtain a target first matrix specifically includes:

[0132] Obtaining all target elements of the first matrix, and adding all the target elements to the target calculation results respectively to obtain processing results;

[0133] The first matrix is optimized according to the processing result to obtain a target first matrix.

[0134] The step of obtaining a randomly generated data set and generating a corresponding space-time K function graph according to the target first matrix and the minimum and maximum space-time K function values of the randomly generated data set specifically includes:

[0135] Obtaining a randomly generated data set, performing an extreme value calculation on the space-time K function of the randomly generated data set, and obtaining a minimum value and a maximum value of the space-time K function;

[0136] A function graph is generated according to the target first matrix, the minimum value of the space-time K function, and the maximum value of the space-time K function to obtain a space-time K function graph.

[0137] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a space-time K function graph generation program based on allocation and aggregation, and when the space-time K function graph generation program based on allocation and aggregation is executed by a processor, the steps of the space-time K function graph generation method based on allocation and aggregation as described above are implemented.

[0138] In summary, the present invention provides a method, system, terminal, and storage medium for generating a spatiotemporal K function graph based on allocation and aggregation. The method includes: obtaining a location dataset of a target area, constructing a first matrix based on the location dataset, performing data point access on the location dataset to obtain access results, and performing a range query based on the access results to obtain a first range query set; constructing a second matrix based on the location dataset, performing element allocation on the second matrix based on the first range query set to obtain a target second matrix; constructing a third matrix based on the location dataset, performing numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result, and optimizing the first matrix based on the target calculation result to obtain a target first matrix; obtaining a randomly generated dataset, and generating a corresponding spatiotemporal K function graph based on the minimum and maximum spatiotemporal K functions of the target first matrix and the randomly generated dataset. The present invention reduces the time complexity of generating a spatiotemporal function graph while maintaining an exact solution and the same spatial complexity.

[0139] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or terminal comprising the element.

[0140] Of course, those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium that can be read by a computer. When executed, the program can include the processes in the above-described method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.

[0141] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for generating a spatiotemporal K-function graph based on allocation and aggregation, characterized in that: The method for generating a spatiotemporal K-function graph based on allocation and aggregation includes: Acquire a location dataset of a target area, construct a first matrix based on the location dataset, perform data point access on the location dataset to obtain access results, and perform a range query based on the access results to obtain a first range query set; constructing a second matrix according to the location data set, and allocating elements of the second matrix according to the first range query set to obtain a target second matrix; The step of constructing a second matrix according to the location data set and allocating elements of the second matrix according to the first range query set to obtain a target second matrix specifically includes: Obtaining a total spatial threshold value and a total temporal threshold value of the position data set, constructing a second matrix according to the total spatial threshold value and the total temporal threshold value, and initializing all elements of the second matrix; Accessing all data points in the first range query set to obtain a target access result, and acquiring a maximum spatial threshold and a maximum time threshold of the target access result; Obtaining a maximum range query set according to the maximum spatial threshold and the maximum time threshold, and performing element allocation on the data points of the maximum range query set to the initialized second matrix to obtain a target second matrix; constructing a third matrix according to the position data set, performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result, and optimizing the first matrix according to the target calculation result to obtain a target first matrix; The step of constructing a third matrix according to the position data set and performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain a target calculation result specifically includes: determining a matrix specification according to the total number of spatial thresholds and the total number of time thresholds, and constructing a third matrix according to the matrix specification; Performing numerical calculations on all elements in the third matrix according to the target second matrix to obtain target calculation results; A randomly generated data set is obtained, and a corresponding space-time K function graph is generated according to the target first matrix and the minimum value and maximum value of the space-time K function of the randomly generated data set.

2. The method for generating a spatiotemporal K-function graph based on allocation and aggregation according to claim 1, characterized in that: The step of obtaining a location dataset of a target area, constructing a first matrix based on the location dataset, performing data point access on the location dataset to obtain access results, and performing a range query based on the access results to obtain a first range query set specifically includes: Obtaining a user's spatiotemporal K-function graph generation requirement, determining a target area according to the spatiotemporal K-function graph generation requirement, and obtaining a location dataset of the target area; constructing a first matrix according to the position data set, and initializing all elements of the first matrix; Access the target data points of the initialized location data set to obtain access results, and perform a range query on the target data points based on the access results to obtain a first range query set.

3. The method for generating a spatiotemporal K-function graph based on allocation and aggregation according to claim 1, characterized in that: The target calculation result is obtained by performing numerical calculation on all elements in the third matrix according to the target second matrix, specifically: ; in, is the third matrix Rank The data points of the column, The second matrix of the target Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the third matrix Rank The data points of the column, is the number of rows of the matrix, is the number of columns of the matrix.

4. The method for generating a spatiotemporal K-function graph based on allocation and aggregation according to claim 1, characterized in that: Optimizing the first matrix according to the target calculation result to obtain a target first matrix specifically includes: Obtaining all target elements of the first matrix, and adding all the target elements to the target calculation results respectively to obtain processing results; The first matrix is optimized according to the processing result to obtain a target first matrix.

5. The method for generating a spatiotemporal K-function graph based on allocation and aggregation according to claim 1, characterized in that: The step of obtaining a randomly generated data set and generating a corresponding space-time K function graph according to the target first matrix and the minimum and maximum space-time K function values of the randomly generated data set specifically includes: Obtaining a randomly generated data set, performing an extreme value calculation on the space-time K function of the randomly generated data set, and obtaining a minimum value and a maximum value of the space-time K function; A function graph is generated according to the target first matrix, the minimum value of the space-time K function, and the maximum value of the space-time K function to obtain a space-time K function graph.

6. A system for generating spatiotemporal K-function graphs based on allocation and aggregation, characterized in that: The space-time K-function graph generation system based on allocation and aggregation is applied to the space-time K-function graph generation method based on allocation and aggregation according to any one of claims 1 to 5, and the space-time K-function graph generation system based on allocation and aggregation includes: a data query module, configured to construct a first matrix, obtain a location dataset of a target area, perform data point access on the location dataset to obtain an access result, and perform a range query based on the access result to obtain a first range query set; a data allocation module, configured to construct a second matrix according to the position data set, and allocate elements of the second matrix according to the first range query set to obtain a target second matrix; a data aggregation module, configured to construct a third matrix based on the position data set, perform numerical calculations on all elements in the third matrix based on the target second matrix to obtain a target calculation result, and optimize the first matrix based on the target calculation result to obtain a target first matrix; The function graph generation module is used to obtain a randomly generated data set and generate a corresponding space-time K function graph according to the target first matrix and the space-time K function minimum value and space-time K function maximum value of the randomly generated data set.

7. A terminal, characterized in that: The terminal includes: a memory, a processor, and a space-time K function graph generation program based on allocation and aggregation stored in the memory and runnable on the processor. When the space-time K function graph generation program based on allocation and aggregation is executed by the processor, the steps of the space-time K function graph generation method based on allocation and aggregation are implemented as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a space-time K function graph generation program based on allocation and aggregation. When the space-time K function graph generation program based on allocation and aggregation is executed by a processor, the steps of the space-time K function graph generation method based on allocation and aggregation are implemented as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Space-time POI data point mode analysis method based on Ripley's K function in distributed environment

    CN110765130A

  • Method for reproducibility of deep learning classifiers using ensembles

    US20210374500A1