Data clustering method and system based on grid clustering algorithm

By introducing grid clustering algorithm and calculation of data clustering selection coefficients into the data clustering method, the problems of poor matching between clustering methods and data and single feature clustering in the existing technology are solved, and more accurate and targeted data clustering effect.

CN119474720AInactive Publication Date: 2025-02-18LIANYUNGANG TECHN COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411488567.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing data clustering methods lack the evaluation of the matching between different clustering algorithms and the data to be clustered, and only use a single feature of the data for clustering, resulting in inaccurate clustering results.

Method used

Using a method based on the grid clustering algorithm, the clustering mesh rectangular and plane rectangular coordinate systems are established, the grid space is marked and the clustering feature data is defined. Then, the data clustering coefficient is obtained by analyzing the clustering feature data, the data clustering selection coefficient is calculated, and the appropriate clustering algorithm is matched based on the comparison result of the coefficient and the threshold.

Benefits of technology

The matching between the clustering algorithm and the data is improved, the accuracy and pertinence of the clustering results are ensured, and the internal structure of the data can be better reflected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474720A_ABST
    Figure CN119474720A_ABST
Patent Text Reader

Abstract

The invention discloses a data clustering method and system based on a grid clustering algorithm, relates to the field of data mining, solves the problem of poor clustering effect of a data clustering method, and comprises the following steps: S1, obtaining target to-be-clustered data, analyzing and establishing a clustering grid rectangle, establishing a clustering plane rectangular coordinate system through the clustering grid rectangle, and establishing a clustering plane rectangular coordinate system through the clustering grid rectangle; the method comprises the following steps: S1, acquiring a first data clustering coefficient, a second data clustering coefficient and a third data clustering coefficient by analyzing the clustering feature data to obtain clustering feature analysis data, and S3, analyzing according to the clustering feature analysis data to obtain a data clustering selection coefficient, and obtaining a data clustering selection coefficient threshold value, carrying out numerical comparison on the data clustering selection coefficient threshold value and the data clustering selection coefficient, and matching a clustering algorithm for the target data to be clustered according to a comparison result, so that the accuracy and the clustering efficiency of the data clustering method can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data mining and relates to data clustering technology, in particular to a data clustering method and system based on a grid clustering algorithm. Background Art

[0002] The existing data clustering methods have the following defects when performing data clustering:

[0003] 1. Existing data clustering methods directly cluster the data to be clustered when clustering data, lacking the evaluation of the matching between different clustering algorithms and the data to be clustered, resulting in poor matching between clustering methods and the data to be clustered;

[0004] 2. Existing clustering methods only use a single feature of the data for clustering, such as distance, density, etc. In practical applications, a data set may contain multiple types of features. Clustering using only a single feature cannot fully reflect the internal structure of the data, resulting in inaccurate clustering results.

[0005] To this end, we propose a data clustering method and system based on grid clustering algorithm. Summary of the invention

[0006] In view of the deficiencies in the prior art, the present invention aims to provide a data clustering method and system based on a grid clustering algorithm. The present invention is based on acquiring target data to be clustered, and analyzing and establishing a clustering grid rectangle, establishing a clustering plane rectangular coordinate system in the clustering grid rectangle, marking a first grid space to an m-th grid space in the clustering plane rectangular coordinate system, defining the clustering plane rectangular coordinate system and the first grid space to the m-th grid space as clustering feature data, acquiring a first data clustering coefficient, a second data clustering coefficient and a third data clustering coefficient by analyzing the clustering feature data, obtaining clustering feature analysis data, obtaining a data clustering selection coefficient based on the clustering feature analysis data, obtaining a data clustering selection coefficient threshold and performing numerical comparison with the data clustering selection coefficient, and matching a clustering algorithm for the target data to be clustered based on the comparison result.

[0007] In order to achieve the above object, the present invention adopts the following technical solution: a data clustering method based on a grid clustering algorithm, comprising the following specific steps:

[0008] Step S1: Obtain target data to be clustered, analyze and establish a clustering grid rectangle, establish a clustering plane rectangular coordinate system in the clustering grid rectangle, mark the first grid space to the mth grid space in the clustering plane rectangular coordinate system, and define the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data;

[0009] Step S2: obtaining a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient by analyzing the clustering feature data to obtain clustering feature analysis data;

[0010] Step S3: Analyze the data according to the clustering feature to obtain the data clustering selection coefficient, obtain the data clustering selection coefficient threshold and compare it with the data clustering selection coefficient, and match the clustering algorithm for the target data to be clustered according to the comparison result.

[0011] Furthermore, the step S1 further includes the following specific steps:

[0012] Step S11: Obtain target data to be clustered;

[0013] Step S12: converting the target data to be clustered into multiple data points, and obtaining the coordinates of the data points;

[0014] Step S13: respectively obtaining the horizontal coordinate X value of each data point coordinate to obtain multiple coordinate X values, comparing the obtained multiple coordinate X values, and defining the coordinate X value with the largest value as the grid coordinate X extreme value;

[0015] Step S14: respectively obtaining the Y value of the ordinate of each data point coordinate to obtain a plurality of coordinate Y values, comparing the obtained plurality of coordinate Y values, and defining the coordinate Y value with the largest value as the grid coordinate Y extreme value;

[0016] Step S15: In the existing grid clustering algorithm platform, the grid coordinate X extreme value is used as the length side of the rectangular box, and the grid coordinate Y extreme value is used as the width side of the rectangular box to obtain a clustering grid rectangle;

[0017] Step S16: Taking the lower left vertex of the clustering grid rectangle as the coordinate origin, taking the lower border of the clustering grid rectangle as the coordinate X-axis, and taking the left border of the clustering grid rectangle as the coordinate Y-axis, to obtain a clustering plane rectangular coordinate system;

[0018] Step S17: Mark each data point according to the data point coordinates to the clustering plane rectangular coordinate system, divide the clustering plane rectangular coordinate system into m grid spaces with the same area, and name them as the first grid space to the mth grid space respectively;

[0019] Step S18: defining the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data.

[0020] Furthermore, the step S12 further includes the following specific steps:

[0021] Step S121: when the target data to be clustered is the first type of data to be clustered, the specific value corresponding to it is used as the first type of data cluster value, the value corresponding to the first characteristic data unit of the first type of data cluster value is marked as the data point abscissa, and the value corresponding to the second characteristic data unit of the first type of data cluster value is marked as the data point ordinate, to obtain the data point coordinates corresponding to the second type of data to be clustered;

[0022] Step S122: when the target data to be clustered is the second type of data to be clustered, the second type of data to be clustered is converted into a Unicode encoding format by a Unicode decoder, and then the Unicode encoding is converted into a binary encoding to obtain a binary encoding corresponding to the second type of data to be clustered;

[0023] Step S123: Use the binary code corresponding to the first text character corresponding to the second type of data to be clustered as the horizontal coordinate of the data point, and use the binary code corresponding to the second text character corresponding to the second type of data to be clustered as the vertical coordinate of the data point to obtain the coordinates of the data point corresponding to the second type of data to be clustered.

[0024] Furthermore, the step S2 further includes the following specific steps:

[0025] Step S21: acquiring cluster feature data, and acquiring the cluster plane rectangular coordinate system and the first grid space to the mth grid space respectively according to the cluster feature data;

[0026] Step S22: acquiring the number of data points in the rectangular coordinate system of the clustering plane to obtain the number of data points in the coordinate system, calculating the ratio of the number of data points in the coordinate system to m, and obtaining the first data clustering coefficient;

[0027] Step S23: Obtain the second data clustering coefficient:

[0028] Step S24: obtaining a third data clustering coefficient;

[0029] Step S25: defining the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient as clustering feature analysis data.

[0030] Furthermore, the step S23 further includes the following specific steps:

[0031] Step S231: respectively acquiring the number of data points corresponding to the first grid space to the m-th grid space, and obtaining the number of data points in the first space to the m-th space;

[0032] Step S232: Calculate the average of the number of spatial data points from the first spatial data point to the mth spatial data point to obtain the average value of the spatial data points;

[0033] Step S233: obtaining a second data clustering coefficient by calculating the number of the first spatial data points to the mth spatial data point and the average value of the spatial data points;

[0034] The clustering coefficient of the second data is calculated.

[0035] Furthermore, the step S24 further includes the following specific steps:

[0036] Step S241: randomly selecting n data points in the first grid space as feature data points, and naming them as the first feature data point to the nth feature data point respectively;

[0037] Step S242: taking the geometric center point of the first grid space as the feature center point, and drawing connecting lines from the first feature data point to the nth feature data point and the feature center point in the first grid space to obtain the first feature connecting line to the nth feature connecting line;

[0038] Step S243: respectively obtaining the length values ​​of the first characteristic line to the nth characteristic line to obtain the distance between the first center data point and the nth center data point;

[0039] Step S244: Calculate the average of the first center data point distance to the nth center data point distance to obtain the average center data point distance corresponding to the first grid space;

[0040] Step S245: respectively obtaining the average center data point distances corresponding to the second grid space to the nth grid space;

[0041] Step S246: Obtain the average center data point distance threshold, and compare the average center data point distance with the average center data point distance threshold.

[0042] Furthermore, the step S246 further includes the following specific steps:

[0043] Step S2461: when the average center data point distance is greater than or equal to the average center data point distance threshold, determining whether the corresponding grid space is a first type grid space;

[0044] Step S2462: When the average center data point distance is less than the average center data point distance threshold, the corresponding grid space is determined to be the second type grid space.

[0045] Furthermore, the step S3 further includes the following specific steps:

[0046] Step S31: obtaining clustering feature analysis data, and obtaining a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient respectively according to the clustering feature analysis data;

[0047] Step S32: obtaining a data clustering selection coefficient by calculating the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient;

[0048] Calculate the data clustering selection coefficient.

[0049] Step S33: obtaining a data clustering selection coefficient threshold and performing a numerical comparison with the data clustering selection coefficient, and matching a clustering algorithm for the target data to be clustered according to the comparison result.

[0050] Furthermore, the step S33 further includes the following specific steps:

[0051] Step S331: respectively obtaining a first data clustering coefficient threshold, a second data clustering coefficient threshold, and a third data clustering coefficient threshold;

[0052] Step S332: obtaining a data clustering selection coefficient threshold by calculating the first data clustering coefficient threshold, the second data clustering coefficient threshold, and the third data clustering coefficient threshold;

[0053] Calculate the data clustering selection coefficient threshold;

[0054] Step S333: When the data clustering selection coefficient is greater than or equal to the data clustering selection coefficient threshold, the K-Means clustering algorithm is matched to perform clustering processing on the target data to be clustered;

[0055] Step S334: When the data clustering selection coefficient is less than the data clustering selection coefficient threshold, the matching hierarchical clustering algorithm is used to perform clustering processing on the target data to be clustered.

[0056] The data clustering system based on the grid clustering algorithm includes:

[0057] Data acquisition module: acquires the target data to be clustered, analyzes and establishes a clustering grid rectangle, establishes a clustering plane rectangular coordinate system in the clustering grid rectangle, marks the first grid space to the mth grid space in the clustering plane rectangular coordinate system, and defines the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data;

[0058] Data analysis module: obtains the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient by analyzing the clustering feature data, and obtains clustering feature analysis data;

[0059] Data clustering module: According to the clustering feature analysis data analysis to obtain the data clustering selection coefficient, obtain the data clustering selection coefficient threshold and compare it with the data clustering selection coefficient, and match the clustering algorithm for the target data to be clustered according to the comparison result.

[0060] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0061] 1. The present invention converts the data to be clustered into data points in multiple grid spaces, analyzes the number, density and center data point distance of the data points, obtains the data clustering selection coefficient to match the clustering algorithm for the data to be clustered, and ensures the accuracy of the clustering algorithm matching results;

[0062] 2. The present invention determines the data clustering selection coefficient by obtaining the data clustering selection coefficient threshold, matches the clustering algorithm to the data to be clustered, ensures the matching between the clustering algorithm and the clustering data, and thus improves the pertinence of the data clustering processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0064] Figure 1 It is a diagram of the implementation steps of the present invention;

[0065] Figure 2 is the overall system block diagram of the present invention;

[0066] Figure 3 A schematic diagram of establishing a rectangular coordinate system for the clustering plane in the present invention. DETAILED DESCRIPTION

[0067] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] Embodiment 1

[0069] See also Figure 1 The present invention provides a technical solution: a data clustering method based on a grid clustering algorithm, comprising the following specific steps:

[0070] Step S1: Obtain target data to be clustered, analyze and establish a clustering grid rectangle, establish a clustering plane rectangular coordinate system in the clustering grid rectangle, mark the first grid space to the mth grid space in the clustering plane rectangular coordinate system, and define the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data;

[0071] Step S11: Obtain target data to be clustered;

[0072] Step S12: converting the target data to be clustered into multiple data points, and obtaining the coordinates of the data points;

[0073] The step S12 further includes the following specific steps:

[0074] Step S121: when the target data to be clustered is the first type of data to be clustered, the specific value corresponding to it is used as the first type of data cluster value, the value corresponding to the first characteristic data unit of the first type of data cluster value is marked as the data point abscissa, and the value corresponding to the second characteristic data unit of the first type of data cluster value is marked as the data point ordinate, to obtain the data point coordinates corresponding to the second type of data to be clustered;

[0075] Step S122: when the target data to be clustered is the second type of data to be clustered, the second type of data to be clustered is converted into a Unicode encoding format by a Unicode decoder, and then the Unicode encoding is converted into a binary encoding to obtain a binary encoding corresponding to the second type of data to be clustered;

[0076] Step S123: taking the binary code corresponding to the first text character corresponding to the second type of data to be clustered as the horizontal coordinate of the data point, and taking the binary code corresponding to the second text character corresponding to the second type of data to be clustered as the vertical coordinate of the data point, to obtain the coordinates of the data point corresponding to the second type of data to be clustered;

[0077] Step S13: respectively obtaining the horizontal coordinate X value of each data point coordinate to obtain multiple coordinate X values, comparing the obtained multiple coordinate X values, and defining the coordinate X value with the largest value as the grid coordinate X extreme value;

[0078] Step S14: respectively obtaining the Y value of the ordinate of each data point coordinate to obtain a plurality of coordinate Y values, comparing the obtained plurality of coordinate Y values, and defining the coordinate Y value with the largest value as the grid coordinate Y extreme value;

[0079] Step S15: In the existing grid clustering algorithm platform, the grid coordinate X extreme value is used as the length side of the rectangular box, and the grid coordinate Y extreme value is used as the width side of the rectangular box to obtain a clustering grid rectangle;

[0080] Step S16: Taking the lower left vertex of the clustering grid rectangle as the coordinate origin, taking the lower border of the clustering grid rectangle as the coordinate X-axis, and taking the left border of the clustering grid rectangle as the coordinate Y-axis, to obtain a clustering plane rectangular coordinate system;

[0081] Step S17: Mark each data point according to the data point coordinates to the clustering plane rectangular coordinate system, divide the clustering plane rectangular coordinate system into m grid spaces with the same area, and name them as the first grid space to the mth grid space respectively;

[0082] Step S18: defining the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data;

[0083] Step S2: obtaining a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient by analyzing the clustering feature data to obtain clustering feature analysis data;

[0084] Step S21: acquiring cluster feature data, and acquiring the cluster plane rectangular coordinate system and the first grid space to the mth grid space respectively according to the cluster feature data;

[0085] Step S22: acquiring the number of data points in the rectangular coordinate system of the clustering plane to obtain the number of data points in the coordinate system, calculating the ratio of the number of data points in the coordinate system to m, and obtaining the first data clustering coefficient;

[0086] Step S23: Obtain the second data clustering coefficient:

[0087] The step S23 further includes the following specific steps:

[0088] Step S231: respectively acquiring the number of data points corresponding to the first grid space to the m-th grid space, and obtaining the number of data points in the first space to the m-th space;

[0089] Step S232: Calculate the average of the number of spatial data points from the first spatial data point to the mth spatial data point to obtain the average value of the spatial data points;

[0090] Step S233: obtaining a second data clustering coefficient by calculating the number of the first spatial data points to the mth spatial data point and the average value of the spatial data points;

[0091] The clustering coefficient of the second data is calculated, and the specific formula configuration is as follows:

[0092]

[0093] Wherein, Jlx2 is the second data clustering coefficient, Ks1 to Ksm are the number of the first spatial data points to the number of the mth spatial data points, respectively, and Ksp is the average value of the spatial data points;

[0094] Step S24: obtaining a third data clustering coefficient;

[0095] The step S24 further includes the following specific steps:

[0096] Step S241: randomly selecting n data points in the first grid space as feature data points, and naming them as the first feature data point to the nth feature data point respectively;

[0097] Step S242: taking the geometric center point of the first grid space as the feature center point, and drawing connecting lines from the first feature data point to the nth feature data point and the feature center point in the first grid space to obtain the first feature connecting line to the nth feature connecting line;

[0098] Step S243: respectively obtaining the length values ​​of the first characteristic line to the nth characteristic line to obtain the distance between the first center data point and the nth center data point;

[0099] Step S244: Calculate the average of the first center data point distance to the nth center data point distance to obtain the average center data point distance corresponding to the first grid space;

[0100] Step S245: respectively obtaining the average center data point distances corresponding to the second grid space to the nth grid space;

[0101] Step S246: obtaining the average center data point distance threshold, and comparing the average center data point distance with the average center data point distance threshold;

[0102] The details are as follows:

[0103] Step S2461: when the average center data point distance is greater than or equal to the average center data point distance threshold, determining whether the corresponding grid space is a first type grid space;

[0104] Step S2462: when the average center data point distance is less than the average center data point distance threshold, determining whether the corresponding grid space is a second type grid space;

[0105] Step S247: performing quantity statistics on the first type of grid spaces to obtain a quantity value of the first type of grid spaces, calculating a ratio of the quantity value of the first type of grid spaces to m, and obtaining a third data clustering coefficient;

[0106] Step S25: defining the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient as clustering feature analysis data;

[0107] Step S3: Analyze the data according to the clustering feature to obtain the data clustering selection coefficient, obtain the data clustering selection coefficient threshold and compare the data clustering selection coefficient with the data clustering selection coefficient, and match the clustering algorithm for the target data to be clustered according to the comparison result;

[0108] Step S31: obtaining clustering feature analysis data, and obtaining a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient respectively according to the clustering feature analysis data;

[0109] Step S32: obtaining a data clustering selection coefficient by calculating the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient;

[0110] Calculate the data clustering selection coefficient. The specific formula configuration is as follows:

[0111]

[0112] Among them, Jxz is the data clustering selection coefficient, Jlx1 is the first data clustering coefficient, Jlx2 is the second data clustering coefficient, and Jlx3 is the third data clustering coefficient.

[0113] Step S33: obtaining a data clustering selection coefficient threshold and performing numerical comparison with the data clustering selection coefficient, and matching a clustering algorithm for the target data to be clustered according to the comparison result;

[0114] The step S33 further includes the following specific steps:

[0115] Step S331: respectively obtaining a first data clustering coefficient threshold, a second data clustering coefficient threshold, and a third data clustering coefficient threshold;

[0116] Step S332: obtaining a data clustering selection coefficient threshold by calculating the first data clustering coefficient threshold, the second data clustering coefficient threshold, and the third data clustering coefficient threshold;

[0117] Calculate the data clustering selection coefficient threshold. The specific formula configuration is as follows:

[0118]

[0119] Wherein, Jxzy is the data clustering selection coefficient threshold, Jlxy1 is the first data clustering coefficient threshold, Jlxy2 is the second data clustering coefficient threshold, and Jlxy3 is the third data clustering coefficient threshold;

[0120] Step S333: When the data clustering selection coefficient is greater than or equal to the data clustering selection coefficient threshold, the K-Means clustering algorithm is matched to perform clustering processing on the target data to be clustered;

[0121] Step S334: when the data clustering selection coefficient is less than the data clustering selection coefficient threshold, the matching hierarchical clustering algorithm is used to perform clustering processing on the target data to be clustered;

[0122] In this application, if corresponding calculation formulas appear, the above calculation formulas are all dimensionless and take their numerical calculations. The weight coefficients, proportional coefficients and other coefficients in the formulas are set to a result value obtained by quantifying each parameter. The size of the weight coefficient and the proportional coefficient can be determined as long as it does not affect the proportional relationship between the parameter and the result value.

[0123] Embodiment 2

[0124] See also Figure 2 , based on another concept of the same invention, a data clustering system based on a grid clustering algorithm is now proposed, comprising a data acquisition module, a data analysis module, a data clustering module and a server, wherein the data acquisition module, the data analysis module and the data clustering module are respectively connected to the server, and the server controls the data acquisition module, the data analysis module and the data clustering module respectively;

[0125] The data acquisition module obtains a clustering grid rectangle by analyzing the target data to be clustered, establishes a clustering plane rectangular coordinate system in the clustering grid rectangle, marks the first grid space to the mth grid space in the clustering plane rectangular coordinate system, and defines the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data;

[0126] Obtain the target data to be clustered;

[0127] It should be noted here that:

[0128] In this application, the target data to be clustered is specifically a data set that needs to be processed by cluster analysis technology to discover its internal structure or pattern, and the target data to be clustered involved here are all in text format;

[0129] The target data to be clustered is divided into a first type of data to be clustered and a second type of data to be clustered according to the text format;

[0130] It should be noted here that:

[0131] The text format corresponding to the first type of data to be clustered involved here is a digital format, and the text format corresponding to the second type of data to be clustered is a non-digital format;

[0132] When the target data to be clustered is the first type of data to be clustered, the specific value corresponding to it is used as the first type of data cluster value, the value corresponding to the first characteristic data unit of the first type of data cluster value is marked as the data point abscissa, and the value corresponding to the second characteristic data unit of the first type of data cluster value is marked as the data point ordinate, to obtain the data point coordinates corresponding to the second type of data to be clustered;

[0133] When the target data to be clustered is the second type of data to be clustered, the second type of data to be clustered is converted into a Unicode encoding format by a Unicode decoder, and then the Unicode encoding is converted into a binary encoding to obtain a binary encoding corresponding to the second type of data to be clustered;

[0134] The binary code corresponding to the first text character corresponding to the second type of data to be clustered is used as the horizontal coordinate of the data point, and the binary code corresponding to the second text character corresponding to the second type of data to be clustered is used as the vertical coordinate of the data point to obtain the coordinates of the data point corresponding to the second type of data to be clustered;

[0135] The horizontal coordinate X value of each data point coordinate is obtained respectively to obtain multiple coordinate X values, and the obtained multiple coordinate X values ​​are numerically compared, and the coordinate X value with the largest value is defined as the grid coordinate X extreme value;

[0136] The Y value of the ordinate of each data point is obtained respectively to obtain multiple Y values ​​of the coordinates, and the multiple Y values ​​of the coordinates are numerically compared, and the Y value of the coordinate with the largest value is defined as the extreme value of the grid coordinate Y;

[0137] In the existing grid clustering algorithm platform, the grid coordinate X extreme value is used as the length side of the rectangular box, and the grid coordinate Y extreme value is used as the width side of the rectangular box to obtain the clustering grid rectangle;

[0138] See also Figure 3 , take the lower left vertex of the clustering grid rectangle as the coordinate origin, the lower border of the clustering grid rectangle as the coordinate X-axis, and the left border of the clustering grid rectangle as the coordinate Y-axis to obtain the clustering plane rectangular coordinate system;

[0139] Mark each data point according to the data point coordinates to the clustering plane rectangular coordinate system, divide the clustering plane rectangular coordinate system into m grid spaces with the same area, and name them as the first grid space to the mth grid space respectively;

[0140] It should be noted here that:

[0141] The m involved here is the quantity value corresponding to the grid space in the rectangular coordinate system of the clustering plane, and m is an integer greater than 0;

[0142] The clustering plane rectangular coordinate system and the first grid space to the mth grid space are defined as clustering feature data;

[0143] The data acquisition module acquires the cluster feature data and transmits it to the data analysis module;

[0144] The data analysis module obtains the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient by analyzing the clustering feature data to obtain clustering feature analysis data;

[0145] Acquire cluster feature data, and acquire the cluster plane rectangular coordinate system and the first grid space to the mth grid space respectively according to the cluster feature data;

[0146] Acquire the number of data points in the rectangular coordinate system of the clustering plane to obtain the number of data points in the coordinate system, calculate the ratio of the number of data points in the coordinate system to m, and obtain the first data clustering coefficient;

[0147] It should be noted here that:

[0148] In this application, m is the quantity value corresponding to the grid space in the rectangular coordinate system of the clustering plane;

[0149] Analyze the data points from the first grid space to the mth grid space respectively to obtain the second data clustering coefficient:

[0150] The details are as follows:

[0151] The numbers of data points corresponding to the first grid space to the m-th grid space are respectively acquired to obtain the number of data points in the first space to the m-th space;

[0152] Calculate the average of the first spatial data point quantity value to the mth spatial data point quantity value to obtain the spatial data point average value;

[0153] The second data clustering coefficient is obtained by calculating the number of the first spatial data point to the number of the mth spatial data point and the average value of the spatial data points;

[0154] The clustering coefficient of the second data is calculated, and the specific formula configuration is as follows:

[0155]

[0156] Wherein, Jlx2 is the second data clustering coefficient, Ks1 to Ksm are the number of the first spatial data points to the number of the mth spatial data points, respectively, and Ksp is the average value of the spatial data points;

[0157] Obtaining the third data clustering coefficient;

[0158] The details are as follows:

[0159] Randomly select n data points in the first grid space as feature data points, and name them as the first feature data point to the nth feature data point respectively;

[0160] It should be noted here that:

[0161] Here, n is the number of feature data points in the first grid space, and n is an integer greater than 0;

[0162] The geometric center point of the first grid space is used as the feature center point, and lines are drawn from the first feature data point to the nth feature data point and the feature center point in the first grid space to obtain the first feature line to the nth feature line;

[0163] The length values ​​of the first characteristic connecting line to the nth characteristic connecting line are respectively obtained to obtain the distance between the first center data point and the nth center data point;

[0164] Calculate the average of the first center data point distance to the nth center data point distance to obtain the average center data point distance corresponding to the first grid space;

[0165] The average center data point distances corresponding to the second grid space to the nth grid space are respectively obtained;

[0166] Obtain the average center data point distance threshold, and compare the average center data point distance with the average center data point distance threshold;

[0167] The details are as follows:

[0168] When the average center data point distance is greater than or equal to the average center data point distance threshold, the corresponding grid space is determined to be the first type of grid space;

[0169] When the average center data point distance is less than the average center data point distance threshold, it is determined that the corresponding grid space is the second type of grid space;

[0170] Performing quantity statistics on the first type of grid space to obtain a quantity value of the first type of grid space, calculating a ratio of the quantity value of the first type of grid space to m, and obtaining a third data clustering coefficient;

[0171] It should be noted here that:

[0172] In this application, m is the quantity value corresponding to the grid space in the rectangular coordinate system of the clustering plane;

[0173] The first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient are defined as clustering feature analysis data;

[0174] The data analysis module acquires the clustering feature analysis data and transmits it to the data clustering module;

[0175] The data clustering module obtains the data clustering selection coefficient based on the clustering feature analysis data, obtains the data clustering selection coefficient threshold and compares the data clustering selection coefficient numerically, and matches the clustering algorithm for the target data to be clustered according to the comparison result;

[0176] Acquire clustering feature analysis data, and respectively acquire a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient according to the clustering feature analysis data;

[0177] The first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient are calculated to obtain a data clustering selection coefficient;

[0178] Calculate the data clustering selection coefficient. The specific formula configuration is as follows:

[0179]

[0180] Among them, Jxz is the data clustering selection coefficient, Jlx1 is the first data clustering coefficient, Jlx2 is the second data clustering coefficient, and Jlx3 is the third data clustering coefficient.

[0181] Obtaining a data clustering selection coefficient threshold and comparing it numerically with the data clustering selection coefficient, and matching a clustering algorithm for the target data to be clustered according to the comparison result;

[0182] The details are as follows:

[0183] respectively obtaining a first data clustering coefficient threshold, a second data clustering coefficient threshold, and a third data clustering coefficient threshold;

[0184] The first data clustering coefficient threshold, the second data clustering coefficient threshold and the third data clustering coefficient threshold are calculated to obtain a data clustering selection coefficient threshold;

[0185] The first data clustering coefficient threshold, the second data clustering coefficient threshold and the third data clustering coefficient threshold involved here can be specifically set for different data to be clustered;

[0186] Calculate the data clustering selection coefficient threshold. The specific formula configuration is as follows:

[0187]

[0188] Wherein, Jxzy is the data clustering selection coefficient threshold, Jlxy1 is the first data clustering coefficient threshold, Jlxy2 is the second data clustering coefficient threshold, and Jlxy3 is the third data clustering coefficient threshold;

[0189] When the data clustering selection coefficient is greater than or equal to the data clustering selection coefficient threshold, the K-Means clustering algorithm is matched to cluster the target data to be clustered;

[0190] When the data clustering selection coefficient is less than the data clustering selection coefficient threshold, the matching hierarchical clustering algorithm is used to cluster the target data to be clustered;

[0191] It should be noted here that:

[0192] K-Means is a partition-based clustering algorithm that aims to divide a data set into K clusters, each cluster is represented by its centroid. The algorithm achieves clustering by iteratively optimizing the cluster centroids.

[0193] Hierarchical clustering is a clustering method based on tree structure. It constructs a dendrogram to represent the clustering relationship of data. Hierarchical clustering can be divided into two main types: agglomerative (bottom-up) and divisive (top-down).

[0194] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A data clustering method based on a grid clustering algorithm, characterized in that: include: Step S1: Obtain target data to be clustered, analyze and establish a clustering grid rectangle, establish a clustering plane rectangular coordinate system in the clustering grid rectangle, mark the first grid space to the mth grid space in the clustering plane rectangular coordinate system, and define the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data; Step S2: obtaining a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient by analyzing the clustering feature data to obtain clustering feature analysis data; Step S3: Analyze the data according to the clustering feature to obtain the data clustering selection coefficient, obtain the data clustering selection coefficient threshold and compare it with the data clustering selection coefficient, and match the clustering algorithm for the target data to be clustered according to the comparison result.

2. The data clustering method based on the grid clustering algorithm according to claim 1, characterized in that: The step S1 further includes the following specific steps: Step S11: Obtain target data to be clustered; Step S12: converting the target data to be clustered into multiple data points, and obtaining the coordinates of the data points; Step S13: respectively obtaining the horizontal coordinate X value of each data point coordinate to obtain multiple coordinate X values, comparing the obtained multiple coordinate X values, and defining the coordinate X value with the largest value as the grid coordinate X extreme value; Step S14: respectively obtain the Y value of the ordinate of each data point coordinate to obtain multiple Y values ​​of the coordinate, compare the multiple Y values ​​of the coordinate obtained, and define the Y value of the coordinate with the largest value as the extreme value of the grid coordinate Y; Step S15: In the existing grid clustering algorithm platform, the grid coordinate X extreme value is used as the length side of the rectangular box, and the grid coordinate Y extreme value is used as the width side of the rectangular box to obtain a clustering grid rectangle; Step S16: Taking the lower left vertex of the clustering grid rectangle as the coordinate origin, taking the lower border of the clustering grid rectangle as the coordinate X-axis, and taking the left border of the clustering grid rectangle as the coordinate Y-axis, to obtain a clustering plane rectangular coordinate system; Step S17: Mark each data point according to the data point coordinates to the clustering plane rectangular coordinate system, divide the clustering plane rectangular coordinate system into m grid spaces with the same area, and name them as the first grid space to the mth grid space respectively; Step S18: defining the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data.

3. The data clustering method based on the grid clustering algorithm according to claim 2, characterized in that: The step S12 further includes the following specific steps: Step S121: when the target data to be clustered is the first type of data to be clustered, the specific value corresponding to it is used as the first type of data cluster value, the value corresponding to the first characteristic data unit of the first type of data cluster value is marked as the data point abscissa, and the value corresponding to the second characteristic data unit of the first type of data cluster value is marked as the data point ordinate, to obtain the data point coordinates corresponding to the second type of data to be clustered; Step S122: when the target data to be clustered is the second type of data to be clustered, the second type of data to be clustered is converted into a Unicode encoding format by a Unicode decoder, and then the Unicode encoding is converted into a binary encoding to obtain a binary encoding corresponding to the second type of data to be clustered; Step S123: Use the binary code corresponding to the first text character corresponding to the second type of data to be clustered as the horizontal coordinate of the data point, and use the binary code corresponding to the second text character corresponding to the second type of data to be clustered as the vertical coordinate of the data point to obtain the coordinates of the data point corresponding to the second type of data to be clustered.

4. The data clustering method based on the grid clustering algorithm according to claim 1, characterized in that: The step S2 further includes the following specific steps: Step S21: acquiring cluster feature data, and acquiring the cluster plane rectangular coordinate system and the first grid space to the mth grid space respectively according to the cluster feature data; Step S22: acquiring the number of data points in the rectangular coordinate system of the clustering plane to obtain the number of data points in the coordinate system, calculating the ratio of the number of data points in the coordinate system to m, and obtaining the first data clustering coefficient; Step S23: Obtain the second data clustering coefficient: Step S24: obtaining a third data clustering coefficient; Step S25: defining the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient as clustering feature analysis data.

5. The data clustering method based on the grid clustering algorithm according to claim 4, characterized in that: The step S23 further includes the following specific steps: Step S231: respectively acquiring the number of data points corresponding to the first grid space to the m-th grid space, and obtaining the number of data points in the first space to the m-th space; Step S232: Calculate the average of the number of spatial data points from the first spatial data point to the mth spatial data point to obtain the average value of the spatial data points; Step S233: obtaining a second data clustering coefficient by calculating the number of the first spatial data points to the mth spatial data point and the average value of the spatial data points; The clustering coefficient of the second data is calculated.

6. The data clustering method based on the grid clustering algorithm according to claim 4, characterized in that: The step S24 further includes the following specific steps: Step S241: randomly selecting n data points in the first grid space as feature data points, and naming them as the first feature data point to the nth feature data point respectively; Step S242: taking the geometric center point of the first grid space as the feature center point, and drawing connecting lines from the first feature data point to the nth feature data point and the feature center point in the first grid space to obtain the first feature connecting line to the nth feature connecting line; Step S243: respectively obtaining the length values ​​of the first characteristic line to the nth characteristic line to obtain the distance between the first center data point and the nth center data point; Step S244: Calculate the average of the first center data point distance to the nth center data point distance to obtain the average center data point distance corresponding to the first grid space; Step S245: respectively obtaining the average center data point distances corresponding to the second grid space to the nth grid space; Step S246: Obtain the average center data point distance threshold, and compare the average center data point distance with the average center data point distance threshold.

7. The data clustering method based on the grid clustering algorithm according to claim 6, characterized in that: The step S246 further includes the following specific steps: Step S2461: when the average center data point distance is greater than or equal to the average center data point distance threshold, determining whether the corresponding grid space is a first type grid space; Step S2462: When the average center data point distance is less than the average center data point distance threshold, the corresponding grid space is determined to be the second type grid space.

8. The data clustering method based on the grid clustering algorithm according to claim 1, characterized in that: The step S3 further includes the following specific steps: Step S31: obtaining clustering feature analysis data, and obtaining a first data clustering coefficient, a second data clustering coefficient, and a third data clustering coefficient respectively according to the clustering feature analysis data; Step S32: obtaining a data clustering selection coefficient by calculating the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient; Calculate the data clustering selection coefficient. Step S33: obtaining a data clustering selection coefficient threshold and performing a numerical comparison with the data clustering selection coefficient, and matching a clustering algorithm for the target data to be clustered according to the comparison result.

9. The data clustering method based on the grid clustering algorithm according to claim 8, characterized in that: The step S33 further includes the following specific steps: Step S331: respectively obtaining a first data clustering coefficient threshold, a second data clustering coefficient threshold, and a third data clustering coefficient threshold; Step S332: obtaining a data clustering selection coefficient threshold by calculating the first data clustering coefficient threshold, the second data clustering coefficient threshold, and the third data clustering coefficient threshold; Calculate the data clustering selection coefficient threshold; Step S333: When the data clustering selection coefficient is greater than or equal to the data clustering selection coefficient threshold, the K-Means clustering algorithm is matched to perform clustering processing on the target data to be clustered; Step S334: When the data clustering selection coefficient is less than the data clustering selection coefficient threshold, the matching hierarchical clustering algorithm is used to perform clustering processing on the target data to be clustered.

10. A data clustering system based on a grid clustering algorithm, applicable to the data clustering method based on a grid clustering algorithm according to any one of claims 1 to 9, characterized in that: The clustering system comprises: Data acquisition module: acquires the target data to be clustered, analyzes and establishes a clustering grid rectangle, establishes a clustering plane rectangular coordinate system in the clustering grid rectangle, marks the first grid space to the mth grid space in the clustering plane rectangular coordinate system, and defines the clustering plane rectangular coordinate system and the first grid space to the mth grid space as clustering feature data; Data analysis module: obtains the first data clustering coefficient, the second data clustering coefficient and the third data clustering coefficient by analyzing the clustering feature data, and obtains clustering feature analysis data; Data clustering module: According to the clustering feature analysis data analysis to obtain the data clustering selection coefficient, obtain the data clustering selection coefficient threshold and compare it with the data clustering selection coefficient, and match the clustering algorithm for the target data to be clustered according to the comparison result.