Social data clustering push method and device based on local sensitive hashing

CN122796304BActive Publication Date: 2026-11-03CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611231427.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-11-03
Estimated Expiration
2046-08-14

AI Technical Summary

Technical Problem

Cluster analysis of high-dimensional user behavior data in social networks faces challenges such as the initial cluster centroids easily getting trapped in local optima and high computational complexity in high-dimensional feature spaces. This results in niche interest groups being unable to cluster independently and excessive consumption of computational resources, affecting the accuracy of content recommendation and system efficiency.

Method used

A social data clustering and push method based on locality-sensitive hashing is adopted. By generating hash values ​​of data points to be clustered, effective swap pairs are screened, and the cluster center points are optimized in multiple rounds of iteration. The difference in hash values ​​is used to quickly filter swap pairs, reduce detailed clustering cost evaluation, and gradually approach the global optimum.

Benefits of technology

It improves clustering optimization efficiency, enhances the accuracy of content push, can identify the interests of niche groups, achieves more accurate content recommendations, and improves user interaction rate and system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122796304B_ABST
    Figure CN122796304B_ABST
Patent Text Reader

Abstract

The application relates to a social data clustering pushing method and device based on local sensitive hashing. The method quickly filters out candidate exchange pairs with the same hash value through different hash values. The pre-screening mechanism based on the hash value significantly reduces the number of exchange pairs that need to be evaluated in detail, thereby greatly improving the iteration optimization efficiency. In addition, the iteration optimization process provided by the method gradually introduces new candidate non-center points and evaluates their potential to replace existing center points, so that the clustering center point set can gradually approach the global optimal solution. This mechanism avoids the defect that the traditional k-means algorithm is easy to fall into local optimization, and overcomes the limitation that the existing local search algorithm cannot bring substantial optimization when processing high-dimensional data because the replacement operation is mainly around the adjacent samples. The application can realize the clustering of multiple social accounts, further mine the preferences of the multiple social accounts, and realize more accurate content recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data clustering technology, and in particular to a social data clustering and push method and apparatus based on locality-sensitive hashing. Background Technology

[0002] With the deep penetration of digital technology into social networks, unsupervised clustering analysis of massive high-dimensional data has become a core foundational capability supporting refined business operations.

[0003] In the operation of social networking platforms, user behavior data has experienced explosive growth. Individual accounts often contain multi-dimensional features such as browsing content sequences, dwell time distribution, and interaction statistics. After feature extraction, this data forms high-dimensional vectors with dimensions reaching thousands or even higher, posing a significant challenge to cluster analysis. Traditional clustering algorithms have significant drawbacks in handling such scenarios: the random selection mechanism of initial cluster centers easily gets trapped in local optima, preventing small groups of users with unique behavioral patterns from forming independent clusters. Specifically, when the sample points of niche interest groups are far from the center points of mainstream groups, the algorithm only replaces the center points based on the nearest neighbor principle, causing these groups to be consistently merged into large clusters, their personalized features being submerged by mainstream data. This phenomenon directly leads to over-generalization of content recommendation systems, resulting in a continuous decline in user engagement with pushed content. Simultaneously, calculating the full clustering cost in a high-dimensional feature space requires massive vector distance calculations. At a user scale of hundreds of millions, the computational complexity of a single iteration increases exponentially, making it difficult for existing computing resources to support real-time processing requirements. Furthermore, while locality-sensitive hashing can accelerate near nearest neighbor search, when directly applied to cluster center optimization, it lacks a targeted mechanism for handling hash collisions and cannot effectively identify candidate replacement points that can improve clustering quality, resulting in the long-term unmet clustering needs of niche groups.

[0004] The above problems urgently need to be solved through technology. Summary of the Invention

[0005] To achieve the above objectives, a first aspect of this disclosure proposes a social data clustering and push method based on locality-sensitive hashing, the method comprising: Multiple social data sequences corresponding to multiple social accounts are determined, and the sequence feature vector corresponding to each social data sequence is used as a data point to be clustered, resulting in multiple data points to be clustered; the social data sequence includes at least one of browsing content, browsing duration, number of likes and collections; Multiple cluster centers are selected from the multiple data points to be clustered, and an initial set of centers is constructed based on the multiple cluster centers; Based on the locality-sensitive hash mapping function, the hash value of each data point to be clustered is generated; Perform multiple rounds of iteration, where the i-th round of iteration includes: From the plurality of data points to be clustered, select the i-th candidate non-center point; Obtain the (i-1)th center point set; wherein, when i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration, and when i is 1, the (i-1)th center point set is the initial center point set; Multiple candidate swap pairs are selected for the i-th candidate non-center point, and each candidate swap pair is traversed. If the hash values ​​between the two points in a candidate swap pair are different, the candidate swap pair is taken as a valid swap pair for the i-th candidate non-center point; wherein, any candidate swap pair includes the i-th candidate non-center point and a cluster center point. If at least one set of the effective swap pairs exists at the i-th candidate non-center point, one set of the effective swap pairs is selected as the optimal effective swap pair; The candidate non-center point in the optimal effective exchange pair is evaluated as a replacement for the cluster center point in the optimal effective exchange pair. If the evaluation result is that the replacement is better, the candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)th center point set to obtain the i-th center point set. After the iteration termination condition is triggered, the set of centroids after the last iteration is obtained, and the clustering of the multiple data points to be clustered is completed based on the set of centroids after the last iteration to obtain the clustering result; Content is pushed to multiple social media accounts based on the clustering results.

[0006] The method provided in the first aspect above has at least the following beneficial effects: This embodiment uses vectors corresponding to the social data sequences of each social account, such as browsing content, browsing duration, number of likes, and number of favorites, as data points. Multiple cluster centers are then selected from the data points to be clustered. A candidate swap pair is constructed with each cluster center and a candidate non-center. By using different hash values, candidate swap pairs with the same hash value are quickly filtered out. This hash-based pre-screening mechanism significantly reduces the number of swap pairs requiring detailed clustering cost evaluation, thereby greatly improving the efficiency of iterative optimization. Furthermore, during the iterative optimization process, by continuously introducing new candidate non-centers and evaluating their potential to replace existing centers, the cluster center set gradually approaches the global optimum. This mechanism avoids the pitfalls of traditional k-means algorithms, which are prone to getting trapped in local optima, thus improving the accuracy of content recommendations. Through the above technical solution, clustering of multiple social accounts can be achieved, thereby uncovering the preferences of multiple social accounts and enabling more accurate content recommendations.

[0007] To achieve the above objectives, a second aspect of this disclosure provides a social data clustering and push device based on locality-sensitive hashing, the device comprising: The data point acquisition module is used to determine multiple social data sequences corresponding to multiple social accounts, and to use the sequence feature vector corresponding to each social data sequence as a data point to be clustered, thereby obtaining multiple data points to be clustered; the social data sequence includes at least one of browsing content, browsing duration, number of likes and collections; The initial centroid selection module is used to select multiple cluster centroids from the multiple data points to be clustered, and to construct an initial centroid set based on the multiple cluster centroids; The hash value generation module is used to generate the hash value of each data point to be clustered based on the locality-sensitive hash mapping function. The center point selection module is used to perform multiple rounds of iteration, where the i-th round of iteration includes: From the plurality of data points to be clustered, select the i-th candidate non-center point; Obtain the (i-1)th center point set; wherein, when i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration, and when i is 1, the (i-1)th center point set is the initial center point set; Multiple candidate swap pairs are selected for the i-th candidate non-center point, and each candidate swap pair is traversed. If the hash values ​​between the two points in a candidate swap pair are different, the candidate swap pair is taken as a valid swap pair for the i-th candidate non-center point; wherein, any candidate swap pair includes the i-th candidate non-center point and a cluster center point. If at least one set of the effective swap pairs exists at the i-th candidate non-center point, one set of the effective swap pairs is selected as the optimal effective swap pair; The candidate non-center point in the optimal effective exchange pair is evaluated as a replacement for the cluster center point in the optimal effective exchange pair. If the evaluation result is that the replacement is better, the candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)th center point set to obtain the i-th center point set. The data clustering module is used to obtain the set of centroids after the last iteration after the iteration termination condition is triggered, and to complete the clustering of the multiple data points to be clustered based on the set of centroids after the last iteration, so as to obtain the clustering result. The content push module is used to push content to multiple social accounts based on the clustering results.

[0008] To achieve the above objectives, a third aspect of this disclosure provides an electronic device including at least one controller and a memory for communicatively connecting to the controller; the memory stores instructions executable by the at least one controller, which, when executed by the at least one controller, cause the at least one controller to perform: a social data clustering and push method based on locality-sensitive hashing as described in the first aspect embodiment.

[0009] To achieve the above objectives, a fourth aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform: a social data clustering and push method based on locality-sensitive hashing as described in the first aspect embodiment.

[0010] It is understood that the beneficial effects of the second to fourth aspects compared with the related technologies are the same as the beneficial effects of the first aspect compared with the related technologies. Please refer to the relevant description in the first aspect above, which will not be repeated here. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or related technologies will be introduced below. Obviously, the accompanying drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A schematic diagram illustrating a social data clustering and push method based on locality-sensitive hashing provided in an embodiment of this application; Figure 2A schematic diagram of a social data clustering and push device based on locality-sensitive hashing provided in an embodiment of this application; Figure 3 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0014] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0015] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0016] In unsupervised clustering analysis of massive high-dimensional data on social networking platforms, traditional K-Means algorithms are prone to getting trapped in local optima due to the random selection mechanism of initial cluster centers. Specifically, small user groups, due to their small sample size and feature vectors being far from the mainstream centers, cannot form independent clusters through the neighbor replacement strategy during iteration and are incorrectly classified as marginal noise of large clusters. Furthermore, the high computational complexity of calculating the full distance in the high-dimensional feature space makes the clustering cost evaluation in a single iteration too computationally expensive on datasets of hundreds of millions, making real-time processing difficult.

[0017] If these issues are not addressed, clustering results will fail to accurately reflect the true distribution of users' interests, high-value user groups will not receive targeted content recommendations, and the accuracy of system recommendations will continue to decline. Consequently, user satisfaction will decrease, platform user activity will weaken, and computational resources will be heavily consumed in ineffective iterations, impacting overall system efficiency and the realization of business value.

[0018] Some embodiments of this application are described with reference to... Figure 1 This paper provides a social data clustering and push method based on locality-sensitive hashing, the method including: Step S110: Determine multiple social data sequences corresponding to multiple social accounts, and use the sequence feature vector corresponding to each social data sequence as the data points to be clustered to obtain multiple data points to be clustered; the social data sequences include at least one of browsing content, browsing duration, number of likes and collections; Step S120: Select multiple cluster centers from multiple data points to be clustered, and construct an initial center set based on the multiple cluster centers; Step S130: Generate the hash value of each data point to be clustered based on the locality-sensitive hash mapping function; Step S140: Perform multiple rounds of iteration, where the i-th round of iteration includes: Select the i-th candidate non-center point from multiple data points to be clustered; Obtain the (i-1)th center point set; where, if i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration, and if i is 1, the (i-1)th center point set is the initial center point set; For the i-th candidate non-center point, select multiple sets of candidate swap pairs, and traverse each set of candidate swap pairs. If the hash values ​​between the two points in a set of candidate swap pairs are different, then the set of candidate swap pairs is taken as the valid swap pair for the i-th candidate non-center point. Among them, any candidate swap pair includes the i-th candidate non-center point and a cluster center point. If there is at least one set of valid swap pairs at the i-th candidate non-center point, select one of the valid swap pairs as the optimal valid swap pair; The i-th candidate non-center point in the optimal effective exchange pair is evaluated as a replacement for the cluster center point in the optimal effective exchange pair. If the evaluation result is that the replacement is better, the i-th candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)-th center point set, thus obtaining the i-th center point set. Step S150: After triggering the iteration termination condition, obtain the set of centroids after the last iteration, and perform clustering of multiple data points to be clustered based on the set of centroids after the last iteration to obtain the clustering result; Step S160: Push content to multiple social media accounts based on the clustering results.

[0019] For ease of understanding, the following explains some key terms in this embodiment: Social data sequences refer to the collection of behavioral data generated by users over a period of time within a social network environment. Data sequences can include at least one of several pieces of information, such as the type of content a user browses, browsing duration, likes, and the number of favorites. This data reflects the user's interests, preferences, and behavioral patterns.

[0020] Sequence feature vectors are numerical vectors that can be calculated and compared in a mathematical space by using specific feature extraction methods to transform the aforementioned social data sequences.

[0021] Data points to be clustered refer to the sequence feature vector corresponding to each social data sequence as an independent point. These points constitute the data set that needs to be clustered, with each point representing a user's behavioral characteristics.

[0022] Cluster centroids are data points that represent the core characteristics of a cluster during the clustering process. These centroids are used to divide the data points into different clusters, thus achieving data classification.

[0023] The initial centroid set refers to a pre-selected set of cluster centroids at the start of the clustering iteration process. This set provides the initial state for subsequent iterative optimization.

[0024] Locality-Sensitive Hash (LSH) is a hashing technique that maps similar data points to the same hash bucket, or to the same hash bucket with a high probability. LSH can reduce the dimensionality of high-dimensional data and accelerate similarity searches, thereby improving the efficiency of clustering algorithms.

[0025] A candidate non-center point refers to a non-cluster center point selected from the data points to be clustered during the iteration process. This embodiment needs to consider whether the non-cluster center point has the potential to become a new cluster center point.

[0026] The set of centroids refers to the collection of all cluster centroids determined at a certain stage of the clustering iteration. The set is continuously updated and optimized as the iteration progresses.

[0027] A candidate swap pair is a pair of data points consisting of a candidate non-center point and an existing cluster center point when evaluating whether to replace a cluster center point.

[0028] A valid swap pair is one in which the hash values ​​of a candidate non-centroid and a cluster centroid differ. This difference indicates that the two points may belong to different hash buckets, thus providing potential optimization space for the replacement operation.

[0029] The optimal effective swap pair refers to the set of swap pairs that are considered to have the best replacement effect after evaluation among multiple effective swap pairs.

[0030] The iteration termination condition refers to the criteria used to determine when to stop the iteration when a clustering algorithm performs multiple iterations. For example, the iteration process can terminate when the cluster centroids no longer change significantly, or when the preset maximum number of iterations is reached.

[0031] Clustering results refer to the process of assigning all data points to different clusters based on their distance from the final set of centroids after the iteration is completed and the final centroid set is obtained. Each cluster represents a type of social media accounts with similar characteristics.

[0032] Content recommendation refers to recommending similar or customized content to social media accounts belonging to the same cluster based on clustering results. The process aims to increase user interest in the content and improve engagement.

[0033] This embodiment provides a social data clustering and push method based on locality-sensitive hashing. The method first identifies multiple social data sequences corresponding to multiple social accounts, and uses the sequence feature vector corresponding to each social data sequence as a data point to be clustered, thus obtaining multiple data points to be clustered. The social data sequences may include at least one of the following: browsing content, browsing duration, number of likes, and number of favorites. For example, users' browsing history and interaction behavior on social platforms can be manually collected and organized into time series data. Subsequently, by manually defining features or extracting features using a pre-trained model, these sequence data are converted into high-dimensional numerical vectors, which serve as data points to be clustered.

[0034] Next, multiple cluster centers are selected from the data points to be clustered, and an initial set of centers is constructed based on these centers. For example, K points can be randomly selected from the data points to be clustered as the initial cluster centers. This random selection method is simple to operate, but it may result in an unfavorable distribution of the initial centers, affecting the subsequent clustering results.

[0035] Subsequently, based on the locality-sensitive hash mapping function, the hash value of each data point to be clustered is generated.

[0036] Furthermore, the method performs multiple iterations. In the i-th iteration, the i-th candidate non-center point is first selected from multiple data points to be clustered. For example, a point can be randomly selected from all data points not belonging to the current center point set as the i-th candidate non-center point. This random selection method is simple and easy to implement, but it may not be effective in discovering non-center points that contribute significantly to the optimization of cluster centers.

[0037] In each iteration, the (i-1)th set of center points needs to be obtained. Specifically, if i is greater than 1, the (i-1)th set of center points is the set of center points after the (i-1)th iteration; if i is 1, the (i-1)th set of center points is the initial set of center points. This process ensures that the iteration can continue based on the optimization results of the previous round.

[0038] For the i-th candidate non-centroid, multiple candidate swap pairs are selected, and each pair is iterated. If the hash values ​​of the two points in a candidate swap pair are different, the swap pair is considered a valid swap pair for the i-th candidate non-centroid. Any candidate swap pair includes the i-th candidate non-centroid and a cluster center. For example, the cluster center closest to the i-th candidate non-centroid can be selected to form a candidate swap pair. If the hash value of the candidate non-centroid is different from that of the nearest cluster center, it is considered a valid swap pair. This approach only considers the nearest centroid and may overlook other potential optimization opportunities.

[0039] If at least one valid swap pair exists for the i-th candidate non-centroid, select one of these valid swap pairs as the optimal valid swap pair. For example, if multiple valid swap pairs exist, one can be randomly selected as the optimal valid swap pair. However, this random selection method may not guarantee that the selected swap pair will bring the maximum clustering optimization effect.

[0040] Next, the replacement of the cluster center in the optimal effective swap pair with the i-th candidate non-center point is evaluated. If the evaluation result indicates that the replacement is better, the i-th candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)-th center point set, resulting in the i-th center point set. For example, the sum of the Euclidean distances from all data points to be clustered to their nearest center point before and after the replacement (i.e., the complete clustering cost) can be calculated, and the cost before and after the replacement can be compared to determine whether the replacement is better. However, for high-dimensional data, calculating the complete clustering cost would incur a huge computational burden.

[0041] After the iteration termination condition is triggered, the set of centroids after the last iteration is obtained, and the clustering of multiple data points to be clustered is completed based on the set of centroids after the last iteration, resulting in the clustering result. For example, the iteration termination condition can be set to a preset maximum number of iterations. When the maximum number of iterations is reached, the iteration stops, and all data points to be clustered are assigned to the nearest cluster based on the final set of centroids.

[0042] Finally, content is pushed to multiple social media accounts based on the clustering results. For example, users belonging to the same cluster can be pushed content that is generally of interest to users within the cluster.

[0043] The following example will provide a more detailed explanation of the above technical solution: Suppose a social media platform has a large number of users, and each user's browsing, liking, and saving activities constitute their social data sequence. The platform's goal is to cluster users based on this behavioral data in order to provide personalized content recommendations, solving the problems of traditional methods such as merging niche groups into large categories and the high computational cost of high-dimensional data.

[0044] First, the platform identifies the social data sequence for each user (social media account). For example, user A might have browsed tech content, liked digital products, and saved programming tutorials in the past week; this behavioral data is collected and forms user A's social data sequence. Then, through preprocessing and feature extraction, user A's social data sequence is transformed into a high-dimensional sequence feature vector, which serves as the data points to be clustered for user A. The platform performs the same process for all users, resulting in multiple data points to be clustered.

[0045] Next, the platform selects multiple cluster centers from these data points to be clustered and constructs an initial set of centers. For example, the platform can randomly select data points from K users as initial cluster centers.

[0046] Then, to address the computational challenges posed by high-dimensional data, the platform generates a hash value for each data point to be clustered based on a locality-sensitive hashing function. The hash value can reflect the similarity between data points with high probability, thus replacing complex distance calculations in subsequent similarity assessments.

[0047] Subsequently, the system enters a multi-round iterative process. In the i-th iteration, the platform selects the i-th candidate non-center point from the data points to be clustered. For example, through a strategic sampling method, a user data point that does not currently belong to any cluster center is selected, as this point is considered to potentially optimize the current clustering structure. At the same time, the system obtains the current center point set (i.e., the (i-1)-th center point set).

[0048] For the i-th candidate non-centroid, the system selects multiple candidate swap pairs. Each candidate swap pair contains a candidate non-centroid and a current cluster centroid. The system iterates through these candidate swap pairs and determines whether the hash values ​​of the two points (candidate non-centroid and cluster centroid) are different. If the hash values ​​are different, the swap pair is marked as a valid swap pair. Determining hash value differences avoids performing precise distance calculations for all data points, significantly reducing computational load.

[0049] If at least one valid swap pair exists, the system will further evaluate these valid swap pairs and select one of them as the optimal valid swap pair. The evaluation process aims to find the swap pair that will maximize the improvement in clustering performance after replacement.

[0050] Next, the replacement of the cluster center in the optimal effective swap pair with the i-th candidate non-center point is evaluated. The evaluation process no longer requires calculating the full clustering cost; instead, it uses a more efficient approximate evaluation method. For example, based on the characteristics of locality-sensitive hashing, only a subset of data points can be sampled for evaluation, quickly determining whether the replacement reduces the clustering cost. If the evaluation result indicates that the replacement is superior, the system will use the i-th candidate non-center point as the new cluster center, replacing the corresponding cluster center in the (i-1)-th center set, thus obtaining the i-th center set. This replacement mechanism allows data points from smaller groups to also have the opportunity to become new cluster centers, avoiding the local optimum trap of being attracted by large clusters.

[0051] The iterative process continues until a preset iteration termination condition is triggered, such as reaching the maximum number of iterations or the centroid set no longer changing significantly. After the iteration ends, the system obtains the centroid set after the last iteration and performs clustering of all data points to be clustered based on the centroid set, obtaining the final clustering result.

[0052] Finally, based on the clustering results, the platform pushes content to multiple social media accounts. For example, if user A is clustered into the tech enthusiasts group, the system will push the latest tech news, digital product reviews, and other content to user A. In this way, each user receives content highly matched to their interests, improving the accuracy of content recommendations and user interaction rates.

[0053] This embodiment significantly reduces the number of precise distance calculations by generating hash values ​​for data points and determining valid swap pairs based on hash value differences, thereby greatly improving the algorithm's running efficiency. Furthermore, by strategically selecting candidate non-centroids and multiple candidate swap pairs and evaluating replacement operations, it overcomes the trap of traditional K-Means algorithms easily falling into local optima. Additionally, the iterative replacement mechanism allows even non-centroids that are far from the existing centroids but have potential optimization value to replace them, thus isolating smaller groups and forming independent clusters. For example, by evaluating the optimal valid swap pairs, even if a candidate non-centroid is not the closest, if replacing a centroid can improve the overall clustering effect, the replacement operation will still be performed.

[0054] In summary, this method not only improves the computational efficiency of social data clustering, but also enhances the algorithm's ability to escape local optima, enabling the interests of niche groups to be effectively identified and satisfied. This provides social platforms with more refined and personalized content push services, thereby improving user experience and interaction rates.

[0055] In some embodiments, when there is at least one set of valid swap pairs at the i-th candidate non-center point, selecting one set of valid swap pairs as the optimal valid swap pair includes: If two valid exchange pairs exist at the i-th candidate non-center point, uniform random sampling is performed from multiple data points to be clustered. A subset of data points to be clustered is formed. and To preset hyperparameters, ; Replace the first cluster center in the (i-1)th cluster center set with the i-th candidate non-center point as the cluster center point to obtain the first temporary center point set; Replace the second cluster center in the (i-1)th cluster center set with the i-th candidate non-center point as the cluster center point to obtain the second temporary center point set; Calculate the first full clustering cost between the evaluation subset and the first temporary centroid set; Calculate the second full clustering cost between the evaluation subset and the second temporary centroid set; Select the pair of effective swaps with the lower cost between the first full clustering cost and the second full clustering cost as the optimal effective swap pair; If there exists a set of valid swap pairs at the i-th candidate non-center point, the valid swap pair is taken as the optimal valid swap pair.

[0056] Uniform random sampling of data points to be clustered to form an evaluation subset refers to extracting a representative but small subset of data points from all data points to be clustered, used to evaluate the merits of different centroid replacement schemes. This sampling method can significantly reduce computational complexity while ensuring evaluation accuracy. For example, a random number sequence can be generated, and a specified number of data points can be extracted from the set of data points to be clustered based on this sequence; alternatively, a systematic sampling method can be used, where the data points to be clustered are numbered, and then extracted at certain intervals, introducing random starting points during the extraction process to ensure the uniformity and randomness of the sampling. The preset hyperparameters are used to control the size of the evaluation subset, and their settings can be adjusted according to the actual application scenario, data scale, and the trade-off between evaluation accuracy and computational efficiency.

[0057] The first and second temporary centroid sets are used to simulate intermediate states under different replacement schemes. By replacing different cluster centroids in the (i-1)th centroid set with the i-th candidate non-centroid (e.g., the first and second cluster centroids), two hypothetical centroid set configurations can be obtained for subsequent comparison and evaluation. This can be achieved by copying the (i-1)th centroid set and then modifying specific elements in the copied set; or, it can be achieved by logically constructing temporary centroid sets without actually copying the entire set using pointer or reference operations.

[0058] Calculating the first full clustering cost between the evaluation subset and the first temporary centroid set, and the second full clustering cost between the evaluation subset and the second temporary centroid set, quantifies the impact of different replacement schemes on clustering quality. Clustering cost typically represents the sum of distances from a data point to its corresponding cluster center; a lower cost indicates better clustering performance. Euclidean distance or Manhattan distance can be used as the distance metric. The minimum distance from each data point in the evaluation subset to all cluster centers in the first (or second) temporary centroid set is calculated, and these minimum distances are then summed.

[0059] Selecting the pair of valid swaps with the lower cost between the first and second full clustering costs as the optimal valid swap pair is based on the calculated clustering costs. A lower cost means better clustering performance on the current evaluation subset, thus the corresponding swap pair is considered superior. This can be achieved by directly comparing the two calculated clustering cost values. When a valid swap pair exists for the i-th candidate non-center point, the valid swap pair is selected as the optimal valid swap pair. This means that when there is only one valid swap pair, no comparison is needed; the unique valid swap pair is directly identified as the optimal one.

[0060] This embodiment addresses the problem of efficiently and accurately selecting the optimal swap pair when multiple valid swap pairs exist by introducing a cost comparison mechanism based on evaluation subsets. This mechanism first extracts a small evaluation subset from all data points to be clustered through uniform random sampling. This subset significantly reduces the computational cost of subsequent cost calculations while maintaining data representativeness. Then, for each valid swap pair, the scenario of replacing the corresponding cluster center point in the (i-1)th center point set with the i-th candidate non-center point is simulated, thereby constructing different temporary center point sets. Next, the clustering cost between the evaluation subset and these temporary center point sets is calculated, and the valid swap pair with the lower cost is selected as the optimal valid swap pair. This strategy based on local evaluation ensures the accuracy of selecting the optimal swap pair while effectively avoiding the huge overhead of cost calculation for the entire dataset, thus improving the efficiency of the iteration process. When only one set of valid swap pairs exists, there is no need for comparison, and it is directly identified as the optimal one, simplifying the processing flow. This mechanism, combined with the step of selecting valid swap pairs based on the locality-sensitive hash mapping function, enables the cluster center set to be gradually optimized in a more efficient and accurate manner during multiple iterations, ultimately obtaining high-quality clustering results.

[0061] In some embodiments, evaluating the replacement of the cluster center in the optimal effective exchange pair with the i-th candidate non-center point includes: Calculate the cost of the third full clustering of the (i-1)th centroid set; Replace the corresponding cluster center in the (i-1)th center set with the i-th candidate non-center point as the cluster center point to obtain the third temporary center point set; Calculate the cost of the fourth full clustering of the third temporary centroid set; When the cost of the third full clustering is greater than that of the fourth full clustering, the evaluation result is that replacement is better.

[0062] Specifically, calculating the third full clustering cost of the i-1th centroid set refers to the overall quantitative evaluation of the clustering results formed by the current cluster centroid set (i.e., the i-1th centroid set) before performing any replacement operation. This cost measures the sum of the distances of all data points to be clustered to their respective cluster centroids.

[0063] Replacing the corresponding cluster center in the (i-1)th cluster center set with the i-th candidate non-center as the cluster center yields a third temporary center set. This temporary center set is a hypothetical set used to simulate the state after the replacement operation. The corresponding cluster center is the one that is swapped with the i-th candidate non-center in the optimal effective swap pair.

[0064] Calculating the fourth full clustering cost of the third temporary centroid set refers to the overall quantitative evaluation of the clustering results formed by the new cluster centroid set (i.e., the third temporary centroid set) under the assumption that the replacement operation has been completed.

[0065] When the cost of the third full clustering operation is greater than that of the fourth full clustering operation, the evaluation result is "the replacement is better." This means that the replacement operation improves the clustering quality by comparing the overall clustering costs before and after the replacement. Since clustering cost usually represents clustering error or non-compactness, a lower cost indicates a better clustering effect. When the cost after replacement (the cost of the fourth full clustering operation) is less than the cost before replacement (the cost of the third full clustering operation), it indicates that the replacement operation improves the overall clustering quality, and therefore the replacement is considered better.

[0066] This embodiment performs a comprehensive global evaluation of potential cluster center replacement operations in each iteration. First, the first full clustering cost for all data points to be clustered under the current cluster center set is calculated as a baseline. Then, a hypothetical new cluster center set is constructed, where the i-th candidate non-center replaces a cluster center in the optimal effective exchange pair, and the second full clustering cost for all data points to be clustered under this new center set is calculated. By directly comparing these two full clustering costs—that is, determining whether the first full clustering cost is greater than the second full clustering cost—it can be objectively determined whether the replacement operation can reduce the overall clustering error, thereby improving clustering quality. This evaluation mechanism based on global cost ensures that each center update is directed towards optimizing the overall clustering structure, avoiding suboptimal solutions that may result from relying solely on local information.

[0067] In some embodiments, selecting multiple cluster centers from multiple data points to be clustered includes: Randomly select a data point to be clustered as the cluster center and set it in the initial set; Iterate through k-1 rounds, where each iteration in k-1 rounds includes: One data point is randomly selected from multiple data points to be clustered as the first candidate cluster center; where k is the preset number of clusters. Perform m Monte Carlo Markov chain iteration replacement operations on the first candidate cluster center point, where any number of Monte Carlo Markov chain iterations includes: Randomly select one data point from multiple data points to be clustered as the second candidate cluster center point; Calculate the first shortest distance from the first candidate cluster center to the initial set, and the second shortest distance from the second candidate cluster center to the initial set, respectively; Generate obedience The first random number from a uniform distribution; If the ratio between the second shortest distance and the first shortest distance is greater than the first random number, the second candidate cluster center point will be used as the first candidate cluster center point. After completing m iterations of replacement, the first candidate cluster center point obtained after the mth iteration is set as the cluster center point in the initial set, and the next round of iteration continues; After the (k-1)th iteration, k cluster centers are obtained.

[0068] This embodiment introduces a Monte Carlo Markov chain initial cluster center selection mechanism. First, a data point to be clustered is randomly selected as the first cluster center and placed in the first set. Then, to select the remaining k-1 cluster centers, the system performs k-1 iterations. In each iteration, a first candidate cluster center is randomly selected from the data points to be clustered as the starting point of the current round. Next, m Monte Carlo Markov chain iteration replacement operations are performed on this first candidate cluster center. In each iteration replacement, a second candidate cluster center is randomly selected, and the shortest distance (first shortest distance) between the current candidate cluster center and all selected cluster centers in the current initial set is calculated, as well as the second shortest distance between the current second candidate cluster center and the initial set. By comparing the ratio of the two shortest distances with a random number, a probabilistic decision is made on whether to replace the second candidate cluster center with the new first candidate cluster center. This acceptance criterion based on distance ratio and random number allows the algorithm to favor data points farther from existing centers (to increase center diversity) while also accepting suboptimal solutions with a certain probability, effectively avoiding local optima that may result from greedy selection. After m iterations, the final first candidate cluster center is determined as the cluster center for this round and added to the initial set. This process is repeated k-1 times until the initial set contains k cluster centers. In this way, more evenly distributed and representative initial cluster centers can be generated, providing a high-quality starting point for subsequent clustering iterations, thereby improving the overall efficiency and effectiveness of the clustering algorithm.

[0069] In some embodiments, the hash value of each data point to be clustered is generated based on a locality-sensitive hash mapping function, including: Generate multidimensional random vectors ; where, random vector Each element obeys Stable distribution; From the interval In the middle, select the random offset. ;in, The bucket width for locality-sensitive hashing; According to the random vector and random offset Construct a locality-sensitive hash mapping function: ;in, To Perform the floor function. These are the data points to be clustered and input; Iterate through multiple data points to be clustered, and generate a corresponding hash value for each data point according to the locality-sensitive hash mapping function.

[0070] Among them, random vector It is a vector with multiple dimensions, which usually match the dimensions of the data points to be clustered. Its function is to define a random projection direction in Locality Sensitive Hashing (LSH). By projecting data points onto this random vector, the similarity in its high-dimensional space can be transformed into similarity in its low-dimensional space, thereby achieving dimensionality reduction and approximate similarity search.

[0071] random vector Each element obeys A stable distribution is a special type of probability distribution characterized by the fact that multiple independent and identically distributed (i.e., stable, uniform) distributions are stable. Linear combinations of stable random variables still obey When the distribution is stable, its parameters will change accordingly. Common examples include... Stable distributions include the Cauchy distribution ( =1) and Gaussian distribution ( =2). Select Stable distribution is designed to ensure that the distance relationship between data points remains unchanged with a certain probability during the projection process. That is, points that are close in the original space remain close after projection, while points that are far apart in the original space remain far apart after projection.

[0072] random vector A pseudo-random number generator can be used to generate numbers that conform to a specific... Random numbers are constructed from stable distributions. For example, for a Gaussian distribution, the Box-Muller transform or Ziggurat algorithm can be used; for a Cauchy distribution, the ratio of two standard normally distributed random variables can be used. Random offset. This is a randomly selected value within a specific range, used to introduce a random shift into the locality-sensitive hash function. Its purpose is to further increase the randomness of the hash function, making the data points appear as random vectors projected onto it. After that, they can be more evenly distributed into different hash buckets, thereby reducing the probability of hash collisions and improving the distinguishability of the hash function.

[0073] Bucket width of locality-sensitive hashing This is a key parameter in the Locality Sensitive Hash (LSH) algorithm, defining the width of the hash buckets. In LSH, data points are projected and offset, and then assigned to different buckets based on their values. Bucket width This determines how many values ​​within a range will be mapped to the same bucket. Random offset. A uniform random number generator can be used to generate random numbers in the closed interval [0, ... Generate a floating-point number within ] .

[0074] Locality-sensitive hash mapping function It is the core of LSH, which uses high-dimensional data points Mapping to an integer hash value. This function generates a hash value by performing an inner product operation on the data point and a random vector, adding a random offset, dividing by the bucket width, and finally rounding down. This function is designed so that data points that are closer together in the original space have a higher probability of being mapped to the same hash value, while data points that are farther apart have a higher probability of being mapped to different hash values. In programming implementation, calculations can be performed directly according to the formula. For example, for the vector inner product, you can use a loop to iterate through the vector elements and sum the products, or use the inner product function provided by the linear algebra library; the rounding down operation can use the floor() function provided by the programming language. Traversing multiple data points to be clustered refers to processing each data point that needs to be clustered one by one to ensure that each data point obtains its corresponding hash value.

[0075] Generating the corresponding hash value means applying the Locality Sensitive Hash Mapping Function (LSH) constructed above to each data point to be clustered, and calculating a unique hash value. These hash values ​​can be stored in a hash table, where the key is the data point identifier and the value is its corresponding hash value, or stored in a list that corresponds one-to-one with the data points. This traversal process can use a loop structure to traverse the set of data points to be clustered. In each loop, the current data point is used as input into the LSH function to calculate the hash value, and the hash value is associated with and stored with the corresponding data point.

[0076] This embodiment introduces Locality Sensitive Hash (LSH) technology to efficiently generate hash values ​​for each data point to be clustered, thereby enabling rapid determination of the approximate similarity between data points during subsequent social data clustering and push processes based on LSH. Specifically, firstly, a multi-dimensional random vector is generated. Each of its elements obeys A stable distribution lays the foundation for the projection of data points into high-dimensional space; then, starting from the preset bucket width... Select random offset within the interval This further enhances the randomness and discriminative power of the hash function; based on these parameters, a locality-sensitive hash mapping function is constructed, the core of which lies in mapping high-dimensional data points... By using random vectors Dimensionality reduction projection is performed on the inner product, combined with random offsets. and bucket width Discretization is performed so that similar data points in the original space have a higher probability of being mapped to the same hash value. Finally, all data points to be clustered are traversed, and this locality-sensitive hash mapping function is applied one by one to generate a corresponding hash value for each data point. In subsequent iterations, especially when it is necessary to determine whether the hash values ​​of two points in a candidate swap pair are different, these hash values ​​can provide approximate similarity information with low computational cost, significantly improving the efficiency of the social data clustering and push method based on locality-sensitive hashing.

[0077] In some embodiments, selecting the i-th candidate non-center point from a plurality of data points to be clustered includes: From multiple data points to be clustered, randomly select one data point that does not belong to the (i-1)th centroid set as the target data point to be clustered; Perform m Monte Carlo Markov chain iteration replacement operations on the target data points to be clustered, where any number of Monte Carlo Markov chain iterations includes: Randomly select a data point that does not belong to the (i-1)th centroid set from multiple data points to be clustered, and use it as the first data point to be clustered; Calculate the third shortest distance from the target data point to be clustered to the (i-1)th centroid set, and the fourth shortest distance from the first data point to be clustered to the (i-1)th centroid set, respectively. Generate obedience A uniformly distributed second random number; If the ratio between the fourth shortest distance and the third shortest distance is greater than the second random number, the first data point to be clustered will be taken as the target data point to be clustered. After completing m iterations of replacement, the target data point to be clustered obtained after the mth iteration is taken as the i-th candidate non-center point.

[0078] This embodiment optimizes the selection process of the i-th candidate non-center point by introducing a Monte Carlo Markov chain iterative replacement operation. Specifically, the scheme first randomly selects a data point that does not belong to the (i-1)-th center point set as the initial target data point to be clustered. Subsequently, through m iterations, in each iteration, a new first data point to be clustered is randomly proposed, and its shortest distance from the current target data point to the (i-1)-th center point set is calculated. By comparing the ratio of these two distances with a random number, the new first data point to be clustered is accepted as the new target data point with a certain probability. This acceptance criterion based on the distance ratio makes the Markov chain tend to move towards data points that are farther away from the current cluster center set, because these points are more likely to represent new, under-covered clustering regions, and thus have more potential to become preferred candidates to replace the existing cluster centers. At the same time, the introduction of a random number ensures the exploratory nature of the Markov chain, enabling it to escape local optima and avoid premature convergence. In this way, after m iterations of replacement, the final target data point to be clustered is the i-th candidate non-center point after optimization. This optimization process ensures that the selected point has higher optimization potential when subsequently replacing and evaluating this candidate non-center point, thereby significantly improving the iterative efficiency and final clustering quality of the entire social data clustering and push method based on locality-sensitive hashing.

[0079] To facilitate understanding in the art, a method embodiment is provided, the method comprising the following steps: 1) Based on multiple social data sequences corresponding to multiple social accounts, the sequence feature vector corresponding to each of the social data sequences is used as the data points to be clustered, thus obtaining the dataset to be clustered: ,common indivual Data points to be clustered in dimensionality; 2) Set of central points: ,common There are cluster centers, and ; 3) Distance: Between two points Norm distance; It represents the shortest distance from a single point to the set of center points; 4) Cost of full clustering: The sum of distances from all data points to be clustered to their nearest cluster center is the optimization objective of the algorithm.

[0080] 5) : The iterative chain length (positive integer) of a Monte Carlo Markov chain; 6) : Bucket width of locality-sensitive hashing (positive real number); 7) , : Subset sampling coefficients, satisfying , , ; 8) Convergence threshold / maximum number of iterations: Algorithm termination determination parameter.

[0081] Step S210: Acquisition and preprocessing of data points to be clustered; Obtain the total number of data points to be clustered Feature Dimension Set the number of clusters ,in ; Perform cleaning: remove samples with missing features, or fill in missing values ​​using the feature mean. The criteria eliminate extreme outliers to ensure that all sample dimensions are complete and valid. All features are Z-score standardized or Min-Max normalized to eliminate the interference of dimensional differences on distance calculation; Obtain the preprocessed dataset to be clustered (include (Number of data points to be clustered).

[0082] Step S220, initialization operation (executed only once when the algorithm starts); Step S2210: Construct an initial set based on a Monte Carlo Markov chain; Initialize collection From the dataset to be clustered One data point to be clustered is randomly selected uniformly from the data and added to the initial set as the first cluster center. ; Execute in a loop Next, replenish the remaining items one by one. The process for a single loop with cluster centers is as follows: 1) From One data point is randomly selected uniformly from the data to be clustered, and it is used as the first candidate cluster center of the Markov chain. ; 2) Repeat execution Sub-Markov chain iteration replacement operation: 2.1) From the dataset One data point to be clustered is randomly selected uniformly from the data points and used as the second candidate cluster center. ; 2.2) Calculate the first candidate cluster center points respectively. arrive First shortest distance Second candidate cluster center arrive Second shortest distance ; 2.3) Generate a first random number that follows a uniform distribution in the range [0,1]. ; 2.4) If the judgment condition is met Then update Use the second candidate cluster center As the first candidate cluster center ,Right now Otherwise, retain the first candidate cluster center. constant; 3) Complete After the iteration, the final first candidate cluster center will be determined. As a new cluster center, join ; After the loop ends, we get the following: The initial set of cluster centers .

[0083] For ease of understanding, the initial set will be... This is subsequently referred to as the initial center point set.

[0084] This embodiment can ensure the diversity of interests in the clusters from the starting point of the iteration, reduce the number of iterations that jump out of the local optimum in subsequent iterations, and adapt to scenarios where the distribution of interests of social accounts is extremely uneven.

[0085] Step S2220: Data region partitioning based on locality-sensitive hashing; Step S2221, generate 3D random vector Each element of the vector independently follows Stable distributions: Euclidean distance scenes correspond to Gaussian distributions, while Manhattan distance scenes correspond to Cauchy distributions; Step S2222: Generate random offset From the interval Obtained by uniform sampling in the middle; Step S2223, construct the locality-sensitive hash function: ;in, For vector dot product operation, Refers to the vector of data points to be clustered. For floor operations, the output is: The corresponding hash value; Step S2224, traverse the dataset For all data points to be clustered, calculate the hash value corresponding to each data point to be clustered, and generate a global mapping table; Step S2225: Group the data points to be clustered with the same hash value into the same LSH similar region to complete the region pre-division of the full data.

[0086] Step S230: Monte Carlo sampling of candidate non-center points; This step is the starting step of a single iteration (i.e., steps S230 to S260 are cyclic steps), and only one candidate non-center point is sampled in each round. Assume it is the i-th round (to obtain...). The steps include: 1) From the dataset One data point to be clustered is randomly selected uniformly from the data points. ;like Belongs to the Central point set If the result is not a center point, then resampling continues until a non-center point is obtained. It's important to note that when i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration; when i is 1, the (i-1)th center point set is the initial center point set. ; 2) Repeat execution The rules for the next-order Markov chain iteration replacement operation include: 2.1) Uniformly and randomly sample the first data points to be clustered. ; 2.2) Calculate the third shortest distance respectively and the fourth shortest distance ; 2.3) Generate a uniform second random number in the range [0,1]. ,like Then update (i.e., replace), otherwise Remain unchanged; 3) Verification after iteration: If the final If a point is not a cluster center, it will be considered as a candidate non-center point for this round. If the distance is from the center point, then repeat the entire process of step S230.

[0087] Step S240: Construct two sets of candidate swap pairs; For the obtained candidate non-center points To match two distinct cluster centroids, two independent candidate swap pairs are generated. The swap logic is as follows: replace the corresponding centroid with a non-centroid. The first group of candidate swap pairs (nearest neighbor candidate swap pairs): Traverse all cluster centroids and calculate non-centroids. Find the distance to each cluster center. The most recent first cluster center ,composition ; Second group of candidate swap pairs (random candidate swap pairs): from the current... One second cluster center is randomly selected from the uniformly selected cluster centers. ,composition( ).

[0088] Step S250: Pre-screen candidate swap pairs in the LSH region; Based on the global hash mapping table generated in step S220, the two sets of candidate swap pairs are coarsely screened one by one: For a single candidate swap pair, retrieve the hash values ​​of both points from the hash map table; for example... Including queries hash value and The hash value; Filtering and judgment: If two points have the same hash value (belonging to the same LSH similar region), they are judged as invalid swap pairs and discarded directly; if two points have different hash values, they are judged as valid swap pairs and retained. After all candidate pairs in both groups have been screened, the number of valid swap pairs that are ultimately retained is counted, and the result is 0, 1, or 2.

[0089] Step S260, Cost Assessment and Center Point Update; Based on the number of valid swap pairs after screening, corresponding operations are performed in three scenarios, with a maximum of one cluster center update per iteration.

[0090] Scenario 1: Both candidate swap pairs are discarded; No cost calculations are performed, and the centroid set is not updated. This directly terminates the current iteration, yielding the set of the i-th center points. .

[0091] Scenario 2: Only one valid swap pair is retained (i.e., the optimal valid swap pair); Let the number of valid swap pairs be . : calculate The corresponding first full clustering cost ; Generate the third temporary centroid set Replace cluster centers Add candidate non-center points ,Right now ; Calculate the third temporary centroid set The corresponding second full clustering cost ; Update judgment: If Then update the center point set. Otherwise, no update. .

[0092] Scenario 3: Retain 2 valid swap pairs; A two-stage evaluation mechanism is adopted, consisting of subset coarse selection and full validation: From the full dataset Uniform random sampling The data points to be clustered form an evaluation subset. Satisfying |U| <n; 1) Generate the first temporary centroid set of the first group of candidate swap pairs. Calculate the first full clustering cost of its subset U. ; 2) Generate the second temporary centroid set corresponding to the second set of candidate pairs. Calculate its second full clustering cost on subset U. ; 3) Compare the cost values ​​of the two subsets and select the one with the lower cost as the optimal candidate swap pair. ; Full cost verification: 1) Calculate the current center point set The cost of the third full clustering ; 2) Generate the optimal candidate swap pair The corresponding fourth temporary centroid set (which could be the first temporary centroid set or the second temporary centroid set) ; 3) Calculate the fourth full clustering cost of the fourth temporary centroid set. ; Update judgment: If Then update the center point set. Otherwise, no update. .

[0093] After completing step S260, return to step S230 to start the next round of iteration. Each round of iteration is executed based on the latest set of center points updated in the previous round. Step S270: The algorithm terminates the iteration. (1) After a preset number of iterations, if the decrease in the cost of full clustering is less than the preset convergence threshold, the algorithm is considered to have converged. (2) If the number of iterations reaches the preset maximum iteration limit M, the process will be forcibly terminated; Output the final result: For example, the final set of cluster centers after the maximum iteration M. ; Step S270 will process the dataset Each data point to be clustered is assigned to the nearest cluster center, forming a corresponding cluster. This results in clustering results for multiple social media accounts, which can then be used to push content to these accounts.

[0094] This embodiment has at least the following beneficial effects: (1) Significantly reduce the computational overhead of high-dimensional data and improve iteration efficiency: Feature standardization eliminates the dimensional differences of multi-dimensional behavioral data and ensures the stability of subsequent distance calculation and hash mapping; Through local sensitive hash pre-partitioning and candidate swap pair pre-screening, near-distance no-gain swap pairs are filtered with extremely low hash comparison cost, greatly reducing the number of high-dimensional distance calculations; The adoption of a subset coarse selection and full verification two-level evaluation mechanism further compresses the multi-swap comparison selection overhead, supporting real-time grouping updates of large-scale accounts in the scenario of hundreds of millions of social data.

[0095] (2) Enhance global optimization capability and improve clustering quality: Monte Carlo Markov chain sampling is adopted to optimize the selection of initial center point and candidate non-center point sampling respectively, replacing the traditional pure random and nearest-neighbor local search strategy. This reduces the risk of local optima from the starting point of iteration and drives the center point to continuously approach the global optimal solution. The double exchange pair design takes into account the optimization of existing cluster accuracy and the exploration of new cluster structure. Combined with the full cost verification mechanism, it ensures that each round of replacement points to the overall clustering quality improvement, effectively solving the problem that traditional k-means is prone to getting trapped in local optima and that niche groups are submerged by mainstream large clusters.

[0096] like Figure 2 One embodiment of this application provides a social data clustering and push device based on locality-sensitive hashing, the device comprising: The data point acquisition module 1001 is used to determine multiple social data sequences corresponding to multiple social accounts, and to use the sequence feature vector corresponding to each social data sequence as a data point to be clustered, thereby obtaining multiple data points to be clustered; the social data sequence includes at least one of the following: browsing content, browsing duration, number of likes and collections; The initial centroid selection module 1002 is used to select multiple cluster centroids from multiple data points to be clustered, and to construct an initial centroid set based on the multiple cluster centroids; The hash value generation module 1003 is used to generate the hash value of each data point to be clustered based on the locality-sensitive hash mapping function; The center point selection module 1004 is used to perform multiple rounds of iteration, wherein the i-th round of iteration includes: Select the i-th candidate non-center point from multiple data points to be clustered; Obtain the (i-1)th center point set; where, if i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration, and if i is 1, the (i-1)th center point set is the initial center point set; For the i-th candidate non-center point, select multiple sets of candidate swap pairs, and traverse each set of candidate swap pairs. If the hash values ​​between the two points in a set of candidate swap pairs are different, then the set of candidate swap pairs is taken as the valid swap pair for the i-th candidate non-center point. Among them, any candidate swap pair includes the i-th candidate non-center point and a cluster center point. If there is at least one set of valid swap pairs at the i-th candidate non-center point, select one of the valid swap pairs as the optimal valid swap pair; The i-th candidate non-center point in the optimal effective exchange pair is evaluated as a replacement for the cluster center point in the optimal effective exchange pair. If the evaluation result is that the replacement is better, the i-th candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)-th center point set, thus obtaining the i-th center point set. The data clustering module 1005 is used to obtain the set of centroids after the last iteration after the iteration termination condition is triggered, and to complete the clustering of multiple data points to be clustered based on the set of centroids after the last iteration, so as to obtain the clustering result. The content push module 1006 is used to push content to multiple social media accounts based on clustering results.

[0097] It should be noted that the social data clustering and push device based on locality-sensitive hashing in this application embodiment is based on the same inventive concept as the aforementioned social data clustering and push method based on locality-sensitive hashing. Therefore, the social data clustering and push device based on locality-sensitive hashing in this application embodiment corresponds to the aforementioned social data clustering and push method based on locality-sensitive hashing. For the specific implementation process, please refer to the aforementioned generative intelligent question answering method, which will not be repeated here.

[0098] like Figure 3 As shown, one embodiment of this application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned social data clustering and push method based on locality-sensitive hashing. The electronic device includes: At least one battery; At least one memory; At least one processor; At least one program; The program is stored in memory, and the processor executes at least one program to implement the above-described method for social data clustering and push based on locality-sensitive hashing.

[0099] Electronic devices can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.

[0100] The electronic devices according to embodiments of this application will now be described in detail.

[0101] The processor 1600 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure. The memory 1700 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1700 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1700 and is called and executed by the processor 1600 to perform a social data clustering and push method based on locality-sensitive hashing according to an embodiment of this disclosure.

[0102] The input / output interface 1800 is used to implement information input and output. The communication interface 1900 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 2000 transmits information between various components of the device (e.g., processor 1600, memory 1700, input / output interface 1800, and communication interface 1900); The processor 1600, memory 1700, input / output interface 1800 and communication interface 1900 are connected to each other within the device via bus 2000.

[0103] This disclosure also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the aforementioned social data clustering and push method based on locality-sensitive hashing.

[0104] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0105] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.

[0106] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0108] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0109] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0110] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0113] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0114] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0115] The above is a detailed description of the preferred embodiments of this application. However, the embodiments of this application are not limited to the above-described implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the embodiments of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of the embodiments of this application.

Claims

1. A social data clustering and push method based on locality-sensitive hashing, characterized in that, The method includes: Multiple social data sequences corresponding to multiple social accounts are determined, and the sequence feature vector corresponding to each social data sequence is used as a data point to be clustered, resulting in multiple data points to be clustered; the social data sequence includes at least one of browsing content, browsing duration, number of likes and collections; Multiple cluster centers are selected from the multiple data points to be clustered, and an initial set of centers is constructed based on the multiple cluster centers; Based on the locality-sensitive hash mapping function, the hash value of each data point to be clustered is generated; Perform multiple rounds of iteration, where the i-th round of iteration includes: From the plurality of data points to be clustered, select the i-th candidate non-center point; Obtain the (i-1)th center point set; wherein, when i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration, and when i is 1, the (i-1)th center point set is the initial center point set; Multiple candidate swap pairs are selected for the i-th candidate non-center point, and each candidate swap pair is traversed. If the hash values ​​between the two points in a candidate swap pair are different, the candidate swap pair is taken as a valid swap pair for the i-th candidate non-center point; wherein, any candidate swap pair includes the i-th candidate non-center point and a cluster center point. If at least one set of the effective swap pairs exists at the i-th candidate non-center point, one set of the effective swap pairs is selected as the optimal effective swap pair; The candidate non-center point in the optimal effective exchange pair is evaluated as a replacement for the cluster center point in the optimal effective exchange pair. If the evaluation result is that the replacement is better, the candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)th center point set to obtain the i-th center point set. After the iteration termination condition is triggered, the set of centroids after the last iteration is obtained, and the clustering of the multiple data points to be clustered is completed based on the set of centroids after the last iteration to obtain the clustering result; Content is pushed to multiple social media accounts based on the clustering results.

2. The social data clustering and push method based on locality-sensitive hashing according to claim 1, characterized in that, The multiple candidate exchange pairs include two candidate exchange pairs; wherein the first candidate exchange pair includes the i-th candidate non-centroid and the first cluster centroid, and the second candidate exchange pair includes the i-th candidate non-centroid and the second cluster centroid, wherein the first cluster centroid is the cluster centroid closest to the i-th candidate non-centroid, and the second cluster centroid is a cluster centroid randomly selected from the (i-1)-th centroid set.

3. The social data clustering and push method based on locality-sensitive hashing according to claim 2, characterized in that, When at least one set of the effective swap pairs exists at the i-th candidate non-center point, selecting one set of the effective swap pairs as the optimal effective swap pair includes: If two sets of valid exchange pairs exist at the i-th candidate non-center point, uniformly random sampling is performed from the plurality of data points to be clustered. A subset of data points to be clustered is formed, comprising 10 data points; among them... and To preset hyperparameters, ; The first cluster center point in the (i-1)th center point set is replaced by the i-th candidate non-center point as the cluster center point to obtain the first temporary center point set; The second cluster center in the (i-1)th cluster center set is replaced by the i-th candidate non-center point, thus obtaining the second temporary center point set; Calculate the first full clustering cost between the evaluation subset and the first temporary centroid set; Calculate the second full clustering cost between the evaluation subset and the second temporary centroid set; The effective swap pair with the smaller cost between the first full clustering cost and the second full clustering cost is selected as the optimal effective swap pair; If a set of effective swap pairs exists at the i-th candidate non-center point, the effective swap pair is taken as the optimal effective swap pair.

4. The social data clustering and push method based on locality-sensitive hashing according to claim 1, characterized in that, The evaluation of replacing the cluster center in the optimal effective exchange pair with the i-th candidate non-center point includes: Calculate the third full clustering cost of the (i-1)th centroid set; Replace the corresponding cluster center in the (i-1)th center point set with the i-th candidate non-center point as the cluster center point to obtain the third temporary center point set; Calculate the fourth full clustering cost of the third temporary centroid set; If the cost of the third full clustering is greater than the cost of the fourth full clustering, the evaluation result is that replacement is better.

5. The social data clustering and push method based on locality-sensitive hashing according to claim 1, characterized in that, The step of selecting multiple cluster centers from the multiple data points to be clustered includes: Randomly select a data point to be clustered as the cluster center and set it in the initial set; Iterate through k-1 rounds, where each iteration in k-1 rounds includes: One data point is randomly selected from the plurality of data points to be clustered as the first candidate cluster center; where k is the preset number of clusters; Perform m Monte Carlo Markov chain iteration replacement operations on the first candidate cluster center point, where any number of Monte Carlo Markov chain iterations includes: Randomly select one data point from the plurality of data points to be clustered as the second candidate cluster center point; Calculate the first shortest distance from the first candidate cluster center to the initial set, and the second shortest distance from the second candidate cluster center to the initial set, respectively; Generate obedience The first random number from a uniform distribution; If the ratio between the second shortest distance and the first shortest distance is greater than the first random number, the second candidate cluster center point is used as the first candidate cluster center point; After completing m iterations of replacement, the first candidate cluster center point obtained after the mth iteration is set as the cluster center point in the initial set, and the next round of iteration continues; After the (k-1)th iteration, k cluster centers are obtained.

6. The social data clustering and push method based on locality-sensitive hashing according to claim 1, characterized in that, The step of generating the hash value for each data point to be clustered based on the locality-sensitive hash mapping function includes: Generate multidimensional random vectors ; wherein, the random vector Each element obeys Stable distribution; From the interval In the middle, select the random offset. ;in, The bucket width for locality-sensitive hashing; According to the random vector and the random offset Construct a locality-sensitive hash mapping function: ;in, To Perform the floor function. These are the data points to be clustered and input. The multiple data points to be clustered are traversed, and a corresponding hash value is generated for each data point according to the locality-sensitive hash mapping function.

7. A social data clustering and push method based on locality-sensitive hashing according to claim 1, characterized in that, The step of selecting the i-th candidate non-center point from the plurality of data points to be clustered includes: From the plurality of data points to be clustered, randomly select one data point that does not belong to the (i-1)th centroid set as the target data point to be clustered; Perform m Monte Carlo Markov chain iteration replacement operations on the target data points to be clustered, where any number of Monte Carlo Markov chain iterations includes: Randomly select a data point that does not belong to the (i-1)th centroid set from the plurality of data points to be clustered, and use it as the first data point to be clustered; Calculate the third shortest distance from the target data point to be clustered to the (i-1)th centroid set, and the fourth shortest distance from the first data point to be clustered to the (i-1)th centroid set, respectively. Generate compliance A uniformly distributed second random number; If the ratio between the fourth shortest distance and the third shortest distance is greater than the second random number, the first data point to be clustered will be taken as the target data point to be clustered. After completing m iterations of replacement, the target data point to be clustered obtained after the mth iteration is taken as the i-th candidate non-center point.

8. A social data clustering and push device based on locality-sensitive hashing, characterized in that, The device includes: The data point acquisition module is used to determine multiple social data sequences corresponding to multiple social accounts, and to use the sequence feature vector corresponding to each social data sequence as a data point to be clustered, thereby obtaining multiple data points to be clustered; the social data sequence includes at least one of browsing content, browsing duration, number of likes and collections; The initial centroid selection module is used to select multiple cluster centroids from the multiple data points to be clustered, and to construct an initial centroid set based on the multiple cluster centroids; The hash value generation module is used to generate the hash value of each data point to be clustered based on the locality-sensitive hash mapping function. The center point selection module is used to perform multiple rounds of iteration, where the i-th round of iteration includes: From the plurality of data points to be clustered, select the i-th candidate non-center point; Obtain the (i-1)th center point set; wherein, when i is greater than 1, the (i-1)th center point set is the center point set after the (i-1)th iteration, and when i is 1, the (i-1)th center point set is the initial center point set; Multiple candidate swap pairs are selected for the i-th candidate non-center point, and each candidate swap pair is traversed. If the hash values ​​between the two points in a candidate swap pair are different, the candidate swap pair is taken as a valid swap pair for the i-th candidate non-center point; wherein, any candidate swap pair includes the i-th candidate non-center point and a cluster center point. If at least one set of the effective swap pairs exists at the i-th candidate non-center point, one set of the effective swap pairs is selected as the optimal effective swap pair; The candidate non-center point in the optimal effective exchange pair is evaluated as a replacement for the cluster center point in the optimal effective exchange pair. If the evaluation result is that the replacement is better, the candidate non-center point is used as the cluster center point to replace the corresponding cluster center point in the (i-1)th center point set to obtain the i-th center point set. The data clustering module is used to obtain the set of centroids after the last iteration after the iteration termination condition is triggered, and to complete the clustering of the multiple data points to be clustered based on the set of centroids after the last iteration, so as to obtain the clustering result. The content push module is used to push content to multiple social accounts based on the clustering results.

9. An electronic device, characterized in that, include: At least one control processor and a memory for communicatively connecting to the at least one control processor; The memory stores instructions that can be executed by the at least one control processor, which, when executed by the at least one control processor, enables the at least one control processor to perform a social data clustering and push method based on locality-sensitive hashing as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform a social data clustering and push method based on locality-sensitive hashing as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • LSH (Locality Sensitive Hashing)-based clustering and indexing method and LSH-based clustering and indexing system

    CN103631928A

  • Smart financial product recommendation method and device, equipment and storage medium

    CN120931366A