User behavior analysis method and device, equipment, storage medium
By improving the CFSFDP algorithm and using parallel processing on the Hadoop platform, the problems of declining clustering quality and low efficiency in user behavior analysis are solved, achieving efficient and accurate user behavior clustering and interest tag segmentation, supporting precise marketing decisions.
Patent Information
- Application Number
- CN202110373216.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-07
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2041-04-07
AI Technical Summary
Existing user behavior analysis methods often use a single density threshold, which leads to a decline in clustering quality. In particular, clustering is inaccurate when there are multiple density peaks. Furthermore, traditional single-machine clustering algorithms are inefficient and cannot handle massive amounts of user data.
An improved CFSFDP algorithm is used to partition and cluster user behavior data. Parallel processing is performed on the Hadoop platform, and local density thresholding and projection analysis techniques are combined to solve the problems of decreased clustering quality and multiple density peaks caused by global density thresholding, thereby improving clustering accuracy and efficiency.
It achieves efficient and accurate clustering of user behavior, effectively reducing computational complexity and improving clustering speed and accuracy, thus providing support for user interest tag segmentation and precision marketing.
Smart Images

Figure CN115168675B_ABST
Abstract
Description
Technical Field
[0001] This application relates to information processing technology, including but not limited to user behavior analysis methods, devices, equipment, and storage media. Background Technology
[0002] With the continuous development and increasing popularity of information technology, data collection and storage technology, all industries are facing massive amounts of user data. It is of great significance to mine users' interests and hobbies and discover their behavioral habits from this massive amount of data. Summary of the Invention
[0003] In view of this, the user behavior analysis method, apparatus, device, and storage medium provided in this application can selectively use corresponding density thresholds for clustering, thereby improving clustering accuracy and avoiding the problem of decreased clustering quality caused by all subsets of behavioral data sharing the same density threshold. The user behavior analysis method, apparatus, device, and storage medium provided in this application are implemented as follows:
[0004] The user behavior analysis method provided in this application includes: dividing a user behavior dataset into at least one first behavior data subset; determining a density threshold for each first behavior data subset, wherein the density threshold is used to characterize the proportion of user data belonging to the first behavior data subset; performing clustering processing on the corresponding first behavior data subset according to the density threshold to obtain a first subclass; and analyzing the user behavior according to the first subclass obtained by clustering processing to obtain an analysis result.
[0005] The user behavior analysis apparatus provided in this application includes: a partitioning module for partitioning a user behavior dataset into at least one first behavior data subset; a determining module for determining a density threshold for each first behavior data subset, wherein the density threshold is used to characterize the proportion of user data belonging to the first behavior data subset; a clustering module for performing clustering processing on the corresponding first behavior data subset according to the density threshold to obtain a first subclass; and an analysis module for analyzing the user behavior according to the first subclass obtained by the clustering processing to obtain an analysis result.
[0006] The electronic device provided in this application includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the method described in this application.
[0007] The computer-readable storage medium provided in this application embodiment stores a computer program thereon, which, when executed by a processor, implements the method described in this application embodiment.
[0008] In this embodiment, a user behavior analysis method is provided. This method partitions a user behavior dataset to obtain a first behavior data subset. Then, a density threshold is determined for each of the first behavior data subsets. Based on the density threshold, the corresponding first behavior data subsets are clustered to obtain a first subclass. Finally, the user's behavior is analyzed based on the first subclass obtained from the clustering process to obtain the analysis results. Thus, for each partitioned first behavior data subset, clustering is performed specifically using the corresponding density threshold, thereby improving clustering accuracy and avoiding the problem of decreased clustering quality caused by all behavior data subsets sharing the same density threshold. Attached Figure Description
[0009] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0010] Figure 1 This is a schematic diagram illustrating the implementation process of the user behavior analysis method in an embodiment of this application;
[0011] Figure 2 This is a schematic diagram illustrating the implementation process of the user behavior analysis method in an embodiment of this application;
[0012] Figure 3 A data distribution plot projected onto the X-axis for a subset of behavioral data;
[0013] Figure 4 This is a schematic diagram illustrating the implementation process of the user behavior analysis method in an embodiment of this application;
[0014] Figure 5 This is a schematic diagram illustrating the implementation process of the user behavior analysis method in an embodiment of this application;
[0015] Figure 6 A flowchart of the user behavior analysis system provided in the embodiments of this application;
[0016] Figure 7 A detailed flowchart of the user behavior analysis system provided in the embodiments of this application;
[0017] Figure 8 A flowchart illustrating the specific implementation steps of the improved density peak-based spatial clustering algorithm (Clustering by Fast Search and Find of Density Peaks, CFSFDP) provided in the embodiments of this application;
[0018] Figure 9 A graph showing the change in class center points provided in an embodiment of this application;
[0019] Figure 10 This is a schematic diagram of the data distribution of dataset 4 provided in an embodiment of this application;
[0020] Figure 11 The decision graph of dataset 4 provided in this application embodiment is not subject to projection partitioning;
[0021] Figure 12 The decision graph after projecting and partitioning the dataset 4 provided in the embodiments of this application;
[0022] Figure 13 This is a clustering effect diagram of dataset 4 after class merging, provided in an embodiment of this application.
[0023] Figure 14 A flowchart illustrating the operation of the user behavior analysis system provided in this application embodiment;
[0024] Figure 15 This is a schematic diagram of the user behavior analysis device provided in the embodiments of this application;
[0025] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0027] 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.
[0028] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] It should be noted that the terms "first, second, third" used in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order of objects. It can be understood that "first, second, third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0030] This application provides a user behavior analysis method applied to an electronic device. This electronic device can be of various types with information processing capabilities, such as mobile phones, tablets, personal computers, laptops, servers, and cluster servers. The functions implemented by this method can be achieved by the processor in the electronic device calling program code. The program code can be stored in a computer storage medium. Therefore, the electronic device includes at least a processor and a storage medium.
[0031] Figure 1 This is a schematic diagram illustrating the implementation flow of the user behavior analysis method provided in the embodiments of this application, such as... Figure 1 As shown, the method may include the following steps 101 to 104:
[0032] Step 101: Divide the user's behavior dataset into at least one first behavior data subset.
[0033] Understandably, before analyzing user behavior, it is necessary to collect user behavior data and preprocess the collected user behavior data to obtain a user behavior dataset.
[0034] In some embodiments, electronic devices can use web crawling technology to collect user behavior data from different network environments into a local database. These different network environments include mobile data network environments and wireless network environments. Then, the collected user behavior data is preprocessed, such as filtering, cleaning, and transforming the collected user behavior data. Finally, feature values are extracted from the preprocessed user behavior data, such as the user's gender, age group, occupation, consumption level, visited sites, access time, dwell time, and / or number of views, to form a user behavior dataset.
[0035] Understandably, filtering user behavior data during preprocessing reduces the amount of data in the final clustering dataset; cleaning user behavior data fills in missing values, removes individual user behavior data as potential noise, and deletes outliers, thus ensuring data accuracy and completeness; transforming user behavior data converts inconsistent data formats into a unified format, facilitating subsequent operations. In this embodiment, preprocessing the collected user behavior data improves the quality of the user behavior data used for clustering, making it more beneficial for subsequent clustering processing and behavior analysis.
[0036] In this embodiment, after obtaining the user's behavior dataset, the user's behavior dataset is divided to obtain at least one first behavior data subset. The division process refers to dividing the user's behavior dataset into multiple first behavior data subsets; therefore, the data volume of each first behavior data subset is smaller than the data volume of the behavior dataset.
[0037] Step 102: Determine the density threshold for each subset of the first row of data.
[0038] In this embodiment, a density threshold is determined for each subset of behavioral data. This allows for targeted clustering of each subset, resulting in higher clustering accuracy and avoiding the degradation in clustering quality caused by all subsets of behavioral data sharing the same density threshold.
[0039] It should be noted that the density threshold is used to characterize the proportion of user data belonging to the first row of data subsets. Each first row of data subset contains a different total number of data points, therefore, its corresponding density threshold is also different. The proportion can be 1%-2%. For example, if the first row of data subset contains a total of 1500 data points, then its corresponding density threshold can be determined as any value between 15 and 30.
[0040] Step 103: Based on the density threshold, cluster the corresponding first row of data subsets to obtain the first subclass.
[0041] In some embodiments, the electronic device performs clustering processing on at least two of the first behavior data subsets in parallel based on density thresholds of at least two of the first behavior data subsets, resulting in at least two first subclasses. Compared to processing the user behavior dataset on a single machine, processing the partitioned first behavior data subsets in parallel effectively reduces computational complexity and improves clustering efficiency. This is because: after partitioning the user behavior dataset, the amount of data in the first behavior data subset is smaller than the user behavior dataset before partitioning. Thus, on the one hand, less data needs to be processed when clustering the first behavior data subset, thereby reducing computational complexity, increasing computational speed, and thus increasing clustering speed; on the other hand, performing clustering processing on the partitioned first behavior data subset in parallel allows multiple data subsets to be processed simultaneously, thereby improving clustering efficiency.
[0042] In some embodiments, after obtaining the first row of data subsets, the electronic device may also perform clustering processing on at least two first row of data subsets sequentially to obtain at least two first subclasses. Understandably, compared to processing user behavior datasets on a single machine, performing clustering processing on at least two first row of data subsets sequentially requires less data per process and is faster.
[0043] Step 104: Analyze the user's behavior based on the first subclass obtained from the clustering process to obtain the analysis results.
[0044] It's important to note that user behavior analysis is performed based on all the first subclasses obtained from parallel clustering. For example, suppose there are three first-order data subsets 1, 2, and 3. These subsets are clustered in parallel, resulting in first subclasses A and B for subset 1, first subclass C for subset 2, and first subclasses D and E for subset 3. Then, user behavior analysis is performed based on all the resulting first subclasses A, B, C, D, and E.
[0045] After clustering the user behavior dataset through the above steps, user groups can be roughly divided into categories such as shopping, education, audio-visual, gaming, and financial management. This allows for tagging of user groups, providing a basis for recommending content that users are interested in, and offering decision-making and support for achieving precise marketing of products, websites, and apps.
[0046] Figure 2 This is a schematic diagram illustrating the implementation flow of the user behavior analysis method provided in the embodiments of this application, such as... Figure 2 As shown, the method may include the following steps 201 to 207:
[0047] Step 201: Determine the distribution characteristics of the behavior dataset; based on the distribution characteristics of the behavior dataset, divide the behavior dataset to obtain a second behavior data subset.
[0048] In the embodiments of this application, the distribution characteristics of the behavioral dataset can be diverse, such as dimensional distribution characteristics, data type characteristics, etc., and there is no limitation on this.
[0049] Taking the distribution characteristic as an example, the collected user behavior dataset contains multiple data types. For instance, user behavior data may be consumption data, which can be categorized into many types: lifestyle, shopping, education, or financial management, etc. Therefore, dividing the behavior dataset according to its data type can yield multiple subsets of secondary behavior data.
[0050] Step 202: Distribute the second row of data subsets to the corresponding data nodes in the distributed file system.
[0051] In this embodiment, a distributed file system platform is built, and the second row of data subsets is allocated to corresponding data nodes in the distributed file system for subsequent clustering processing. It should be noted that the number of data nodes in the distributed file system is equal to the number of data subsets in the second row.
[0052] In some embodiments, the distributed file system is the Hadoop Distributed File System (Hadoop) platform. Hadoop is a distributed processing framework that provides an effective solution for processing massive amounts of high-dimensional data. It works in parallel to accelerate processing speed.
[0053] Step 203: Project the allocated second row data subset onto the coordinate axis through the data node to obtain the projected dataset.
[0054] Understandably, large websites often have a huge user base, generating massive amounts of user behavior data every moment. Therefore, the amount of user behavior data collected is also very large. Directly clustering this large-scale data would result in slow processing speed and low efficiency. To solve this problem, a data sampling method can be used to represent the original second-behavior data subset for subsequent processing. This reduces the amount of data belonging to the behavior data subset to be clustered, thus improving clustering efficiency.
[0055] In this embodiment of the application, after sampling the second row of data subset, the second row of data subset is processed by a one-dimensional projection analysis method, that is, the data belonging to the second row of data subset is projected onto the coordinate axis to obtain the projected dataset.
[0056] One-dimensional projection analysis refers to finding the most suitable projection so that, after projecting user behavior data onto the coordinate axes, data within the same cluster are relatively concentrated, while data from different clusters are relatively separated. For example, if the projection distribution of a certain subset of second-row data on the X-axis shows two relatively dense regions, while the projection distribution on the Y-axis shows only one continuous region, then it can be seen that the projection on the X-axis better reflects the data partitioning of that subset of second-row data.
[0057] Step 204: Determine the peaks and troughs of the projection dataset; divide the projection dataset according to the peaks and troughs to obtain the first row of data subsets.
[0058] For example, such as Figure 3As shown, a subset of data in the second row is projected onto the X-axis to obtain the projected dataset. Its distribution on the X-axis presents two dense regions with a large difference in density. Therefore, the projected dataset can be divided into two regions on the X-axis.
[0059] The partitioning of the projected dataset is based on the peaks and troughs of the projected dataset on the coordinate axes, such as... Figure 3 As shown, the projected dataset contains two peaks (L1 and L2) and a trough (S0) between them. A threshold λ is given beforehand to determine whether a split point needs to be determined between two adjacent peaks. When |L1-L2|>λ, it is determined that the projected dataset needs to be split. To prevent a class from being mistakenly divided into multiple classes, the split point should be selected at the sparsest points of the data distribution, i.e., the troughs. The split point is any point x = x in the S0 region. p By partitioning the projected dataset using the above method, two subsets of data are ultimately obtained, with the first row being a subset of the data.
[0060] It should be noted that if the distribution density of the projected dataset on the coordinate axis is continuous, then there is no need to partition the projected dataset. That is, when the data distribution density is increasing, decreasing, or a straight line, there is no need to partition the projected dataset. In this case, the projected dataset is treated as the first row of the data subset.
[0061] In this embodiment of the application, by projecting and partitioning the second set of data, the user behavior dataset can be initially divided into different first set of data, thus providing conditions for subsequent fine clustering of the first set of data.
[0062] Step 205: Determine the density threshold for each subset of the first row of data;
[0063] Step 206: Based on the density threshold, cluster the corresponding first row of data subsets to obtain the first subclass;
[0064] Step 207: Analyze the user's behavior based on the first subclass obtained from the clustering process to obtain the analysis results.
[0065] Figure 4 This is a schematic diagram illustrating the implementation flow of the user behavior analysis method provided in the embodiments of this application, such as... Figure 4 As shown, the method may include the following steps 401 to 405:
[0066] Step 401: Divide the user's behavior dataset into at least one first behavior data subset;
[0067] Step 402: Determine the density threshold for each subset of the first row of data;
[0068] Step 403: Based on the density threshold, cluster the corresponding first row of data subsets to obtain the first subclass;
[0069] Step 404: Merge the first subclasses obtained from the clustering process to obtain at least one second subclass;
[0070] Understandably, when there are multiple density peaks in the first row of data subsets, clustering will divide the first row of data subsets that should have been divided into one first subclass into two or more first subclasses, in which case subclass merging is required. During projection partitioning, data belonging to the same first row of data subsets may also be divided into the first row of data subsets of two adjacent partitions. Consequently, in subsequent clustering, clustering is performed based on the two incorrectly divided first row of data subsets, resulting in inaccurate clustering. Therefore, it is also necessary to merge the multiple first subclasses obtained from clustering.
[0071] In this embodiment of the application, by merging multiple first subclasses obtained from clustering, the problem of inaccurate clustering of multi-density peak data in the clustering algorithm can be solved, and the clustering accuracy and quality are high.
[0072] Step 405: Analyze the user's behavior based on the at least one second subclass to obtain the analysis results.
[0073] Figure 5 This is a schematic diagram illustrating the implementation flow of the user behavior analysis method provided in the embodiments of this application, such as... Figure 5 As shown, the method may include the following steps 501 to 512:
[0074] Step 501: Divide the user's behavior dataset into at least one first behavior data subset;
[0075] Step 502: Determine the density threshold for each subset of the first row of data;
[0076] Step 503: Based on the density threshold, perform clustering on the corresponding first row of data subsets to obtain the first subclass;
[0077] Step 504: Determine whether the N first subclasses in the first storage structure meet the merging conditions; where N is greater than 1; if yes, proceed to step 505; otherwise, proceed to step 506.
[0078] In this embodiment of the application, the first subclass obtained by clustering is stored in the first storage structure.
[0079] It should be noted that determining whether N first subclasses meet the merging condition can refer to determining whether two, three, or four first subclasses meet the merging condition; the number of first subclasses to be merged is not limited. Similarly, the number of N subclasses stored in the first storage space is also unlimited; it can be one or more.
[0080] In some embodiments, the first subclasses obtained from clustering are stored in the first storage structure as follows: the first subclasses of adjacent partitions are stored sequentially in the first storage structure, and the N first subclasses are subclasses of adjacent partitions. Understandably, the first subclasses of adjacent partitions have a higher similarity. If the i-th subclass and the (i+1)-th subclass of an adjacent partition do not meet the merging condition, then it is unnecessary to continue judging the similarity between the i-th subclass and the (i+2)-th subclass; instead, it is directly determined that the i-th subclass and the (i+2)-th subclass cannot be merged. Therefore, this method of storing the subclasses of adjacent partitions sequentially reduces the number of judgments and improves merging efficiency.
[0081] In this embodiment of the application, the merging condition includes: the inter-class similarity of the subclasses to be merged is less than a first threshold; wherein, the inter-class similarity represents the sum of the distances between user behavior data belonging to the subclasses to be merged.
[0082] It should be noted that the subclass to be merged refers to the subclass whose merging conditions need to be determined.
[0083] Determining whether the N first subclasses in the first storage structure meet the merging condition is equivalent to determining whether the inter-class similarity of the N first subclasses is less than a first threshold. For example, suppose there are two first subclasses A and B, with density thresholds d and d respectively. cA d cB User behavior data belonging to the first subclass A are a, b, and c, and user behavior data belonging to the first subclass B are e, d, and f; d cA d cB The smaller value is determined as the first threshold. The sum of the distances between user behavior data a, b, and c belonging to the first subclass A and user behavior data e, d, and f belonging to the first subclass B is calculated. If the value is less than or equal to the first threshold, it means that the first subclass A and the first subclass B can be merged, and step 505 is executed; if the value is greater than the first threshold, it means that the first subclass A and the first subclass B cannot be merged, and step 506 is executed.
[0084] Step 505: Merge the N first subclasses to obtain a merged subclass, and write the merged subclass into the second storage structure;
[0085] Step 506: Write the N first subclasses into the second storage structure in sequence.
[0086] In some embodiments, the first storage structure and the second storage structure are linked lists.
[0087] In this embodiment, when determining whether the merged subclass can be written into the second storage structure, it is also necessary to determine the cohesion parameter of the merged subclass; wherein, the cohesion parameter represents the sum of distances between user behavior data belonging to the merged subclass. If the cohesion parameter is greater than a second threshold, the merged subclass is written into the second storage structure; if the cohesion parameter is less than or equal to the second threshold, the subclass to be merged used to obtain the merged subclass is written into the second storage structure.
[0088] For example, once it's determined that N first subclasses can be merged, they are merged to obtain a merged subclass M. An initial sum of distances between user behavior data belonging to merged subclass M is calculated. This initial sum is used as a second threshold to monitor whether the sum of distances between user behavior data belonging to merged subclass M changes. This is used to determine whether merged subclass M needs to be decomposed. If the value doesn't suddenly decrease, it means merged subclass M doesn't need decomposition, and it's written to the second storage space. If the value suddenly decreases, it means merged subclass M needs decomposition, and the N first subclasses used to obtain merged subclass M are written to the second storage space. This method solves the problem of subclass merging being irreversible.
[0089] Step 507: Determine whether there is an N+1th first subclass in the first storage structure; if yes, proceed to step 508; otherwise, proceed to step 509.
[0090] Understandably, after determining whether the N first subclasses in the first storage structure can be merged, the next determination needs to first determine whether the first storage structure still stores any first subclasses. If the first storage structure still stores first subclasses, then step 508 is executed to continue determining whether the next N first subclasses meet the merging condition; if the first subclasses stored in the first storage structure are empty, it means that the determination in the current first storage structure has been completed, then step 509 is executed.
[0091] Step 508: Determine whether the next N first subclasses in the first storage structure meet the merging condition; if yes, return to step 505; otherwise, proceed to step 509.
[0092] Step 509: Update the second storage structure to the first storage structure, and clear the second storage structure.
[0093] Understandably, performing a single merge check on the first subclass in the initial first storage structure cannot guarantee that multiple merged subclasses cannot be merged again. Therefore, to improve the accuracy of merging and obtain more accurate clustering results, it is necessary to perform multiple merge checks on the subclasses to ensure that there are no subclasses in the final output clustering result that can be merged further.
[0094] In this embodiment of the application, after all the first subclasses stored in the first storage structure are judged, the second storage structure is updated to the first storage structure and the second storage structure is cleared, so as to continue to execute the above steps 504 to 508 in a loop and perform a merging judgment on the updated first storage structure.
[0095] Step 510: Determine whether there are at least two subclasses in the updated first storage structure that satisfy the merging conditions; if so, return to step 505; otherwise, proceed to step 511.
[0096] After updating the second storage structure to the first storage structure, the subclasses stored in the updated first storage structure are merged. If there are at least two subclasses that meet the merging conditions, it means that there are still subclasses that can be merged in the updated first storage structure, and then the process returns to step 505; if there are no at least two subclasses that meet the merging conditions, it means that there are no subclasses that meet the merging conditions in the updated first storage structure, then step 511 is executed, and the subclasses in the updated first storage structure obtained at this time are taken as the second subclasses.
[0097] Step 511: Use the subclass in the updated first storage structure as the second subclass.
[0098] Step 512: Analyze the user's behavior based on the at least one second subclass to obtain the analysis results.
[0099] In some embodiments, the merging process of the first subclass is achieved by performing the following steps 601 to 609.
[0100] Step 601: Sequentially save the first subclass of adjacent partitions to the first linked list;
[0101] Step 602, let the number of merges n = 0;
[0102] Step 603: Access the first subclass at position i and the first subclass at position (i+1) of the first linked list;
[0103] Step 604: Determine whether the first subclass at position i and the first subclass at position i+1 satisfy the merging condition; if they satisfy the condition, proceed to step 605; if they do not satisfy the condition, proceed to step 606.
[0104] Step 605: Merge the first subclass at position i with the first subclass at position i+1 to obtain a merged subclass; and increment the merging count by 1 and save the merged subclass to the second linked list, then proceed to step 607;
[0105] Step 606: Save the first subclass at position i and the first subclass at position (i+1) to the second linked list, and proceed to step 607;
[0106] Step 607: Let i = i + 2; if the first linked list has the i-th position, return to step 603; otherwise, proceed to step 608.
[0107] Step 608: Determine if n is 0; if yes, use the class stored in the second linked list as the second subclass; otherwise, proceed to step 609.
[0108] Step 609: Let i = 1, and update the second linked list to the first linked list, then return to step 602.
[0109] With the continuous development and increasing prevalence of information technology, data collection, and storage technologies, all industries face massive amounts of user data. Extracting user interests and behavioral habits from this vast amount of data is of great significance. Cluster analysis, as an important data mining method, has been widely applied in user behavior analysis, World Wide Web (WWW) search, text processing, and other fields. Using cluster analysis to analyze user behavior and recommend websites related to users' interests can not only save users a significant amount of time but also provide decision-making and support for product, website, and other online marketing strategies.
[0110] However, with the continuous development of internet technology, user behavior analysis has the following problems:
[0111] First, large websites often have a huge user base, generating massive amounts of user data every moment. This user data grows exponentially, and running clustering algorithms on a single machine can no longer meet the needs. Hadoop, a distributed processing framework, provides an effective solution for processing massive amounts of high-dimensional data. It can efficiently process massive amounts of data and has the characteristics of high efficiency, reliability, and scalability.
[0112] II. Currently, typical clustering algorithms used for user behavior analysis include: K-means clustering (K-Means), Density-Based Spatial Clustering of Applications with Noise (DBSCAN), and mean-shift. K-Means requires pre-specifying the number of clusters and cannot cluster non-spherical datasets; DBSCAN can discover clusters of arbitrary shapes, but it requires specifying a density threshold; mean-shift clustering results depend on the bandwidth setting—too large a bandwidth can easily lose clusters, while too small a bandwidth results in slow convergence. Alex et al. proposed the CFSFDP algorithm to discover high-density regions separated by low-density regions. Compared to DBSCAN, CFSFDP can cluster datasets of arbitrary shapes in noisy environments and is simple and fast to implement; compared to mean-shift, CFSFDP only considers the distance between points and does not require mapping the data to a vector space. Compared to the K-means algorithm, CFSFDP can automatically obtain the number of clusters and has relatively lower algorithm complexity. Although CFSFDP is currently considered an ideal clustering algorithm, it also has the following drawbacks: ① The algorithm requires specifying a global density threshold d. c ① The spatial distribution characteristics of the data were not considered. When the data density and inter-class distance distribution are uneven, the clustering quality will decrease. ② When there are multiple density peaks in a class, although CFSFDP sorts the data points in descending order of density value, the clustering effect is not ideal.
[0113] Based on this, the following will describe an exemplary application of the embodiments of this application in a practical application scenario.
[0114] This application provides a user behavior analysis system based on the density peak clustering method. It distributes massive data analysis tasks across the Hadoop platform, solving the problem of low efficiency in traditional single-machine clustering algorithms, effectively reducing computational load and complexity, improving clustering speed and efficiency, and achieving parallel clustering. Furthermore, it uses an improved CFSFDP algorithm to cluster user behavior data, addressing the limitations of the original CFSFDP algorithm, which relies on a global density threshold d. c This addresses the issues of decreased clustering quality and inaccurate clustering when multiple density peaks exist, thereby improving the clustering accuracy and precision of the CFSFDP algorithm.
[0115] The purpose of this application is to analyze user behavior data, tag users' interests, and recommend content or websites that they are interested in, saving users a lot of time; at the same time, it provides decision-making and support for products, websites, etc. to achieve precise marketing.
[0116] The user behavior analysis system based on density peak clustering provided in this application mainly includes four modules: a data acquisition module, a data preprocessing module, a cluster analysis module, and a user interest tagging module. The system flowchart is shown below. Figure 6 As shown.
[0117] Data acquisition module: mainly used to collect user behavior data features, that is, to collect user behavior-related information from different networks into the local database through web crawling technology;
[0118] Data preprocessing module: The data is preprocessed using data warehouse (Extract-Transform-Load, ETL) tools. First, the collected user behavior data is filtered, cleaned and transformed. Then, feature values are extracted from the preprocessed data, such as user gender, age group, occupation, consumption level, visited sites, visit time, dwell time, number of views and other attribute features, to form a dataset to be clustered.
[0119] Clustering analysis module: Build a Hadoop platform and distribute the dataset to be clustered to multiple data nodes in the Hadoop Distributed File System; for each data node, use the improved CFSFDP algorithm to perform parallel clustering of the dataset to be clustered in that data node; finally, merge the subclasses in each data node according to the cohesion measure parameter E(C) to obtain the final clustering result.
[0120] User interest tagging module: Based on clustering results, users are classified and their interests are tagged. Different types are marked with different tags, providing a basis for recommending content that users are interested in, and providing decision-making and support for precise marketing of products, websites, etc.
[0121] Figure 7 A detailed flowchart of a user behavior analysis system based on the density peak clustering method is provided. Figure 7 As shown, perform the following steps 701 to 707:
[0122] Step 701: Use web crawling technology to collect user behavior data from the network;
[0123] Step 702, data preprocessing, using ETL tools to filter, clean and transform the data;
[0124] Step 703: Extract the feature values of the preprocessed data to form a dataset to be clustered (i.e., the user's behavior dataset);
[0125] Step 704: Set up the Hadoop platform and allocate the dataset to be clustered to the Hadoop Distributed File System;
[0126] Step 705: Cluster each data node using the improved CFSFDP algorithm;
[0127] Step 706: Merge the classes (i.e., the first subclasses) obtained from each data node;
[0128] Step 707: Divide user interests into tags based on the clustering results (i.e., the second subclass).
[0129] The core of this application's embodiments lies in using an improved CFSFDP algorithm to analyze user behavior. The algorithm process is as follows: First, based on the overall distribution characteristics of the dataset, projection analysis is used to divide it into multiple partitions, making each smaller partition more evenly distributed; then, the CFSFDP algorithm is used to cluster each partition, assigning different clustering methods to each partition. c The value solves the problem caused by the global d. c This addresses the issue of decreased clustering quality caused by the algorithm; finally, the resulting subclasses are merged to resolve the problem of inaccurate clustering of multi-density peak data by the CFSFDP algorithm.
[0130] The specific schemes of the improved CFSFDP algorithm are as follows (1) to (4):
[0131] (1) Data partitioning:
[0132] First, the dataset to be clustered is preprocessed by dividing it into multiple partitions based on its spatial distribution characteristics in one or more dimensions, so that the partitions are more evenly distributed.
[0133] For large-scale datasets, data sampling is used to improve clustering efficiency. To ensure that the sampled dataset effectively represents the distribution of the original dataset, the sample size should be determined scientifically. If the sample size is inappropriately chosen, the sampled dataset may lose some characteristics of the original dataset, leading to inaccurate estimation of the overall distribution and affecting the clustering results.
[0134] The following is the method for determining the sample size:
[0135] Let ξ1, ξ2, ... ξ L Let L be a subsample of the population ξ, with a sample size of L, and the expected value of the population is E(ξ) = μ. The error range d is shown in Formula 1.
[0136]
[0137] When N is large, the sample size L is calculated using the central limit theorem, as shown in Formula 2:
[0138]
[0139] Where the sample mean The calculation is shown in Formula 3:
[0140]
[0141] Formula 4 shows that at confidence level α, the absolute error between the sample mean and the population mean is less than d. In the calculation process, the sample variance can be used instead of D(ξ). The sample variance is:
[0142]
[0143] Given the absolute error d and the confidence level α, find the V corresponding to α by referring to the table. α The size of sample L can be calculated using the following formula:
[0144]
[0145] (2) Classification criteria:
[0146] After sampling the dataset, drawing inspiration from DBSCAN's one-dimensional projection analysis approach for multi-density datasets, the sample points are projected onto the X and Y axes respectively. Histogram methods are then used to analyze the data distribution characteristics, determining the dimension on which to partition the dataset, the number of partitions, and the partition boundaries. To prevent mistakenly dividing a class into multiple classes, the partitioning points should be selected at the sparsest points in the data distribution (e.g., ...). Figure 3 ), that is, the trough.
[0147] The following section describes how to automatically partition the dataset (i.e., the projected dataset). First, a threshold λ is given to determine whether a split point needs to be established between two adjacent peaks. A vector {L1, S0, L2} is used to store two adjacent peaks (L1 and L2) and the trough between them (S0). When |L1-L2|>λ, the split point is any point x = x in region S0. p All the partition points form a set S.
[0148] Figure 3 The image shows the data distribution plot projected onto the X-axis after sampling the dataset. The horizontal axis represents the x-coordinate of the sample points, and the vertical axis represents the number of sample points with the same x-coordinate (referred to as frequency). Figure 3It can be seen that the distribution on the X-axis presents two dense regions, and the density of these two dense regions differs significantly and satisfies |L1-L2|>λ. Therefore, the dataset can be divided into two regions on the X-axis, with the dividing line being the scan line x = x at any point in the trough region S0. p .
[0149] Similarly, the dataset can be divided along the Y-axis using the method described above. However, when the data distribution density is continuous, it is not necessary to divide the data. That is, when the data distribution density is increasing, decreasing, or a straight line, it is not necessary to divide the data.
[0150] (3) Local clustering:
[0151] After projection partitioning is completed, the CFSFDP algorithm is used to perform local clustering on each partition. During local clustering, each partition selects an appropriate d based on its data distribution density. c Clustering is performed on the values, and therefore by the global d c The problem of decreased clustering quality caused by this has been resolved.
[0152] To facilitate the merging of local clustering results, during the local clustering process, it is necessary to record the core regions and boundary regions of each category (they belong to that category, but are located within a distance of no more than d). c Within the range, there are data points belonging to other classes; it should also be recorded that the distance to the highest density point in the boundary region is greater than d. c The noise points are because these noise points may be points within a segmented class or boundary points of a class in the global context.
[0153] (4) Subclass merging:
[0154] When a cluster contains multiple density peaks, CFSFDP will divide the cluster into two or more, requiring sub-cluster merging. Similarly, during projective partitioning, data points within the same cluster may be assigned to two adjacent partitions, also necessitating sub-cluster merging. Therefore, after local clustering is completed, sub-clusters that are adjacent to each other and have high correlation should be merged. Introducing a cohesion parameter during merging solves the problem of irreversible cluster merging. For example... Figure 10 In the dataset 4 shown, the outer ring should be clustered into one class, but after projection partitioning, the CFSFDP algorithm clusters it into 4 classes. Therefore, the subclasses in the outer ring that satisfy the inter-class similarity should also be merged.
[0155] Suppose there exist two classes A and B, with density thresholds d and d respectively. cA d cB The boundary region point sets are E A E B p and q are E A EB In the data points, Dist{p,q} represents the distance between p and q, and the number of points in the boundary region is N. A N B The formula is as follows:
[0156]
[0157] d c The formula for calculating (A,B) is:
[0158] d c (A,B)=min{d cA ,d cB}(7);
[0159] If A and B satisfy the inter-class similarity:
[0160]
[0161] Then classes A and B will be merged.
[0162] To enable the algorithm to perform decomposition operations after merging, a cohesion parameter is introduced in this embodiment, defined as follows:
[0163]
[0164] Where C represents class, n r It is a penalty factor, and the similarity between data points within a class is:
[0165]
[0166] Where D i,k Indicates (p) i ,p k The distance between clusters is such that when the value of k is large, a penalty is applied to the value of k to minimize the number of clusters.
[0167]
[0168] During the algorithm iteration process, when the value of E'(C) suddenly becomes small, a class merging decomposition is performed to restore the state before merging.
[0169] Figure 8 The detailed implementation steps of the improved CFSFDP algorithm are given. Figure 8 In the middle, perform the following steps 801 to 816:
[0170] Step 801: Read the dataset to be clustered and perform data preprocessing;
[0171] Step 802: Calculate the sample size L using Formula 5, and extract L sample points from the dataset using simple sampling; project the sample points onto the X-axis and Y-axis respectively; record the peaks and troughs, determine the set S of partitioning points, and partition the dataset.
[0172] Step 803: Calculate x for each data point in each partition (i.e., the first row is the data subset). i Local density ρ i and distance δ i And determine the density threshold d c ;
[0173] Step 804: Determine the cluster centers and their number based on the decision map. The selection of cluster centers requires consideration of both ρ and δ values, calculated using the following formula:
[0174] γ i =ρ i ×δ i ,i∈I S (12);
[0175] Among them, I s For the index set, γ i The larger the value of x, the greater the corresponding x. i The higher the probability of γ being selected as a cluster center, the greater the likelihood of it being chosen. Therefore, it is necessary to sort γ in descending order and select the optimal cluster center based on the γ variation curve. Figure 9 The curve of γ variation is given.
[0176] When transitioning from cluster centers to non-cluster centers, the γ value exhibits a significant jump, while the γ value in non-cluster centers is relatively flat. Therefore, the cluster centers of each class can be determined by finding the first jump point of γ. For example... Figure 9 As shown, when I s When γ = 5, there is a clear jumping phenomenon, that is, the data points corresponding to the first 5 sorted γ values are selected as the cluster centers.
[0177] Step 805: Classify the data points that are not cluster centers according to the density threshold d. c Determine the core and boundary regions for each type, and specify the highest point density value ρ in the boundary region. b As a threshold for removing noise points;
[0178] Step 806: Save all classes located in adjacent partitions sequentially into the linked list Link1 (i.e., the first storage structure), and set the density threshold d of each class. c Density value ρ of the core area boundary area and the highest point b The information is recorded in Link1;
[0179] Step 807: Set the number of merges n = 0, visit the linked list Link1 in sequence, and use Formula 8 to calculate the similarity between the two classes (i.e., inter-class similarity);
[0180] Step 808: Determine whether the merging conditions are met. If the similarity of class merging is met, proceed to step 809; otherwise, proceed to step 812.
[0181] Step 809: Use Formula 11 to determine whether the value of E'(C) decreases sharply. If not, proceed to step 810; if yes, proceed to step 811.
[0182] Step 810: Save the corresponding information to the linked list Link2 (i.e., the second storage structure), increment the merging count n by 1, and then execute step 812;
[0183] Step 811: Undo the merge, then proceed to step 812;
[0184] Step 812, move the pointer forward;
[0185] Step 813: Determine if the nodes in Link1 are empty, that is, determine if the search has reached the end of Link1; if not empty, return to step 807; otherwise, proceed to step 814.
[0186] Step 814: Set Link1 = Link2, Link2 = NULL;
[0187] Step 815: Determine if the number of merges n is 0. If n ≠ 0, return to step 807; otherwise, proceed to step 816.
[0188] Step 816: Output the clustering results (i.e., the second subclass).
[0189] To verify the effectiveness of the improved CFSFDP algorithm, several typical datasets were selected for simulation experiments. Figure 10 Take dataset 4 as an example:
[0190] Figure 11 The decision graph for dataset 4 without using the projection partitioning method is given; Figure 12 The decision graph obtained by using the projection partitioning method on dataset 4 is given.
[0191] exist Figure 11 and Figure 12 In this context, different symbols are used to represent different classes, such as circles, crosses, triangles, and asterisks.
[0192] from Figure 11 As can be seen, the dataset was clustered into 7 categories before projection partitioning. Figure 12As can be seen, after projection partitioning, the dataset is clustered into 6 classes (i.e., the outer ring is clustered into 4 classes).
[0193] The improved CFSFDP algorithm, by introducing a class merging technique, clusters the outer rings into one class, resulting in the following clustering outcome: Figure 13 As shown. In Figure 13 In the example, after class merging is introduced, dataset 4 is clustered into 3 classes.
[0194] Figure 14 The system design and operation flow are given. For example... Figure 14 As shown, based on the Hadoop distributed system, the improved CFSFDP algorithm is executed in parallel using the MapReduce parallel computing model for large-scale data processing on each data node to cluster the dataset to be clustered in that data node. Finally, the subclasses in each data node are merged according to the cohesion measure parameter E(C) until the data clusters can no longer be merged, and the final clustering result is obtained.
[0195] Practice has shown that the improved CFSFDP algorithm can effectively reduce data dimensionality and improve clustering accuracy; the Hadoop distributed system can distribute the dataset to be clustered to different processors, effectively reducing computational complexity, improving the clustering speed and efficiency of the algorithm, and realizing parallel clustering.
[0196] The user behavior analysis system based on density peak clustering proposed in this application is used for site access type analysis. By extracting user characteristic information such as gender, age group, occupation, consumption level, accessed sites, access time, dwell time, and number of views, and clustering them using the above method, the user group can be roughly divided into the following categories: shopping, education, audio-visual, games, financial management, etc. The user group is tagged and segmented, providing a basis for recommending content that users are interested in, and providing decision-making and support for achieving precise marketing of products, websites, etc.
[0197] The user behavior analysis system based on density peak clustering proposed in this application is a general user behavior analysis system, characterized by: (1) using the Hadoop platform to distribute the massive data analysis tasks, solving the problem of low efficiency of traditional single-machine clustering algorithms, effectively reducing the amount of computation and complexity, improving the clustering speed and efficiency, and enabling parallel clustering; (2) using the improved CFSFDP algorithm to perform clustering analysis on user behavior data, using local peak clustering (DPS) clustering. c Clustering is performed separately for each partition, which solves the problem of using a global d. cThe problem of decreased clustering quality in datasets with uneven density distribution is addressed by merging the resulting subclasses, thus overcoming the inaccuracy of the original CFSFDP algorithm in clustering multi-density peak data, resulting in higher clustering accuracy and quality.
[0198] Based on the foregoing embodiments, this application provides a user behavior analysis device, which includes various modules and units included in each module, and can be implemented by a processor; it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate array (FPGA), etc.
[0199] Figure 15 This is a schematic diagram of the user behavior analysis device of this application, as shown below. Figure 15 As shown, the device 150 includes a segmentation module 151, a determination module 152, a clustering module 153, and an analysis module 154, wherein:
[0200] The partitioning module 151 is used to partition the user's behavior dataset into at least one first behavior data subset;
[0201] The determining module 152 is used to determine the density threshold of each first behavior data subset, wherein the density threshold is used to characterize the proportion of user data belonging to the first behavior data subset;
[0202] Clustering module 153 is used to perform clustering processing on the corresponding first row of data subsets according to the density threshold to obtain a first subclass;
[0203] The analysis module 154 is used to analyze the user's behavior based on the first subclass obtained by clustering and to obtain the analysis results.
[0204] In some embodiments, clustering module 152 is configured to perform clustering processing on the at least two first behavioral data subsets in parallel based on density thresholds of at least two first behavioral data subsets to obtain at least two first subclasses.
[0205] In some embodiments, the user behavior analysis device 150 further includes a determination module and an allocation module. The determination module is used to determine the distribution characteristics of the behavior dataset. The partitioning module 151 is used to partition the behavior dataset according to the distribution characteristics of the behavior dataset to obtain a second behavior data subset. The allocation module is used to allocate the second behavior data subset to the corresponding data node in the distributed file system. The partitioning module 151 is also used to partition the allocated second behavior data subset through the data node to obtain at least one first behavior data subset.
[0206] In some embodiments, the user behavior analysis device 150 further includes a projection module, which is used to project the allocated second behavior data subset onto a coordinate axis through the data node to obtain a projected dataset; a determination module, which is used to determine the peaks and troughs of the projected dataset; and a partitioning module 151, which is used to partition the projected dataset according to the peaks and troughs of the projected dataset to obtain at least one first behavior data subset.
[0207] In some embodiments, the user behavior analysis device 150 further includes a merging module, which is used to merge the first subclasses obtained by clustering to obtain at least one second subclass; and an analysis module 153 is used to analyze the user's behavior based on the at least one second subclass to obtain an analysis result.
[0208] In some embodiments, the user behavior analysis device 150 further includes a storage module, which is used to store the first subclasses obtained by clustering in a first storage structure; a determination module is used to determine whether N first subclasses in the first storage structure meet the merging condition; wherein N is greater than 1; if the N first subclasses meet the merging condition, the N first subclasses are merged to obtain a merged subclass, and the merged subclass is written into a second storage structure; if the N first subclasses do not meet the merging condition, the N first subclasses are sequentially written into the second storage structure; the determination module is further used to determine whether there is an (N+1)th cluster in the first storage structure. The first subclass; if the (N+1)th first subclass exists, determine whether the next N first subclasses in the first storage structure satisfy the merging condition; if the (N+1)th first subclass does not exist, update the second storage structure to the first storage structure and clear the second storage structure; the determining module is further configured to determine whether there are at least two subclasses in the updated first storage structure that satisfy the merging condition; if there are at least two subclasses that satisfy the merging condition, process the updated first storage structure according to the above steps; if there are no at least two subclasses that satisfy the merging condition, use the subclasses in the updated first storage structure as the second subclass.
[0209] In some embodiments, the determining module is further configured to determine a cohesion parameter of the merged subclass; wherein the cohesion parameter represents the sum of distances between user behavior data belonging to the merged subclass; if the cohesion parameter is greater than a second threshold, the merged subclass is written into the second storage structure; if the cohesion parameter is less than or equal to the second threshold, the subclass to be merged used to obtain the merged subclass is written into the second storage structure.
[0210] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0211] It should be noted that, in the embodiments of this application... Figure 15 The module division of the user behavior analysis device shown is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical units, or be integrated into one unit with two or more units. The integrated units can be implemented in hardware, as software functional units, or a combination of both.
[0212] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0213] This application provides an electronic device. Figure 16 This is a schematic diagram of the hardware entity of the electronic device according to an embodiment of this application, such as... Figure 16 As shown, the electronic device 160 includes a memory 161 and a processor 162. The memory 161 stores a computer program that can run on the processor 162. When the processor 162 executes the program, it implements the steps in the method provided in the above embodiments.
[0214] It should be noted that the memory 161 is configured to store instructions and applications executable by the processor 162, and can also cache data to be processed or already processed by the processor 162 and various modules in the electronic device 160 (e.g., image data, audio data, voice communication data and video communication data), which can be implemented by flash memory or random access memory (RAM).
[0215] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method provided in the above embodiments.
[0216] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the method provided in the above-described method embodiments.
[0217] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium, storage medium, and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0218] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, they will not be repeated here.
[0219] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist simultaneously, and object B exists alone.
[0220] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0221] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or modules can be electrical, mechanical, or other forms.
[0222] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0223] In addition, each functional module in the various embodiments of this application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in the form of hardware plus software functional units.
[0224] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0225] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0226] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0227] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0228] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0229] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A user behavior analysis method, characterized in that, The method includes: Divide the user's behavior dataset into at least one first behavior data subset; Determine a density threshold for each subset of the first behavior data, wherein the density threshold is used to characterize the proportion of user data belonging to the first subset of behavior data; Based on the density threshold, the corresponding first row of data subsets is clustered to obtain a first subclass; the first subclass obtained by the clustering process is stored in a first storage structure; it is determined whether N first subclasses in the first storage structure meet the merging condition; where N is greater than 1; if the N first subclasses meet the merging condition, the N first subclasses are merged to obtain a merged subclass, and the merged subclass is written into a second storage structure; if the N first subclasses do not meet the merging condition, the N first subclasses are sequentially written into the second storage structure; Determine whether there is an N+1th first subclass in the first storage structure; if there is an N+1th first subclass, determine whether the next N first subclasses in the first storage structure meet the merging condition; if there is no N+1th first subclass, update the second storage structure to the first storage structure and clear the second storage structure. Determine whether there are at least two subclasses in the updated first storage structure that satisfy the merging condition; if there are at least two subclasses that satisfy the merging condition, process the updated first storage structure according to the above steps; if there are no at least two subclasses that satisfy the merging condition, use the subclasses in the updated first storage structure as the second subclasses. The user's behavior is analyzed based on at least one of the second subclasses to obtain analysis results.
2. The method according to claim 1, characterized in that, The step of clustering the corresponding first row of data subsets according to the density threshold to obtain the first subclass includes: Based on the density thresholds of at least two first-behavior data subsets, clustering is performed in parallel on the at least two first-behavior data subsets to obtain at least two first subclasses.
3. The method according to claim 1, characterized in that, The step of dividing the user's behavior dataset into at least one first behavior data subset includes: Determine the distribution characteristics of the behavioral dataset; Based on the distribution characteristics of the behavior dataset, the behavior dataset is divided to obtain a second subset of behavior data; The second row of data subsets is allocated to the corresponding data nodes in the distributed file system; The allocated second row data subset is divided using the data nodes to obtain at least one first row data subset.
4. The method according to claim 3, characterized in that, The step of partitioning the allocated second row data subset through the data nodes to obtain at least one first row data subset includes: The allocated second row data subset is projected onto the coordinate axis through the data nodes to obtain the projected dataset; Determine the peaks and troughs of the projected dataset; Based on the peaks and troughs of the projection dataset, the projection dataset is partitioned to obtain at least one subset of the first row of data.
5. The method according to claim 1, characterized in that, The merging conditions include: the inter-class similarity of the subclasses to be merged is less than a first threshold; wherein, the inter-class similarity represents the sum of the distances between user behavior data belonging to the subclasses to be merged.
6. The method according to claim 1, characterized in that, The step of writing the merged subclass into the second storage structure includes: Determine the cohesion parameter of the merged subclass; wherein the cohesion parameter represents the sum of distances between user behavior data belonging to the merged subclass; If the cohesion parameter is greater than the second threshold, the merged subclass is written into the second storage structure; The method further includes: if the cohesion parameter is less than or equal to the second threshold, writing the subclass to be merged to obtain the merged subclass into the second storage structure.
7. A user behavior analysis device, characterized in that, include: A partitioning module is used to divide the user's behavior dataset into at least one first behavior data subset; A determining module is used to determine a density threshold for each of the first behavioral data subsets, wherein the density threshold is used to characterize the proportion of user data belonging to the first behavioral data subset; The clustering module is used to perform clustering processing on the corresponding first row of data subsets according to the density threshold to obtain the first subclass; A storage module is used to store the first subclass obtained by the clustering process in a first storage structure; The determining module is further configured to determine whether N first subclasses in the first storage structure meet the merging condition; wherein N is greater than 1; if the N first subclasses meet the merging condition, the N first subclasses are merged to obtain a merged subclass, and the merged subclass is written into the second storage structure; if the N first subclasses do not meet the merging condition, the N first subclasses are sequentially written into the second storage structure. The determining module is further configured to determine whether there is an N+1th first subclass in the first storage structure; if there is an N+1th first subclass, determine whether the next N first subclasses in the first storage structure meet the merging condition; if there is no N+1th first subclass, update the second storage structure to the first storage structure and clear the second storage structure. The determining module is further configured to determine whether there are at least two subclasses in the updated first storage structure that satisfy the merging condition; if there are at least two subclasses that satisfy the merging condition, the updated first storage structure is processed according to the above steps; if there are no at least two subclasses that satisfy the merging condition, the subclasses in the updated first storage structure are taken as the second subclasses. An analysis module is used to analyze the user's behavior based on at least one of the second subclasses and obtain analysis results.
8. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Grid-based data clustering method for fast researching density peaks
CN106339416A
User behavior analysis method and device, computing equipment and storage medium
CN109993556A