Method, system and device for clustering analysis of crowd based on spatio-temporal data

Through the analysis of multi-source spatiotemporal data and the application of density clustering algorithms, the one-sided information caused by single data source analysis is solved, and the accuracy and comprehensiveness of clustering analysis are improved.

CN119513636AActive Publication Date: 2025-02-25CETC BIGDATA RES INST CO LTD +1

Patent Information

Application Number
CN202510097821.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-02-25
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

Spatial-temporal data analysis based on a single type of data source can only obtain one-sided information, resulting in the incomplete results of clustering analysis, which affects the accuracy of decisions.

Method used

By obtaining various types of spatiotemporal data, including temporal data, spatial data, traffic data, environmental data and socio-economic data, the data is processed and clustered by preset analysis algorithms and density clustering algorithms.

Benefits of technology

This method can reflect the characteristics of the population from multiple angles, improve the accuracy and comprehensiveness of clustering analysis, and avoid the one-sided problem based on a single data source analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513636A_ABST
    Figure CN119513636A_ABST
Patent Text Reader

Abstract

The invention discloses a crowd clustering analysis method, system and device based on spatio-temporal data. The method comprises the following steps: acquiring spatio-temporal data; performing feature processing on the spatio-temporal data to obtain a feature number, and constructing a spatio-temporal data matrix based on the feature number; performing dimension reduction on the spatio-temporal data matrix through a preset analysis algorithm to obtain a data matrix; according to a preset point in the data matrix, the volume of a preset radius with the preset point as the center and the point number in the radius are calculated, and the local density is calculated based on the point number in the radius and the volume; calculating the distance between each point in the data matrix and the nearest target point, and selecting a target neighborhood radius based on the distance and the local density; determining a data dimension based on the number of features, and setting a minimum point number through the data dimension; marking each point in the data matrix through a density clustering algorithm according to the radius of the target domain and the minimum point number to obtain a clustering result; and analyzing features of clustering results based on the plurality of clustering clusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer cluster analysis, and in particular to a method, system and device for cluster analysis of a population based on spatiotemporal data. Background Art

[0002] With the development of cities, spatiotemporal data is of great significance in studying the behavioral characteristics of urban populations. The sources of spatiotemporal data are wide and varied, such as taxi GPS trajectory data, user call data, etc. These spatiotemporal data can reflect the range of activities, travel habits, social connections and other information of the population. Through in-depth mining of spatiotemporal data, we can better plan urban layout, optimize traffic management, and improve the level of public services.

[0003] In the prior art, many studies have proposed methods for analyzing human behavior, human group flow and other characteristics based on different types of spatiotemporal data. This type of analysis usually starts with a single type of data, processes the outliers in this type of data, and then analyzes the processed data in combination with an algorithm model. For example, from one aspect of human behavior characteristics, the movement trajectory pattern of a crowd is analyzed.

[0004] However, data analysis based on a single type of data source can only obtain partial information, which will make the results of cluster analysis incomplete, lead to deviations in the understanding of human characteristics, and thus affect the accuracy of decision-making. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a method, system and device for clustering analysis of a population based on spatiotemporal data.

[0006] The technical solution provided in this application is described below: The first aspect of the present application provides a method for clustering analysis of a population based on spatiotemporal data, the method comprising: Acquiring spatiotemporal data, the spatiotemporal data including time data, space data, traffic data, environmental data, and socio-economic data; Performing feature processing on the spatiotemporal data to obtain a feature quantity, and constructing a spatiotemporal data matrix based on the feature quantity; The spatial-temporal data matrix is ​​reduced in dimension by a preset analysis algorithm to obtain a data matrix; According to the preset point in the data matrix, the volume of a preset radius centered at the preset point and the number of points within the radius are calculated, and local density is calculated based on the number of points within the radius and the volume; Calculating the distance between each point in the data matrix and the nearest target point, and selecting a target neighborhood radius based on the distance and the local density; Determining a data dimension based on the number of features, and setting a minimum number of points by the data dimension; According to the target area radius and the minimum number of points, each point in the data matrix is ​​marked by a density clustering algorithm to obtain a clustering result, wherein the clustering result includes a plurality of clusters; The characteristics of the clustering result are analyzed based on the multiple clustering clusters.

[0007] Optionally, reducing the dimension of the spatiotemporal data matrix by a preset analysis algorithm to obtain a data matrix includes: Obtaining a mean vector by calculating the spatiotemporal data matrix; Calculate a covariance matrix based on the spatiotemporal data matrix and the mean vector; Performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and constructing principal components based on the eigenvectors, wherein the eigenvalues ​​are the variances explained by each principal component, and the eigenvectors are the directions of the principal components; Selecting a target principal component according to the size of the variance, and constructing an eigenvector matrix based on the eigenvector of the target principal component; The spatiotemporal data is projected onto the eigenvector matrix to obtain a data matrix.

[0008] Optionally, the covariance matrix is ​​calculated by the following formula: ; in, Denotes the covariance matrix Medium Features and Features The covariance between represents the number of samples of the spatiotemporal data, Indicates Samples in the feature The value of Indicates Samples in the feature The value of Indicates The mean vector of samples, Indicates The mean vector of samples.

[0009] Optionally, the selecting a target principal component according to the size of the variance, and constructing a eigenvector matrix based on the eigenvector of the target principal component includes: Calculate the cumulative variance ratio of each principal component through the variance; Selecting a target principal component based on the size of the cumulative variance ratio; An eigenvector matrix is ​​constructed based on the eigenvectors of the target principal components.

[0010] Optionally, the selecting a target principal component based on the size of the cumulative variance ratio includes: Determine whether the cumulative variance ratio is greater than or equal to 90%; If so, it is determined to be the target principal component.

[0011] Optionally, according to the target area radius and the minimum number of points, each point in the data matrix is ​​marked by a density clustering algorithm to obtain a clustering result, and the clustering result includes multiple clusters including: Step 1: Determine that the data matrix is ​​a sample set D=(x1,x2,...,xm), a neighborhood parameter (ϵ,MinPts) and a sample distance metric, where ϵ represents the radius of the target domain, MinPts represents the minimum number of points, and the sample set is a set consisting of multiple TF-IDF vectors; Step 2: Based on the sample distance measurement method, calculate the ϵ-neighborhood subsample set Nϵ(xj) of each sample Xj; Step 3: Compare the absolute value |Nϵ(xj)| of the ϵ-neighborhood subsample set Nϵ(xj) with the MinPts, and add the sample xj greater than the MinPts to the core object sample set Ω; Step 4: When the core object sample set Ω is not empty, randomly select a core object o from the core object sample set Ω and execute the following algorithm: Initialize the current cluster core object queue Ωcur={o}; Initialize category number k=k+1; Initialize the current cluster sample set Ck={o}; Update the unvisited sample set Γ=Γ-{o}; Step 5: If the current cluster core object queue Ωcur is empty, the current cluster Ck is generated; after the cluster Ck is generated, the cluster partition C=C∪{Ck} is updated, and the core object sample set Ω=Ω-Ck is updated; Step 6: If the current cluster core object queue Ωcur is not empty, execute the following algorithm: Take out a core object o' from the current cluster core object queue Ωcur; Determine all ϵ-neighborhood subsample sets Nϵ(o') through the neighborhood distance threshold ϵ; Let Δ = Nϵ(o')∩Γ; Update the current cluster sample set Ck=Ck∪Δ, and update the unvisited sample set Γ=Γ-Δ; Update Ωcur = Ωcur ∪ (Δ ∩ Ω) - {o'}; Repeat step 5; Step 7: Output cluster partition C={C1, C2, ..., Ck} to obtain a clustering result, which includes multiple clusters.

[0012] Optionally, after acquiring the spatiotemporal data, the spatiotemporal data including time data, space data, traffic data, environmental data and socio-economic data, and before performing feature processing on the spatiotemporal data to obtain feature quantities and constructing a spatiotemporal data matrix based on the feature quantities, the method further includes: The spatiotemporal data is preprocessed, and the data preprocessing includes: data deduplication, missing value processing, and data type unification.

[0013] Optionally, the local density is calculated by the following formula: ; in, Indicates the preset point The preset radius The points within Indicates that the preset point The preset radius of the center The volume of represents the local density.

[0014] A second aspect of the present application provides a system for clustering analysis of a population based on spatiotemporal data, the system comprising: An acquisition unit, used to acquire spatiotemporal data, wherein the spatiotemporal data includes time data, space data, traffic data, environmental data, and socio-economic data; A construction unit, used for performing feature processing on the spatiotemporal data to obtain feature quantities, and constructing a spatiotemporal data matrix based on the feature quantities; A dimension reduction unit, used for reducing the dimension of the spatiotemporal data matrix to obtain a data matrix by using a preset analysis algorithm; a calculation unit, configured to calculate, according to a preset point in the data matrix, a volume of a preset radius centered on the preset point and the number of points within the radius, and calculate a local density based on the number of points within the radius and the volume; a selection unit, configured to calculate the distance between each point in the data matrix and the nearest target point, and select a target neighborhood radius based on the distance and the local density; A setting unit, configured to determine a data dimension based on the number of features, and set a minimum number of points through the data dimension; A marking unit, used for marking each point in the data matrix by a density clustering algorithm according to the target area radius and the minimum number of points, to obtain a clustering result, wherein the clustering result includes a plurality of clusters; An analyzing unit is used to analyze the characteristics of the clustering result based on the multiple clustering clusters.

[0015] A third aspect of the present application provides a device for clustering analysis of a population based on spatiotemporal data, the device comprising: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the above method.

[0016] It can be seen from the above technical solutions that this application has the following advantages: In the method for clustering and analyzing a population based on spatiotemporal data provided in the present application, multiple types of spatiotemporal data, including time data, spatial data, traffic data, environmental data, and socioeconomic data, are obtained, and finally a cluster analysis of the population is performed through a preset analysis algorithm and a density clustering algorithm. The multi-source spatiotemporal data obtained by this method is used as the data basis for cluster analysis, which avoids the problem that only one-sided information can be obtained based on analysis of a single type of data source, and helps to reflect the characteristics of the population from multiple angles, such as time data reflects the time pattern of activities, and spatial data determines the geographical location, etc., which effectively improves the accuracy of subsequent cluster analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 A schematic diagram of an embodiment of a method for clustering analysis of a population based on spatiotemporal data provided in this application; Figure 2 A schematic flow chart of another embodiment of the method for clustering analysis of a population based on spatiotemporal data provided in the present application; Figure 3 A schematic diagram of the structure of an embodiment of a system for clustering analysis of populations based on spatiotemporal data provided by the present application; Figure 4 A schematic diagram of the structure of an embodiment of the device for clustering analysis of a population based on spatiotemporal data provided in the present application. DETAILED DESCRIPTION

[0019] The present application provides a method for clustering and analyzing a population based on spatiotemporal data, which can improve the accuracy and comprehensiveness of clustering and analyzing a population. It should be noted that the method for clustering and analyzing a population based on spatiotemporal data of the present application is applied to a terminal.

[0020] Spatiotemporal data is a data type that integrates information from time and space dimensions. It can deeply reflect the development and change of things in a specific geographical location over time. In the field of transportation, the driving trajectory of vehicles on different roads at different times is a typical spatiotemporal data. Through analysis, we can understand the peak and trough periods of traffic flow and the spatiotemporal distribution of congested sections, thus providing a basis for traffic planning and optimization of intelligent transportation systems; in the field of environment, the changes in meteorological data over time in different geographical locations, such as temperature, humidity, pollutant concentration and other spatiotemporal data, can help scientists study the trend of climate change and the diffusion law of environmental pollutants; in the field of urban planning, spatiotemporal data such as population distribution and land use in cities can guide the reasonable layout and sustainable development of cities.

[0021] Cluster analysis is a data analysis method that automatically groups data objects into different clusters based on their own characteristics. It helps to discover potential structures and patterns from complex data sets. In practical applications, companies can perform cluster analysis based on consumer purchasing behavior, age, income and other characteristics, thereby dividing consumers into different groups in order to develop more targeted marketing strategies.

[0022] See also Figure 1 The present application first provides an embodiment of a method for clustering analysis of a population based on spatiotemporal data, the embodiment comprising: S101, obtaining spatiotemporal data, where the spatiotemporal data includes time data, space data, traffic data, environmental data, and socio-economic data; In this embodiment, obtaining spatiotemporal data requires collecting different time data, spatial data, traffic data, environmental data, and economic data from multiple data sources.

[0023] S102, performing feature processing on the spatiotemporal data to obtain feature quantities, and constructing a spatiotemporal data matrix based on the feature quantities; In this embodiment, feature processing of spatiotemporal data to obtain the number of features first requires feature extraction for the time data, spatial data, traffic data, environmental data, and socioeconomic data acquired in step S101, and then statistics on the number of extracted features. Based on the counted number of features, a spatiotemporal data matrix is ​​constructed with data objects as rows and features as columns. For example, if there are 100 data objects and the number of features is 20, then the constructed spatiotemporal data matrix is ​​a spatiotemporal data matrix with 100 rows and 20 columns.

[0024] In actual application scenarios, for time data, periodic features (for example, daily, weekly, and monthly cycles) and special time points (for example, holidays, morning rush hours) and other features can be extracted; for spatial data, features related to geographic coordinates (for example, longitude and latitude, altitude), area types (for example, commercial areas, residential areas) and other features can be extracted; for traffic data, features such as flow size, direction, and degree of traffic congestion can be extracted; for environmental data, features such as temperature range and air quality level can be extracted; for socioeconomic data, features such as population income level and consumption tendency can be extracted.

[0025] S103, reducing the dimension of the spatiotemporal data matrix by a preset analysis algorithm to obtain a data matrix; In this embodiment, the constructed spatiotemporal data matrix is ​​first obtained, and then a suitable analysis algorithm is selected to reduce the dimension of the spatiotemporal data matrix to obtain a data matrix after dimensionality reduction. For example, the original spatiotemporal data matrix has 20 features. After the dimensionality reduction operation, a data matrix with 5 features can be obtained.

[0026] It should be noted that the dimensionality reduction operation in this embodiment is a technical means for converting high-dimensional data into low-dimensional data. In the spatiotemporal data matrix containing time data, spatial data, traffic data, environmental data and socio-economic data, there are dozens or even hundreds of features to describe each data point, so there may be correlations between these features. The purpose of the dimensionality reduction operation is to find a mapping method to map the data points in the original high-dimensional space to a low-dimensional space. For example, the original spatiotemporal data matrix collects a large amount of information about crowd activities in area A through multiple sensors, including multiple different time periods, multiple different geographical locations, and many aspects related to crowd activities, such as traffic, environment, socio-economic characteristics, etc. Then the dimensionality reduction operation in this example is to reduce the number of features describing the activities while retaining the main information of crowd activities.

[0027] S104, according to the preset point in the data matrix, calculating the volume of the preset radius centered on the preset point and the number of points within the radius, and calculating the local density based on the number of points within the radius and the volume; In this embodiment, it is first necessary to determine a preset point in the data matrix, which is a randomly selected data point, and set an initial preset radius. Then, the volume of the preset radius centered on the data point is calculated, and the number of points within the preset radius centered on the preset point is counted. Finally, the local density is calculated based on the number of points and volume within the obtained radius.

[0028] The local density can be calculated by the following formula: ; in, Indicates preset point Preset radius The points within Indicates the preset point Preset radius around the center The volume of represents the local density.

[0029] S105, calculating the distance between each point in the data matrix and the nearest target point, and selecting the target neighborhood radius based on the distance and local density; In this embodiment, to calculate the distance between each point in the data matrix and the nearest target point, first for each point in the data matrix, traverse the entire data matrix to find its nearest target point, and by comparing the distance between each point and other points, the target point closest to each point can be determined. After the nearest target point is determined, the distance between each point and the nearest target point is calculated. When selecting the target area radius, the calculated local density reflects the density around the data point. When the local density of a point is high, the data points around it are relatively dense, so a suitable target neighborhood radius can be determined based on the numerical relationship between its distance to the nearest target point and the local density.

[0030] S106, determining the data dimension based on the number of features, and setting the minimum number of points according to the data dimension; In this embodiment, the data dimension is determined according to the number of features obtained in step S102. For example, if the number of features obtained after feature processing is d, then the data dimension is d. Then, the minimum number of points is set according to the determined data dimension. Furthermore, the method of setting the minimum number of points is to determine the minimum number of points based on a specific formula of the data dimension.

[0031] It should be noted that data dimension refers to the number of features or variables that describe the data, which is the number of degrees of freedom or coordinate axes of the data in space. The purpose of setting the minimum number of points through data dimension in this step is to select a suitable threshold to distinguish between noise points and core points.

[0032] The specific formula for setting the minimum number of points can be calculated as follows: ; in, Indicates the minimum number of points, Indicates the data dimension.

[0033] S107, marking each point in the data matrix by a density clustering algorithm according to the target area radius and the minimum number of points, to obtain a clustering result, where the clustering result includes multiple clusters; A cluster is a collection of data points that are clustered together based on similarity during cluster analysis. In the data space, data points with similar characteristics are classified into the same cluster. For example, when analyzing customer consumption data, customer data with similar consumption habits and similar consumption amounts may form a cluster; in image recognition, pixel points with similar characteristics such as color and texture will also form a cluster. Data points within a cluster have high similarity to each other, while data points between different clusters have large differences.

[0034] In this embodiment, the target neighborhood radius and the minimum number of points determined in step S106 are first obtained, and then for each point in the data matrix, the neighborhood range is determined according to the target neighborhood radius with the point as the center, the number of points in the neighborhood range is counted, and each point is marked by a density clustering algorithm. For example, if the number of points is greater than or equal to the minimum number of points, then the point is regarded as a core point, and the points in its neighborhood are marked as belonging to the same cluster cluster as the core point, and then the neighborhood of the newly marked point is checked. If there are points in its neighborhood that meet the minimum number of points, these points are also included in the current cluster cluster. This process iterates and expands the cluster cluster until no new points can be added, and for those points that are neither core points nor included in the cluster cluster by the core points in the neighborhood, they are marked as noise points. Each point in the data matrix is ​​marked by this type of density clustering algorithm, and a clustering result containing multiple clusters and noise points is finally obtained.

[0035] The following is a specific example of obtaining multiple clusters using a density clustering algorithm: Step 1: Determine the data matrix as the sample set D=(x1,x2,...,xm), neighborhood parameters (ϵ,MinPts) and sample distance measurement method, where ϵ represents the radius of the target area, MinPts represents the minimum number of points, and the sample set consists of a set of multiple TF-IDF vectors; Step 2: Based on the sample distance metric, calculate the ϵ-neighborhood subsample set Nϵ(xj) of each sample Xj; Step 3: Compare the absolute value |Nϵ(xj)| of the ϵ-neighborhood subsample set Nϵ(xj) with MinPts, and add the samples xj greater than MinPts to the core object sample set Ω; Step 4: When the core object sample set Ω is not empty, randomly select a core object o from the core object sample set Ω and execute the following algorithm: Initialize the current cluster core object queue Ωcur={o}; Initialize category number k=k+1; Initialize the current cluster sample set Ck={o}; Update the unvisited sample set Γ = Γ-{o}; Step 5: If the current cluster core object queue Ωcur is empty, the current cluster Ck is generated; after the cluster Ck is generated, the cluster partition C=C∪{Ck} is updated, and the core object sample set Ω=Ω-Ck is updated; Step 6: If the current cluster core object queue Ωcur is not empty, execute the following algorithm: Take out a core object o' from the current cluster core object queue Ωcur; Determine all ϵ-neighborhood subsample sets Nϵ(o') through the neighborhood distance threshold ϵ; Let Δ = Nϵ(o')∩Γ; Update the current cluster sample set Ck=Ck∪Δ, and update the unvisited sample set Γ=Γ-Δ; Update Ωcur = Ωcur ∪ (Δ ∩ Ω) - {o'}; Repeat step 5; Step 7: Output cluster partition C={C1,C2,...,Ck} and obtain the clustering result, which contains multiple clusters.

[0036] Different from traditional K-means and other algorithms, density clustering algorithms can form clusters of arbitrary shapes and adapt to the complex behavior and distribution of the crowd.

[0037] The algorithm can handle data with large density variations. In human behavior, there may be more behavioral features in some time periods and less in other time periods, and this variation can be well captured by the algorithm. Unlike algorithms such as K-means, the density clustering algorithm does not require the number of clusters to be specified in advance, avoiding a priori knowledge of the data structure.

[0038] S108. Analyze characteristics of clustering results based on multiple clustering clusters.

[0039] In this embodiment, for the obtained multiple clusters, the basic statistical characteristics of each cluster are calculated respectively. The basic statistical characteristics can calculate the center position of the cluster and the number of data points in the cluster, and the purpose is to measure the size of the cluster. After the calculation is completed, the distribution of the data in the cluster is analyzed. The degree of discreteness of the data in each feature dimension can be described by calculating statistics such as variance, and then the feature differences between different clusters such as the center position difference, size difference and data distribution difference of different clusters are compared. Furthermore, the relationship between the cluster and the external environment can also be analyzed. For example, in spatiotemporal data, it can be analyzed whether a cluster is related to a specific geographical area or time period.

[0040] This embodiment obtains various types of spatiotemporal data, including time data, spatial data, traffic data, environmental data, and socioeconomic data, and finally performs cluster analysis on the crowd through a preset analysis algorithm and a density clustering algorithm.

[0041] Furthermore, this embodiment uses the acquired multi-source spatiotemporal data as the data basis for cluster analysis, avoiding the problem that only one-sided information can be obtained based on analysis of a single type of data source, and helps to reflect crowd characteristics from multiple angles. For example, time data reflects the time pattern of activity, and spatial data determines the geographical location, etc., effectively improving the accuracy of subsequent cluster analysis; feature processing is performed on spatiotemporal data to obtain feature quantity and construct a spatiotemporal data matrix, so that the relationship between multi-source data is clearer, avoiding data confusion and disorder, thereby improving the efficiency and accuracy of the entire data analysis process, and providing an effective data organization form for accurately understanding human behavior and group flow characteristics; the dimensionality reduction operation of the preset analysis algorithm greatly reduces the complexity of the data while retaining the main information of the data. The complexity and computational complexity of the data can help to more accurately analyze characteristics such as human behavior and group flow, and avoid analytical deviations caused by overly complex data and excessive noise. By calculating the local density, it is used to explore the distribution characteristics of data points in the data matrix, and calculating the distance from each point to the preset point can help reflect the spatial relationship between data points and discover the clustering tendency of the data. Calculating the distance between each point and the nearest target point can help further understand the close relationship between data points and reflect the microstructure of the data. Selecting the target neighborhood radius based on distance and local density can better adapt to the uneven distribution of data, avoiding the use of a fixed radius that may result in a large radius in a dense area and contain too many irrelevant data points, which helps to improve the accuracy of subsequent data analysis.

[0042] Furthermore, this embodiment can accurately grasp the structural characteristics of the data by determining the data dimension based on the number of features, and the clear data dimension is helpful for accurate understanding and processing of the data in subsequent analysis; by setting the minimum number of points in the data dimension to determine whether a cluster is sufficiently representative or effective, it can avoid unreasonable clustering results and make the analysis of spatiotemporal data more scientific and reasonable; according to the target area radius and the minimum number of points, each point in the data matrix is ​​marked by a density clustering algorithm to obtain clustering results, which is helpful to discover the spatial and temporal laws hidden in the data and identify anomalies in the data; analyzing the characteristics of the clustering results based on multiple clustering clusters helps to intuitively understand the aggregation center and degree of aggregation of the data, so as to better use the data for decision-making.

[0043] See also Figure 2 , Figure 2 Another embodiment of a method for clustering analysis of a population based on spatiotemporal data provided by the present application includes: S201, obtaining spatiotemporal data, where the spatiotemporal data includes time data, space data, traffic data, environmental data, and socio-economic data; In this embodiment, step S201 is similar to step S101 in the above embodiment and will not be described again here.

[0044] S202, performing data preprocessing on the spatiotemporal data, the data preprocessing including: data deduplication, missing value processing and data type unification; In this embodiment, the acquired spatiotemporal data is preprocessed. First, each data record in the spatiotemporal data set is traversed, and the key identification fields or all fields in the data records are compared by data characteristics. When identical records are identified, only one of them is retained. Then, for fields with missing values, if there are few missing values, the mean, median or mode can be used to fill them; if it is time series data, it can be interpolated and filled according to the values ​​of the previous and next time points; if it is categorized data, the category with the highest frequency of occurrence can be used to fill it. After completing the processing of duplicate values ​​and missing values, the operation of unifying data types is performed to check the data types of each field in the data set, determine a unified data type, and unify data of different types, for example, unify all fields representing dates into date types, and unify fields representing quantities into numerical types.

[0045] This embodiment deduplicates spatiotemporal data to reduce data redundancy and avoid unnecessary processing of the same data multiple times in subsequent analysis, thereby improving analysis efficiency and saving storage space; processing missing values ​​in spatiotemporal data ensures data integrity and accuracy; and unifying the data type of spatiotemporal data helps to perform correct calculations and comparisons during the data analysis process, thereby avoiding calculation errors or logical confusion caused by different data types.

[0046] S203, performing feature processing on the spatiotemporal data to obtain feature quantities, and constructing a spatiotemporal data matrix based on the feature quantities; In this embodiment, step S203 is similar to step S102 in the above embodiment and will not be described again here.

[0047] S204, obtaining a mean vector by calculating the spatiotemporal data matrix; In this embodiment, the structure of the spatiotemporal data matrix is ​​first clarified, where each row represents a spatiotemporal data point and each column represents a specific feature. Then, the mean is calculated for each column of features. For example, for numerical features, all elements of the column are added and then divided by the number of elements to obtain the mean of the column of features. After calculating the mean of each column of features, these means are combined to obtain a mean vector.

[0048] This embodiment calculates the mean vector through the spatiotemporal data matrix, which can provide the average level information of the spatiotemporal data in each characteristic dimension, and the calculated mean vector can also be used as a benchmark for comparing data differences in different spatiotemporal regions or different time periods.

[0049] S205, calculating a covariance matrix according to the spatiotemporal data matrix and the mean vector; The covariance matrix is ​​a square matrix used to describe the covariance relationship between multiple random variables. If there are n random variables, the covariance matrix is ​​an n×n matrix, which reflects the degree of linear correlation between variables, and the elements on the diagonal are the variances of each variable. In data analysis, the covariance matrix can help understand the relationship between different variables. For example, in multivariate time series analysis or multivariate statistical analysis, it is an important basis for operations such as data feature analysis and principal component analysis.

[0050] In this embodiment, the constructed spatiotemporal data matrix and the calculated mean vector are obtained, and then the covariance matrix is ​​calculated by the spatiotemporal data matrix and the mean vector. The covariance matrix can be calculated using the following formula: ; in, Represents the covariance matrix Medium Features and Features The covariance between represents the number of samples of spatiotemporal data, Indicates Samples in the feature The value of Indicates Samples in the feature The value of Indicates The mean vector of samples, Indicates The mean vector of samples.

[0051] This embodiment calculates the covariance matrix based on the spatiotemporal data matrix and the mean vector. The covariance matrix, as an important basis for data distribution characteristics, can reflect the linear correlation between various features and is helpful for data dimensionality reduction and feature extraction.

[0052] S206, performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and constructing principal components based on the eigenvectors, wherein the eigenvalue is the variance explained by each principal component, and the eigenvector is the direction of the principal component; Eigenvalue decomposition is a method to decompose a matrix into a special form, which is widely used in many fields such as data analysis, image processing, physics, etc. For a square matrix, it can find a set of eigenvalues ​​and corresponding eigenvectors. For example, for a square matrix A, there exists a non-zero vector x and a number λ, such that Ax=λx, where λ is the eigenvalue and x is the eigenvector. Through eigenvalue decomposition, the square matrix A can be expressed as the product of the matrix composed of its eigenvectors, the diagonal matrix composed of the eigenvalues, and the inverse of the eigenvector matrix.

[0053] In this embodiment, it is necessary to obtain the covariance matrix calculated in step S205. First, the covariance matrix is ​​subjected to eigenvalue decomposition, usually using a related algorithm of linear algebra. After the decomposition is completed, the eigenvalues ​​and eigenvectors can be obtained, where the eigenvalue is the variance explained by each principal component, the eigenvector is the direction of the principal component, and the eigenvalue is positively correlated with the eigenvector.

[0054] This embodiment can extract principal components through eigenvalue decomposition, which can reduce the dimension of data while retaining most of the data information. The eigenvalue represents the variance explained by each principal component, which can intuitively understand the contribution of each principal component to the overall variation of the data. The eigenvector represents the direction of the principal component, which helps to understand the structural relationship of the data in different dimensions.

[0055] S207, calculating the cumulative variance ratio of each principal component through variance; In this embodiment, the eigenvalue corresponding to each principal component obtained in step S206 is obtained, that is, the variance explained by each principal component, and the cumulative variance ratio of each principal component is calculated by the variance. Here, the cumulative variance ratio of each principal component can be calculated by the following steps: The corresponding eigenvalues ​​are , for each principal component , starting from the first principal component, the cumulative variance ratio of each principal component can be obtained by calculating according to the following formula: ; in, represents the total variance, Indicates the first principal component to the The sum of the variances of the principal components, represents the total number of principal components, Indicates The variance corresponding to the principal components is Indicates The sum of the variances, Denotes the cumulative variance proportion.

[0056] This embodiment can intuitively reflect the cumulative contribution of each principal component to the overall variance by calculating the cumulative variance ratio through variance, which helps to determine how many principal components to retain in order to retain enough information while reducing the data dimension, and provide a basis for subsequent analysis.

[0057] S208, determining whether the cumulative variance ratio is greater than or equal to 90%; In this embodiment, it is necessary to first obtain the cumulative variance ratio of each principal component calculated in step S207, and judge the obtained cumulative variance ratio with 90% in turn, and select the principal component that explains most of the variance, that is, select the principal component with a cumulative variance ratio greater than or equal to 90%. This judgment process requires sequential traversal, starting from the first principal component, and as the number of principal components increases, constantly check whether the cumulative variance ratio under the current number of principal components is greater than or equal to 90%. For example, if the cumulative variance ratio of the first principal component is less than 90%, continue to check the cumulative variance ratio of the next principal component, and so on, until the cumulative variance ratios of all principal components are checked. If it is determined that the cumulative variance ratio is greater than or equal to 90%, step S209 is executed.

[0058] This embodiment can determine how many principal components can be used to represent the original data while retaining most of the data information by judging whether the cumulative variance ratio is greater than or equal to 90%. This helps to retain data information that has a significant impact on the analysis results to the greatest extent while reducing the data dimension, avoid losing key information due to excessive dimensionality reduction or increasing unnecessary computational complexity due to retaining too many dimensions, and provide an effective data simplification basis for subsequent analysis.

[0059] S209, determining as the target principal component; In this embodiment, when it is determined that the cumulative variance ratio is greater than or equal to 90%, the corresponding principal component is determined as the target principal component. For example, in the previous process of calculating the cumulative variance ratio, when k principal components are calculated, their cumulative variance ratio is greater than or equal to 90%, then the k principal components are determined as the target principal components.

[0060] This embodiment determines the target principal component when the cumulative variance ratio is greater than or equal to 90%, which is conducive to accurately determining the key components of the data, simplifying the analysis process, reducing unnecessary calculations and data processing complexity, and improving the accuracy and reliability of subsequent analysis results.

[0061] S210, constructing an eigenvector matrix based on the eigenvectors of the target principal components; In this embodiment, after the target principal component is determined, since each principal component has a corresponding eigenvector, the eigenvector corresponding to the target principal component is extracted, and the corresponding eigenvectors are arranged in a preset order to construct a eigenvector matrix. For example, the eigenvector is a two-dimensional vector, and the target principal component is The corresponding eigenvectors are , then we can construct a The eigenvector matrix of .

[0062] This embodiment constructs an eigenvector matrix based on the eigenvector of the target principal component to simplify the complex relationships in the original data. Each sample point in the original data can be represented in the principal component space by multiplying it with the eigenvector matrix. This step helps to explore the structural relationships within the data and can more clearly identify the key features in the target principal component.

[0063] S211, projecting the spatiotemporal data onto the eigenvector matrix to obtain a data matrix; In this embodiment, it is necessary to first obtain the constructed feature vector matrix and the pre-processed spatiotemporal data, which will contain a large number of features. The dimension of the data matrix obtained by projecting it to the feature vector matrix is ​​reduced from the original q-dimensional original feature number to the r-dimensional target principal component number. In the projection process, the most critical information in the spatiotemporal data is retained, and some redundant information is removed. The result after projection makes the spatiotemporal data redistributed in the new space, making the relationship that was not easily perceived in the original space become prominent in the new space.

[0064] This embodiment projects the spatiotemporal data onto a feature vector matrix to obtain a data matrix, thereby achieving data dimensionality reduction and feature extraction, which is beneficial for highlighting the main structure and relationship of the data.

[0065] S212, according to the preset point in the data matrix, calculating the distance from each point in the data matrix to the preset point and the volume of the preset radius centered at the preset point, and obtaining the local density based on the distance and volume calculation; S213, calculating the distance between each point in the data matrix and the nearest target point, and selecting the target neighborhood radius based on the local density; S214, determining the data dimension based on the number of features, and setting the minimum number of points according to the data dimension; S215, marking each point in the data matrix by a density clustering algorithm according to the radius of the target area and the minimum number of points, to obtain a clustering result, where the clustering result includes multiple clusters; S216. Analyze characteristics of clustering results based on multiple clustering clusters.

[0066] In this embodiment, steps S212 to S216 are similar to steps S104 to S108 in the aforementioned embodiment, and are not described again here.

[0067] The following is a detailed description of the system for clustering analysis of populations based on spatiotemporal data provided by this application. Figure 3 , Figure 3 Another embodiment of the system for clustering analysis of a population based on spatiotemporal data provided by the present application comprises: An acquisition unit 301 is used to acquire spatiotemporal data, wherein the spatiotemporal data includes time data, space data, traffic data, environmental data, and socio-economic data; A construction unit 302 is used to perform feature processing on the spatiotemporal data to obtain feature quantities, and to construct a spatiotemporal data matrix based on the feature quantities; A dimension reduction unit 303 is used to reduce the dimension of the spatiotemporal data matrix by a preset analysis algorithm to obtain a data matrix; A calculation unit 304 is used to calculate the volume of a preset radius centered on the preset point and the number of points within the radius according to the preset point in the data matrix, and obtain the local density based on the number of points within the radius and the volume calculation; A selection unit 305 is used to calculate the distance between each point in the data matrix and the nearest target point, and select a target neighborhood radius based on the distance and the local density; A setting unit 306, configured to determine a data dimension based on the number of features and set a minimum number of points according to the data dimension; The marking unit 307 is used to mark each point in the data matrix according to the target area radius and the minimum number of points through a density clustering algorithm to obtain a clustering result, and the clustering result includes multiple clusters; The analyzing unit 308 is used to analyze the characteristics of the clustering results based on the multiple clustering clusters.

[0068] Optionally, the dimension reduction unit 303 is further used for: The mean vector is calculated by the spatiotemporal data matrix; The covariance matrix is ​​calculated based on the spatiotemporal data matrix and the mean vector; Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and construct principal components based on the eigenvectors, where the eigenvalue is the variance explained by each principal component and the eigenvector is the direction of the principal component; Select the target principal component according to the size of the variance, and construct an eigenvector matrix based on the eigenvector of the target principal component; Projecting the spatiotemporal data onto the eigenvector matrix yields the data matrix.

[0069] Optionally, the covariance matrix is ​​calculated as follows: ; in, Represents the covariance matrix Medium Features and Features The covariance between represents the number of samples of spatiotemporal data, Indicates Samples in the feature The value of Indicates Samples in the feature The value of Indicates The mean vector of samples, Indicates The mean vector of samples.

[0070] Optionally, the dimension reduction unit 303 is further used for: Calculate the cumulative variance proportion of each principal component by variance; Select the target principal component based on the size of the cumulative variance ratio; Construct an eigenvector matrix based on the eigenvectors of the target principal components.

[0071] Optionally, the dimension reduction unit 303 is further used for: Determine whether the cumulative variance ratio is greater than or equal to 90%; If so, it is determined as the target principal component.

[0072] Optionally, the marking unit 307 is further used for: Step 1: Determine the data matrix as the sample set D=(x1,x2,...,xm), neighborhood parameters (ϵ,MinPts) and sample distance measurement method, where ϵ represents the radius of the target area, MinPts represents the minimum number of points, and the sample set consists of a set of multiple TF-IDF vectors; Step 2: Based on the sample distance metric, calculate the ϵ-neighborhood subsample set Nϵ(xj) of each sample Xj; Step 3: Compare the absolute value |Nϵ(xj)| of the ϵ-neighborhood subsample set Nϵ(xj) with MinPts, and add the samples xj greater than MinPts to the core object sample set Ω; Step 4: When the core object sample set Ω is not empty, randomly select a core object o from the core object sample set Ω and execute the following algorithm: Initialize the current cluster core object queue Ωcur={o}; Initialize category number k=k+1; Initialize the current cluster sample set Ck={o}; Update the unvisited sample set Γ = Γ-{o}; Step 5: If the current cluster core object queue Ωcur is empty, the current cluster Ck is generated; after the cluster Ck is generated, the cluster partition C=C∪{Ck} is updated, and the core object sample set Ω=Ω-Ck is updated; Step 6: If the current cluster core object queue Ωcur is not empty, execute the following algorithm: Take out a core object o' from the current cluster core object queue Ωcur; Determine all ϵ-neighborhood subsample sets Nϵ(o') through the neighborhood distance threshold ϵ; Let Δ = Nϵ(o')∩Γ; Update the current cluster sample set Ck=Ck∪Δ, and update the unvisited sample set Γ=Γ-Δ; Update Ωcur = Ωcur ∪ (Δ ∩ Ω) - {o'}; Repeat step 5; Step 7: Output cluster partition C={C1,C2,...,Ck} and obtain the clustering result, which contains multiple clusters.

[0073] Optionally, a processing unit 309 is further included, which is specifically configured to: Perform data preprocessing on spatiotemporal data, including data deduplication, missing value processing and unified data types.

[0074] Optionally, the local density is calculated as follows: ; in, Indicates preset point Preset radius The points within Indicates the preset point Preset radius around the center The volume of represents the local density.

[0075] This application also provides a device for clustering analysis of population based on spatiotemporal data, see Figure 4 , Figure 4 An embodiment of a device for clustering and analyzing a population based on spatiotemporal data provided by the present application includes: Processor 401, memory 402, input and output unit 403, bus 404; The processor 401 is connected to the memory 402, the input and output unit 403 and the bus 404; The memory 402 stores a program, and the processor 401 calls the program to execute any of the above methods.

[0076] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0077] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0078] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0079] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0080] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for clustering analysis of a population based on spatiotemporal data, characterized in that: The method comprises: Acquiring spatiotemporal data, the spatiotemporal data including time data, space data, traffic data, environmental data, and socio-economic data; Performing feature processing on the spatiotemporal data to obtain a feature quantity, and constructing a spatiotemporal data matrix based on the feature quantity; The spatial-temporal data matrix is ​​reduced in dimension by a preset analysis algorithm to obtain a data matrix; According to the preset point in the data matrix, the volume of a preset radius centered at the preset point and the number of points within the radius are calculated, and local density is calculated based on the number of points within the radius and the volume; Calculating the distance between each point in the data matrix and the nearest target point, and selecting a target neighborhood radius based on the distance and the local density; Determining a data dimension based on the number of features, and setting a minimum number of points by the data dimension; According to the target area radius and the minimum number of points, each point in the data matrix is ​​marked by a density clustering algorithm to obtain a clustering result, wherein the clustering result includes a plurality of clusters; The characteristics of the clustering result are analyzed based on the multiple clustering clusters.

2. The method according to claim 1, characterized in that The step of reducing the dimension of the spatiotemporal data matrix by a preset analysis algorithm to obtain a data matrix comprises: Obtaining a mean vector by calculating the spatiotemporal data matrix; Calculate a covariance matrix based on the spatiotemporal data matrix and the mean vector; Performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and constructing principal components based on the eigenvectors, wherein the eigenvalues ​​are the variances explained by each principal component, and the eigenvectors are the directions of the principal components; Selecting a target principal component according to the size of the variance, and constructing an eigenvector matrix based on the eigenvector of the target principal component; The spatiotemporal data is projected onto the eigenvector matrix to obtain a data matrix.

3. The method according to claim 2, characterized in that The covariance matrix is ​​calculated as follows: ; in, Denotes the covariance matrix Medium Features and Features The covariance between represents the number of samples of the spatiotemporal data, Indicates Samples in the feature The value of Indicates Samples in the feature The value of Indicates The mean vector of samples, Indicates The mean vector of samples.

4. The method according to claim 2, characterized in that: The step of selecting a target principal component according to the size of the variance and constructing a eigenvector matrix based on the eigenvector of the target principal component includes: Calculating the cumulative variance ratio of each principal component through the variance; Selecting a target principal component based on the size of the cumulative variance ratio; An eigenvector matrix is ​​constructed based on the eigenvectors of the target principal components.

5. The method according to claim 4, characterized in that The selecting of the target principal component based on the size of the cumulative variance ratio includes: Determine whether the cumulative variance ratio is greater than or equal to 90%; If so, it is determined to be the target principal component.

6. The method according to claim 1, characterized in that According to the target area radius and the minimum number of points, each point in the data matrix is ​​marked by a density clustering algorithm to obtain a clustering result, and the clustering result includes multiple clusters including: Step 1: Determine that the data matrix is ​​a sample set D=(x1,x2,...,xm), a neighborhood parameter (ϵ,MinPts) and a sample distance metric, where ϵ represents the radius of the target domain, MinPts represents the minimum number of points, and the sample set is a set consisting of multiple TF-IDF vectors; Step 2: Based on the sample distance measurement method, calculate the ϵ-neighborhood subsample set Nϵ(xj) of each sample Xj; Step 3: Compare the absolute value |Nϵ(xj)| of the ϵ-neighborhood subsample set Nϵ(xj) with the MinPts, and add the sample xj greater than the MinPts to the core object sample set Ω; Step 4: When the core object sample set Ω is not empty, randomly select a core object o from the core object sample set Ω and execute the following algorithm: Initialize the current cluster core object queue Ωcur={o}; Initialize category number k=k+1; Initialize the current cluster sample set Ck={o}; Update the unvisited sample set Γ=Γ-{o}; Step 5: If the current cluster core object queue Ωcur is empty, the current cluster Ck is generated; after the cluster Ck is generated, the cluster partition C=C∪{Ck} is updated, and the core object sample set Ω=Ω-Ck is updated; Step 6: If the current cluster core object queue Ωcur is not empty, execute the following algorithm: Take out a core object o' from the current cluster core object queue Ωcur; Determine all ϵ-neighborhood subsample sets Nϵ(o') through the neighborhood distance threshold ϵ; Let Δ = Nϵ(o')∩Γ; Update the current cluster sample set Ck=Ck∪Δ, and update the unvisited sample set Γ=Γ-Δ; Update Ωcur = Ωcur ∪ (Δ ∩ Ω) - {o'}; Repeat step 5; Step 7: Output cluster partition C={C1, C2, ..., Ck} to obtain a clustering result, which includes multiple clusters.

7. The method according to claim 1, characterized in that After acquiring the spatiotemporal data, the spatiotemporal data including time data, space data, traffic data, environmental data and socio-economic data, and before processing the spatiotemporal data to obtain feature quantities and constructing a spatiotemporal data matrix based on the feature quantities, the method further includes: The spatiotemporal data is preprocessed, and the data preprocessing includes: data deduplication, missing value processing, and data type unification.

8. The method according to any one of claims 1 to 6, wherein the local density is calculated by the following formula: ; in, Indicates the preset point The preset radius The points within Indicates that the preset point The preset radius of the center The volume of represents the local density.

9. A system for clustering analysis of populations based on spatiotemporal data, characterized in that: include: An acquisition unit, used to acquire spatiotemporal data, wherein the spatiotemporal data includes time data, space data, traffic data, environmental data, and socio-economic data; A construction unit, used for performing feature processing on the spatiotemporal data to obtain feature quantities, and constructing a spatiotemporal data matrix based on the feature quantities; A dimension reduction unit, used for reducing the dimension of the spatiotemporal data matrix to obtain a data matrix by using a preset analysis algorithm; A calculation unit, configured to calculate, according to a preset point in the data matrix, a volume of a preset radius centered on the preset point and the number of points within the radius, and calculate a local density based on the number of points within the radius and the volume; a selection unit, configured to calculate the distance between each point in the data matrix and the nearest target point, and select a target neighborhood radius based on the distance and the local density; A setting unit, configured to determine a data dimension based on the number of features, and set a minimum number of points through the data dimension; A marking unit, used for marking each point in the data matrix by a density clustering algorithm according to the target area radius and the minimum number of points, to obtain a clustering result, wherein the clustering result includes a plurality of clusters; An analyzing unit is used to analyze the characteristics of the clustering result based on the multiple clustering clusters.

10. A device for clustering analysis of a population based on spatiotemporal data, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Clustering analysis method and device for power consumption behaviors of power customers

    CN113450142A

  • Continuous space-time multi-source trajectory data frequent pattern recognition method and device

    CN117113286A

  • Depth fair clustering-based demographic data analysis method and system

    CN118013307A

  • Multi-dimensional data processing analysis method, device and system and storage medium

    CN118211038A

  • Artificial intelligence data aggregation method based on big data

    CN118520020A

Cited By

  • Population census clustering method oriented to fairness and balance constraint optimization

    CN120180164A

  • Drainage basin ecological anomaly monitoring method based on clustering processing

    CN120449054A

  • A watershed ecological anomaly monitoring method based on clustering processing

    CN120449054B

  • Full-automatic data crawling method based on search engine service technology

    CN120524018A