Spatial data clustering method, system, device and medium with vertical anisotropy
Through careful vertical neighborhood division and calculation of the sum of squares of differences, combined with the K-means++ clustering method of cosine distance, the problem of low efficiency and accuracy of traditional methods in processing vertically heterogeneous data is solved, and spatial data processing is achieved. Efficient clustering and in-depth analysis.
Patent Information
- Application Number
- CN202411025347.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-30
AI Technical Summary
When traditional spatial data clustering methods deal with vertically heterogeneous data, it is difficult to reasonably define the similarity between spatial neighborhoods and measured data points, and the efficiency and accuracy of processing high-dimensional large-scale data are low and cannot be fully considered. The spatial structure and vertical anisotropy characteristics of data.
Through careful vertical neighborhood division and calculation of the sum of squared differences, multi-dimensional feature vectors reflecting vertical heterogeneity are generated, and the K-means++ clustering method of cosine distance is used for spatial clustering, which improves the accuracy and efficiency of clustering.
This method can comprehensively capture the distribution characteristics of spatial grid points in the vertical direction, provide new analysis dimensions and perspectives, enhance the description ability of data and the accuracy of analysis results, and is suitable for oceanography, meteorology and other high-dimensional spatial data. field of analysis.
Smart Images

Figure CN118551248B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of spatial data processing, and in particular relates to a spatial data clustering method, system, equipment and medium with vertical anisotropy. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In geography, vertical anisotropy events refer to geographical phenomena that show significant differences or changes in the vertical direction, such as ocean stratification, atmospheric stratification, groundwater level changes, urban heat island effect, vertical distribution of vegetation and soil layer structure. These events have important impacts on environmental monitoring, resource management, climate change analysis and urban planning.
[0004] Traditional cluster analysis methods face the following problems when dealing with spatial data with vertical anisotropy: first, how to reasonably define spatial neighborhoods and measure the similarity between data points; second, how to deal with high-dimensional and large-scale data sets; and finally, how to improve the accuracy and efficiency of clustering. These problems have a direct impact on the quality of data analysis and the final application effect. For the above problems, traditional solutions usually adopt the following processing methods: some methods construct feature vectors and use non-distance metrics such as cosine similarity and Jaccard similarity to analyze the similarity between data points. Although these methods are more effective in processing high-dimensional data, they cannot fully consider the spatial structure and vertical anisotropy of the data; most existing technologies focus on processing multidimensional data of spatial grids, and use various algorithms to interpolate, standardize and reduce the dimension of the data. However, these processing techniques can usually only be performed on specific dimensions of the data, such as time series analysis, horizontal spatial analysis, etc., and are not universal; at the same time, existing spatial clustering schemes usually use methods such as K-means and DBSCAN. These methods are mainly based on Euclidean distance or Manhattan distance. When these methods process high-dimensional spatial data with vertical distribution characteristics, their processing efficiency and accuracy are low. Summary of the invention
[0005] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a spatial data clustering method, system, device and medium with vertical heterogeneity. The scheme generates a multidimensional feature vector reflecting vertical heterogeneity through detailed vertical neighborhood division and calculation of the sum of squared differences. The scheme can comprehensively capture the distribution characteristics of spatial grid points in the vertical direction, providing a new dimension and perspective for in-depth analysis of data.
[0006] According to a first aspect of an embodiment of the present invention, a spatial data clustering method with vertical anisotropy is provided, comprising:
[0007] Obtain the spatial grid data to be spatially clustered and perform corresponding preprocessing;
[0008] For each grid point in the preprocessed spatial grid point data, obtain the corresponding different vertical neighborhoods respectively;
[0009] Based on the attribute information corresponding to the grid point, combined with the attribute information corresponding to the grid points in the vertical neighborhood of the current grid point, the eigenvalue of the current grid point in different vertical neighborhoods is calculated, and the eigenvector of the grid point is constructed based on the eigenvalue;
[0010] Based on the eigenvector of each grid point, the grid points are spatially clustered using a preset clustering method to obtain a clustering result.
[0011] Furthermore, based on the current grid The spatial rectangular coordinate system centered on is the vertical neighborhood type of the current grid point.
[0012] First vertical neighbor: The grid point centered on the current grid point, located in the YZ plane, and with a distance from the current grid point that meets the preset neighborhood step length is used as the first vertical neighbor of the current grid point;
[0013] Second vertical neighborhood: The grid point centered on the current grid point, located in the XZ plane, and with a distance from the current grid point that meets the preset neighborhood step length, is used as the second vertical neighborhood of the current grid point;
[0014] The third vertical neighbor: a grid point that is parallel to the YZ plane, located on one side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length. This grid point is the third vertical neighbor of the current grid point.
[0015] The fourth vertical neighbor is a grid point that is parallel to the YZ plane, located on the other side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length, and serves as the fourth vertical neighbor of the current grid point;
[0016] Fifth vertical neighbor: a grid point that is parallel to the XZ plane, located on one side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, is the fifth vertical neighbor of the current grid point;
[0017] Sixth vertical neighbor: a grid point that is parallel to the XZ plane, located on the other side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, is used as the sixth vertical neighbor of the current grid point;
[0018] The seventh vertical neighbor: The grid point centered on the current grid point, located on the perpendicular diagonal section formed by the diagonal line of the XY plane and the Z axis, and whose distance from the current grid point meets the preset neighborhood step length, is the seventh vertical neighbor of the current grid point;
[0019] The eighth vertical neighbor: The grid point centered on the current grid point, located on the vertical diagonal section formed by the negative diagonal line of the YX plane and the Z axis, and whose distance from the current grid point meets the preset neighborhood step length, is the eighth vertical neighbor of the current grid point;
[0020] Among them, X, Y and Z are respectively the X-axis, Y-axis and Z-axis of the spatial rectangular coordinate system.
[0021] Furthermore, the calculation of the eigenvalue of the current grid point in different vertical neighborhoods is specifically as follows: based on the attribute information corresponding to the current grid point, the mean of the sum of squares of the differences between it and the attribute information corresponding to each grid point in the current vertical neighborhood is calculated as the eigenvalue of the current grid point in the current vertical neighborhood, and based on the eigenvalues corresponding to the current grid point in different vertical neighborhoods, a eigenvector is constructed.
[0022] Furthermore, the attribute information corresponding to the grid points includes temperature and pressure attribute data.
[0023] Furthermore, the preset clustering method adopts a K-means++ clustering method based on cosine distance.
[0024] Furthermore, the spatial clustering specifically includes the following processing steps:
[0025] Step 1: Initialize the cluster center based on the spatial grid data to be spatially clustered;
[0026] Step 2: Based on the cosine distance, assign the grid points to the nearest cluster center;
[0027] Step 3: Based on the clustering results of each cluster, recalculate the cluster center;
[0028] Step 4: Repeat steps 2 to 3 until the preset requirements are met, end clustering, and obtain the spatial clustering results.
[0029] Furthermore, the corresponding preprocessing includes filling missing values of spatial grid data, modifying outliers and deleting erroneous data points.
[0030] According to a second aspect of an embodiment of the present invention, there is provided a spatial data clustering system with vertical anisotropy, comprising:
[0031] A data acquisition unit, which is used to acquire spatial grid data to be spatially clustered and perform corresponding preprocessing;
[0032] A vertical neighborhood acquisition unit, which is used to respectively acquire different vertical neighborhoods corresponding to each grid point in the preprocessed spatial grid point data;
[0033] A feature extraction unit, which is used to calculate the feature value of the current grid point in different vertical neighborhoods based on the attribute information corresponding to the grid point and the attribute information corresponding to the grid points in the vertical neighborhood of the current grid point, and to construct a feature vector of the grid point based on the feature value;
[0034] The clustering unit is used to perform spatial clustering of the grid points based on the feature vector of each grid point using a preset clustering method to obtain a clustering result.
[0035] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, the method for clustering spatial data with vertical anisotropy is implemented.
[0036] According to a fourth aspect of an embodiment of the present invention, there is provided a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the spatial data clustering method with vertical anisotropy.
[0037] One or more of the above technical solutions have the following beneficial effects:
[0038] (1) The present invention provides a spatial data clustering method, system, device and medium with vertical heterogeneity. The scheme generates a multidimensional feature vector reflecting vertical heterogeneity through detailed vertical neighborhood division and calculation of the sum of squared differences. The scheme can comprehensively capture the distribution characteristics of spatial grid points in the vertical direction, providing a new dimension and perspective for in-depth analysis of data.
[0039] (2) The scheme described in the present invention enhances the ability to describe the vertical heterogeneity characteristics of spatial grid data, providing a richer and more accurate data basis for subsequent processing steps such as cluster analysis; secondly, through this detailed feature extraction, the vertical distribution patterns in the data can be better identified and utilized in subsequent applications, thereby improving the accuracy and reliability of the analysis results.
[0040] (3) The K-means++ method used in the clustering process of the solution described in the present invention optimizes the initial selection of cluster centers, reduces the number of iterations, and improves processing efficiency. At the same time, the application of cosine distance makes cluster analysis more efficient and stable in high-dimensional space.
[0041] (4) The scheme described in the present invention is not only applicable to spatial grid data analysis in fields such as oceanography and meteorology, but can also be extended to other fields that require accurate processing of high-dimensional spatial data, such as bioinformatics and social network analysis, and has broad application prospects.
[0042] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0044] Figure 1 The present invention is a flowchart of a spatial data clustering method with vertical anisotropy described in an embodiment of the present invention.
[0045] Figure 2 Schematic diagram of the first vertical neighborhood described in an embodiment of the present invention.
[0046] Figure 3 Schematic diagram of the second vertical neighborhood described in an embodiment of the present invention.
[0047] Figure 4 Schematic diagram of the third vertical neighborhood described in an embodiment of the present invention.
[0048] Figure 5 Schematic diagram of the fourth vertical neighborhood described in an embodiment of the present invention.
[0049] Figure 6 Schematic diagram of the fifth vertical neighborhood described in an embodiment of the present invention.
[0050] Figure 7 Schematic diagram of the sixth vertical neighborhood described in an embodiment of the present invention.
[0051] Figure 8 Schematic diagram of the seventh vertical neighborhood described in an embodiment of the present invention.
[0052] Fig. 9 Schematic diagram of the eighth vertical neighborhood described in an embodiment of the present invention.
[0053] Fig.10 This is a WSS curve graph corresponding to different K values of the K-means++ clustering algorithm in the example described in the embodiment of the present invention.
[0054] Fig.11 Schematic diagram of clustering results in the IAP global ocean temperature dataset described in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0056] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0057] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0058] Terminology explanation:
[0059] IAP Global Ocean Temperature Dataset: Developed by the Institute of Atmospheric Physics, Chinese Academy of Sciences (IAP), the spatial resolution of this dataset is The vertical depth is 2000 meters and it is divided into 41 layers. It is currently an internationally recognized reliable ocean temperature dataset. The original data of this dataset are all field observation data from the World Ocean Database (WOD).
[0060] Vertical heterogeneity: refers to the variability or difference in the vertical dimension of the data. In spatial grid data, vertical heterogeneity may manifest as data points at different heights or depths having different statistical properties.
[0061] Embodiment 1
[0062] The purpose of this embodiment is to provide a spatial data clustering method with vertical anisotropy.
[0063] like Figure 1 As shown, this embodiment provides a spatial data clustering method with vertical anisotropy, which specifically includes the following processing steps:
[0064] Step 1: Obtain the spatial grid data to be spatially clustered and perform corresponding preprocessing;
[0065] Spatial grid data is obtained by reading special spatial data files. Data preprocessing is the basis of the entire vertical anisotropic pattern clustering algorithm process, which aims to ensure the quality of input spatial grid data and provide accurate and clean data for subsequent analysis steps.
[0066] The data of the spatial grid data set is defined as , where, taking the space rectangular coordinate system as an example, is the number of spatial grid elements on the X axis, is the number of spatial elements on the Y axis, is the number of Z-axis space elements, including spatial grid data elements, a single grid data is defined as ,in, id is the grid point identifier, is the attribute value of the grid point, for example: ocean temperature value; is the time information of the grid points.
[0067] The preprocessing specifically includes identifying and processing missing values, outliers or erroneous data points in the data.
[0068] The processing of missing values is as follows: the default value NULL is assigned to the missing values of spatial grid data;
[0069] The processing of outliers can be: by judging the attribute threshold of spatial grid data To control, when it exceeds this threshold range, the value is assigned to NULL;
[0070] The processing amount for erroneous data points can be: when the spatial grid point attribute value does not meet the interval range , and assign the value to NULL.
[0071] Step 2: For each grid point in the preprocessed spatial grid data, obtain its corresponding different vertical neighborhoods respectively;
[0072] For ease of explanation, the following definitions are given:
[0073] Center grid point: During the traversal process, the center grid point in the current loop is .
[0074] Neighborhood step size: Define a positive real number h>0 as the neighborhood step size, which represents the Cartesian distance from one grid point to another grid point in its neighborhood in space.
[0075] Center Grid Neighborhood: Defining the Grid Points The vertical neighborhood N based on the step size h is a set, which consists of 8 subsets, each of which corresponds to a specific direction neighborhood. ,in, represents the neighborhood set in the i-th direction, .
[0076] The types of vertical neighborhoods are specifically divided into:
[0077] N1 and N2 represent vertical neighborhoods along the z axis, with a step size of h = 1 (e.g. Figure 2 and Figure 3 );
[0078] N3 and N4 represent vertical neighborhoods along the x-axis, with a step size of h = 1 (e.g. Figure 4 and Figure 5 ).
[0079] N5 and N6 represent the vertical neighborhood along the y-axis, with a step size of h = 1 (e.g. Figure 6 and Figure 7 ).
[0080] N7 and N8 represent the direct neighbors of the profile along the two diagonal directions, with a step size of h = 1 (e.g. Figure 8 and Fig. 9 ).
[0081] For the convenience of description, the following definitions are based on the current grid point The vertical neighborhood type of the grid point is described by taking the spatial rectangular coordinate system centered on O (including the X-axis, Y-axis, and Z-axis passing through the origin O and perpendicular to each other):
[0082] like Figure 2 As shown, the first vertical neighborhood of the current grid point is: the grid point centered on the current grid point, located in the YZ plane, and with a distance from the current grid point that meets the preset neighborhood step length, is used as the first vertical neighborhood of the current grid point;
[0083] like Figure 3 As shown, the second vertical neighborhood of the current grid point is: the grid points centered at the current grid point, located in the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, are used as the second vertical neighborhood of the current grid point;
[0084] like Figure 4 As shown, the third vertical neighbor of the current grid point is: a grid point that is parallel to the YZ plane, located on one side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length, as the third vertical neighbor of the current grid point;
[0085] like Figure 5 As shown, the fourth vertical neighborhood of the current grid point is: parallel to the YZ plane, located at YZ
[0086] The grid point on the other side of the plane that meets the preset neighborhood step length from the current grid point is used as the fourth vertical neighbor of the current grid point;
[0087] like Figure 6 As shown, the fifth vertical neighbor of the current grid point is: a grid point that is parallel to the XZ plane, located on one side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, as the fifth vertical neighbor of the current grid point;
[0088] like Figure 7 As shown, the sixth vertical neighbor of the current grid point is: a grid point that is parallel to the XZ plane, located on the other side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, as the sixth vertical neighbor of the current grid point;
[0089] like Figure 8 As shown, the seventh vertical neighborhood of the current grid point is: centered at the current grid point, located at The diagonal plane (i.e., the perpendicular diagonal section plane formed by the diagonal line of the XY plane and the Z axis), and the grid points whose distance from the current grid point meets the preset neighborhood step length, are regarded as the seventh perpendicular neighbors of the current grid point;
[0090] like Fig. 9 As shown, the eighth vertical neighborhood of the current grid point is: centered at the current grid point, located at The diagonal plane (i.e., the vertical diagonal section plane formed by the negative diagonal line of the YX plane and the Z axis), and the grid points whose distance from the current grid point meets the preset neighborhood step length, are regarded as the eighth vertical neighbors of the current grid point.
[0091] The positive diagonal line and the negative diagonal line are relative concepts, and the positive diagonal line and the negative diagonal line are perpendicular to each other.
[0092] Step 3: Based on the attribute information corresponding to the grid point and the attribute information corresponding to the grid points in the vertical neighborhood of the current grid point, the eigenvalues of the current grid point in different vertical neighborhoods are calculated, and the eigenvector of the grid point is constructed based on the eigenvalues;
[0093] Specifically, for the vertical neighborhood set of a grid point , by calculating the central grid point (i.e. the current grid point) and The sum of the squares of the differences generates an 8-dimensional feature vector representing the vertical anisotropy characteristics of the target point; where:
[0094] The square of the difference is calculated as follows: for each neighborhood of the center point N i , calculate the neighboring points P n ( x n , y n , z n ) and the central grid P ( x , y , z ) on a property (such as temperature, pressure, etc.) ,in, V n and V are the attribute values of the neighboring points and the target point respectively.
[0095] Feature vector generation, specifically: average the sum of squared differences of each neighborhood type to form an 8-dimensional feature vector , each represents the eigenvalue of the corresponding neighborhood type, .
[0096] The specific calculation formula is:
[0097]
[0098] Among them, ∣ N i ∣ is the vertical neighborhood N i The number of neighboring points.
[0099] After traversing all spatial grid point data, a set of 8 eigenvectors for each grid point can be obtained.
[0100] In a specific implementation, the attribute information of the grid point may be temperature or pressure, which is determined according to the actual downstream task.
[0101] Step 4: Based on the eigenvector of each grid point, use the preset clustering method to perform spatial clustering of the grid points to obtain the clustering results.
[0102] In the specific implementation, the scheme described in this embodiment adopts the K-means++ clustering method based on cosine distance. K-means++ is an optimized K-means algorithm, which improves the quality and stability of clustering by improving the selection of initial clustering centers. Cosine distance is a measurement method for measuring the difference in directions between two vectors. It is often used for similarity comparison of high-dimensional spatial data, and is particularly suitable for clustering analysis of feature vectors.
[0103] Specifically, the clustering process includes the following processing steps:
[0104] (1) Initialize cluster centers
[0105] The K-means++ method first randomly selects a data point as the first cluster center, and then probabilistically selects the next cluster center based on the shortest distance from each data point to the selected center until K cluster centers are selected. Let D(x) be the distance from data point x to the nearest selected cluster center, then the probability of selecting the next cluster center is equal to D(x) 2 Directly proportional.
[0106] (2) Assign data points to the nearest cluster center
[0107] For each data point, calculate its cosine distance to all cluster centers and assign it to the nearest cluster center. A and B , the cosine distance is defined as ,in, is the dot product of the vectors, and are the magnitudes of the vectors respectively.
[0108] (3) Recalculate cluster centers
[0109] For each cluster, the feature vectors of all data points in the cluster are averaged to obtain a new cluster center. The calculation formula is ,in, is the set of data points in the jth cluster, is the eigenvector of the data point.
[0110] (4) Repeat steps (2) and (3) until the termination condition is met.
[0111] Specifically, when the change of the spatial cluster center is less than a certain threshold or reaches a predetermined number of iterations, the clustering is terminated and the spatial clustering result is obtained.
[0112] Furthermore, in order to verify the effectiveness of the solution described in this embodiment, this embodiment applies the solution to the IAP global ocean temperature grid data set, which specifically includes the following processing steps:
[0113] First, import the global ocean temperature spatial grid dataset, which involves reading data from a NetCDF format file. Perform data cleaning: Identify and remove missing values in the dataset to ensure data quality.
[0114] Spatial analysis and feature extraction,divide each spatial grid point into vertical neighborhoods,and divide the vertical neighborhoods into 8 different types according to their spatial positions,to capture the heterogeneous characteristics of the data in the vertical direction.,Calculate the square sum of the temperature differences between the neighboring points and the target point in each neighborhood type,and generate an 8-dimensional feature vector,which is inserted into the table to form a set of 8-dimensional vectors.
[0115] The K-means++ algorithm based on cosine distance is used for cluster analysis. First, the K value is determined. The larger the K value, the more clusters are divided, and the corresponding sum of the squares of the distances from each point to the cluster center (intra-class distance: WSS) is lower. We determine the inflection point of the curve where WSS decreases with the increase of K, and use 2 to 25 as the value of K to test the optimal K value, such as Fig.10 As shown, the final test K value is 3. According to the similarity between the eigenvectors, the global ocean temperature spatial grid dataset is divided into 3 different categories, each of which represents a specific vertical temperature distribution pattern.
[0116] According to the above process, the vertical anisotropy pattern clustering of the IAP global ocean temperature dataset sample point set is performed, and the clustering results are as follows: Fig.11 As shown, the experiment identified three types of patterns with similar vertical anisotropy.
[0117] In one or more embodiments, the clustering method may also adopt the following method:
[0118] Density-based clustering methods: such as the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm, are used to process spatial grid data. This method does not rely on the number of clusters specified in advance, can identify clusters of any shape, and can process noisy data. This type of clustering method can provide better data clustering effects when considering geometric distribution, especially when the data distribution is complex or the cluster shape is irregular, but this method is not suitable for regularly distributed grid data.
[0119] Hierarchical clustering method: Hierarchical clustering is a bottom-up clustering method that builds a hierarchical structure by gradually merging data points or clusters. This method can provide a multi-level view of data clustering, which helps to understand the inherent structure of the data. The hierarchical clustering method can reveal the hierarchical relationship of the data and is suitable for scenarios that require detailed analysis of the data structure. However, this method has a high computational complexity and is not suitable for large-scale data sets.
[0120] Embodiment 2
[0121] The purpose of this embodiment is to provide a spatial data clustering system with vertical anisotropy.
[0122] A spatial data clustering system with vertical anisotropy, comprising:
[0123] A data acquisition unit, which is used to acquire spatial grid data to be spatially clustered and perform corresponding preprocessing;
[0124] A vertical neighborhood acquisition unit, which is used to respectively acquire different vertical neighborhoods corresponding to each grid point in the preprocessed spatial grid point data;
[0125] A feature extraction unit, which is used to calculate the feature value of the current grid point in different vertical neighborhoods based on the attribute information corresponding to the grid point and the attribute information corresponding to the grid points in the vertical neighborhood of the current grid point, and to construct a feature vector of the grid point based on the feature value;
[0126] The clustering unit is used to perform spatial clustering of the grid points based on the feature vector of each grid point using a preset clustering method to obtain a clustering result.
[0127] It should be noted here that each module in this embodiment corresponds to each step in Example 1 one by one, and the specific implementation process is the same, which will not be repeated here.
[0128] In further embodiments, there is also provided:
[0129] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, no further description is given here.
[0130] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0131] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0132] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method described in embodiment 1 is completed.
[0133] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0134] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in the present embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A spatial data clustering method with vertical anisotropy, characterized in that: include: Obtain the global ocean temperature spatial grid data set to be spatially clustered and perform corresponding preprocessing; wherein the data of the spatial grid data set is defined as , where, in the space rectangular coordinate system, is the number of spatial grid elements on the X-axis, is the number of spatial elements on the Y axis, is the number of Z-axis spatial elements, including spatial grid data elements, a single grid data is defined as ,in, id is the grid point identifier, is the attribute value of the grid point, that is, the ocean temperature value, is the time information of the grid points; For each grid point in the preprocessed spatial grid point data, obtain the corresponding different vertical neighborhoods respectively; Based on the attribute information corresponding to the grid point, combined with the attribute information corresponding to the grid points in the vertical neighborhood of the current grid point, the eigenvalue of the current grid point in different vertical neighborhoods is calculated, and the eigenvector of the grid point is constructed based on the eigenvalue; Based on the eigenvector of each grid point, the grid points are spatially clustered using a preset clustering method to obtain clustering results; wherein, according to the similarity between the eigenvectors, the global ocean temperature spatial grid point dataset is divided into several categories, each category representing a specific vertical temperature distribution pattern; Among them, based on the current grid The spatial rectangular coordinate system centered on is the vertical neighborhood type of the current grid point. First vertical neighbor: The grid point centered on the current grid point, located in the YZ plane, and with a distance from the current grid point that meets the preset neighborhood step length is used as the first vertical neighbor of the current grid point; Second vertical neighborhood: The grid point centered on the current grid point, located in the XZ plane, and with a distance from the current grid point that meets the preset neighborhood step length, is used as the second vertical neighborhood of the current grid point; The third vertical neighbor: a grid point that is parallel to the YZ plane, located on one side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length. This grid point is the third vertical neighbor of the current grid point. The fourth vertical neighbor is a grid point that is parallel to the YZ plane, located on the other side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length, and serves as the fourth vertical neighbor of the current grid point; Fifth vertical neighbor: a grid point that is parallel to the XZ plane, located on one side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, is the fifth vertical neighbor of the current grid point; Sixth vertical neighbor: a grid point that is parallel to the XZ plane, located on the other side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, is used as the sixth vertical neighbor of the current grid point; The seventh vertical neighbor: The grid point centered on the current grid point, located on the perpendicular diagonal section formed by the diagonal line of the XY plane and the Z axis, and whose distance from the current grid point meets the preset neighborhood step length, is the seventh vertical neighbor of the current grid point; The eighth vertical neighbor: The grid point centered on the current grid point, located on the vertical diagonal section formed by the negative diagonal line of the YX plane and the Z axis, and whose distance from the current grid point meets the preset neighborhood step length, is the eighth vertical neighbor of the current grid point; Among them, X, Y and Z are the X-axis, Y-axis and Z-axis of the spatial rectangular coordinate system respectively; The calculating of the characteristic value of the current grid point in different vertical neighborhoods is specifically as follows: based on the attribute information corresponding to the current grid point, the average of the sum of squares of the difference between the attribute information corresponding to the current grid point and the attribute information corresponding to each grid point in the current vertical neighborhood is calculated as the characteristic value of the current grid point in the current vertical neighborhood, and based on the characteristic values corresponding to the current grid point in different vertical neighborhoods, a characteristic vector is constructed; The preset clustering method adopts the K-means++ clustering method based on cosine distance.
2. A spatial data clustering method with vertical anisotropy as claimed in claim 1, characterized in that: The spatial clustering specifically includes the following processing steps: Step 1: Initialize the cluster center based on the spatial grid data to be spatially clustered; Step 2: Based on the cosine distance, assign the grid points to the nearest cluster center; Step 3: Based on the clustering results of each cluster, recalculate the cluster center; Step 4: Repeat steps 2 to 3 until the preset requirements are met, end clustering, and obtain the spatial clustering results.
3. A spatial data clustering method with vertical anisotropy as claimed in claim 1, characterized in that: The corresponding preprocessing includes filling missing values of spatial grid data, modifying outliers and deleting erroneous data points.
4. A spatial data clustering system with vertical anisotropy, characterized in that: include: A data acquisition unit is used to acquire a global ocean temperature spatial grid data set to be spatially clustered and perform corresponding preprocessing; wherein the data of the spatial grid data set is defined as , where, in the space rectangular coordinate system, is the number of spatial grid elements on the X-axis, is the number of spatial elements on the Y axis, is the number of Z-axis spatial elements, including spatial grid data elements, a single grid data is defined as ,in, id is the grid point identifier, is the attribute value of the grid point, that is, the ocean temperature value, is the time information of the grid points; A vertical neighborhood acquisition unit, which is used to respectively acquire different vertical neighborhoods corresponding to each grid point in the preprocessed spatial grid point data; A feature extraction unit, which is used to calculate the feature value of the current grid point in different vertical neighborhoods based on the attribute information corresponding to the grid point and the attribute information corresponding to the grid points in the vertical neighborhood of the current grid point, and to construct a feature vector of the grid point based on the feature value; A clustering unit is used to perform spatial clustering of grid points based on the feature vector of each grid point using a preset clustering method to obtain a clustering result; wherein the global ocean temperature spatial grid point dataset is divided into several categories according to the similarity between the feature vectors, and each category represents a specific vertical temperature distribution pattern; Among them, based on the current grid The spatial rectangular coordinate system centered on is the vertical neighborhood type of the current grid point. First vertical neighbor: The grid point centered on the current grid point, located in the YZ plane, and with a distance from the current grid point that meets the preset neighborhood step length is used as the first vertical neighbor of the current grid point; Second vertical neighborhood: The grid point centered on the current grid point, located in the XZ plane, and with a distance from the current grid point that meets the preset neighborhood step length, is used as the second vertical neighborhood of the current grid point; The third vertical neighbor: a grid point that is parallel to the YZ plane, located on one side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length. This grid point is the third vertical neighbor of the current grid point. The fourth vertical neighbor is a grid point that is parallel to the YZ plane, located on the other side of the YZ plane, and whose distance from the current grid point meets the preset neighborhood step length, and serves as the fourth vertical neighbor of the current grid point; Fifth vertical neighbor: a grid point that is parallel to the XZ plane, located on one side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, is the fifth vertical neighbor of the current grid point; Sixth vertical neighbor: a grid point that is parallel to the XZ plane, located on the other side of the XZ plane, and whose distance from the current grid point meets the preset neighborhood step length, is used as the sixth vertical neighbor of the current grid point; The seventh vertical neighbor: The grid point centered on the current grid point, located on the perpendicular diagonal section formed by the diagonal line of the XY plane and the Z axis, and whose distance from the current grid point meets the preset neighborhood step length, is the seventh vertical neighbor of the current grid point; The eighth vertical neighbor: The grid point centered on the current grid point, located on the vertical diagonal section formed by the negative diagonal line of the YX plane and the Z axis, and whose distance from the current grid point meets the preset neighborhood step length, is the eighth vertical neighbor of the current grid point; Among them, X, Y and Z are the X-axis, Y-axis and Z-axis of the spatial rectangular coordinate system respectively; The calculating of the characteristic value of the current grid point in different vertical neighborhoods is specifically as follows: based on the attribute information corresponding to the current grid point, the average of the sum of squares of the difference between the attribute information corresponding to the current grid point and the attribute information corresponding to each grid point in the current vertical neighborhood is calculated as the characteristic value of the current grid point in the current vertical neighborhood, and based on the characteristic values corresponding to the current grid point in different vertical neighborhoods, a characteristic vector is constructed; The preset clustering method adopts the K-means++ clustering method based on cosine distance.
5. An electronic device comprising a memory, a processor and a computer program stored and running on the memory, characterized in that: When the processor executes the program, a spatial data clustering method with vertical anisotropy as described in any one of claims 1 to 3 is implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a spatial data clustering method with vertical anisotropy as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Adjacent grid temperature stratification detail forecast method and system
CN107330189A
Object-oriented multi-level interpretation method and system for live-action three-dimensional model
CN111754618A
Multi-dimensional hybrid indexing method and system for remote sensing big data
CN113434736A
Data clustering analysis method based on mobile grid density
CN115374856A
Method and device for extracting 3D abnormal region of regular three-dimensional semantic point cloud
CN117611805A
