User behavior dynamic data deep mining analysis method
Through the deep mining analysis method, the user behavior data is preprocessed and the automatic encoder is integrated, which solves the problems of complex calculations and insufficient outliers in the prior art, and realizes efficient and accurate monitoring and early warning of user behavior status.
Patent Information
- Application Number
- CN202411855429.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The prior art has complex calculations in the spatiotemporal semantic similarity metrics of user behavior data, low efficiency when processing large amounts of user data, insufficient outlier processing, and unreasonable dimensional weight settings during weighted integration, which affects the accuracy and reliability of the results.
A method for in-depth mining and analysis of dynamic user behavior data is proposed. By obtaining behavior data and environmental data, pre-processing, using an automatic encoder to fusion of multi-dimensional feature data, outputting a comprehensive behavior vector, and determining the current behavior status of the user based on this.
It realizes efficient integration and in-depth mining analysis of user behavior and environmental data, improves the accuracy and adaptability of data processing, enhances the sensitivity to changes in user behavior status, and makes the prediction of motion status more timely and reliable.
Smart Images

Figure CN119807651A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and in particular to a method for deep mining and analysis of user behavior dynamic data. Background Art
[0002] The patent application with the publication number CN115687429A discloses a method for mining user behavior patterns in social media, including: a user behavior trajectory similarity measurement method integrating spatiotemporal semantics, decomposing the user behavior trajectory similarity into dimensions such as time, space and semantics, distributing and calculating the time similarity, space similarity and semantic similarity of the user trajectory, and weighted integration to obtain the final TGS similarity to balance the multi-dimensional characteristics of the user behavior trajectory. The present invention implements a user behavior trajectory similarity measurement method integrating time, space and semantic elements, performs trajectory clustering based on the spectral clustering method, and clusters users according to the similarity of semantic topics, adjacent spatial locations and the distance of the time stage, so as to find user groups with similar behavior changes.
[0003] However, in user behavior mining, the spatiotemporal semantic similarity measurement method involves the weighted integration of multi-dimensional features of user behavior. During the calculation process, the similarity of each dimension needs to be calculated separately, and then weighted and synthesized on this basis to obtain the final comprehensive similarity. This process increases the complexity of the calculation, especially when a large amount of user data needs to be processed. The computational burden is very heavy, which may greatly reduce the efficiency of the algorithm. In addition, insufficient processing of outliers may affect the calculation of similarity, especially for behavioral data with large fluctuations or extreme values. These abnormal data may cause distortion or inaccuracy of the similarity calculation results. Finally, in weighted integration, the weights of the dimensions need to be set to specific values. Although appropriate weights can be selected through experiments or data analysis, in actual applications, unreasonable weight settings may cause certain dimensions to have too much influence on the final results, thereby affecting the accuracy and reliability of the overall results.
[0004] In view of this, the present invention proposes a method for deep mining and analysis of user behavior dynamic data to solve the above problems. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solution, a method for deep mining and analysis of user behavior dynamic data, comprising:
[0006] S1. Obtain behavioral data and environmental data; behavioral data includes motion data and physiological data;
[0007] S2, preprocessing the behavior data and the environment data to obtain a preprocessed data set;
[0008] S3, based on the preprocessed data set, use the autoencoder to perform fusion and output the comprehensive behavior vector;
[0009] S4. Based on the comprehensive behavior vector, determine the user's current behavior state.
[0010] Furthermore, the exercise data includes exercise intensity data and step frequency data;
[0011] Physiological data include blood pressure data, respiratory rate data, and pressure data;
[0012] Environmental data includes light intensity data, temperature data, humidity data and air quality data.
[0013] Furthermore, the exercise intensity data acquisition method includes:
[0014] Install an acceleration sensor in the smart watch to collect the user's acceleration a at time t in real time. X 、a Y and a Z , and calculate the total acceleration Among them, a X is the acceleration on the X axis, a Y is the acceleration on the Y axis, a Z is the acceleration on the Z axis;
[0015] The formula for calculating the rate of change of total acceleration Δa(t) at time t is: Δa(t) = |a total (t)-a total (t-1)|;
[0016] For the total acceleration and total acceleration change rate, the weighted average method is used to calculate the exercise intensity at time t Qd(t) = w1*a total (t)+w2*Δa(t), where w1 and w2 are the weights of the total acceleration and the total acceleration rate of change, respectively;
[0017] Set the total acceleration change rate threshold θ. When the total acceleration change rate is greater than the threshold θ, adjust w1 by the dynamic weighting method. The formula is: Where α is the adjustment parameter, then w2=1-w1;
[0018] When the threshold value of the acceleration is less than the threshold value θ, w1 = w2 = 0.5.
[0019] Furthermore, the method for acquiring the step frequency data includes:
[0020] The total acceleration data is obtained in real time, and the total acceleration data is visualized. The peak value is monitored in the total acceleration visualization graph, and the step cycle T is calculated by the time difference between two adjacent peak values. step, calculate the cadence based on the step cycle Where 60 means 60 seconds;
[0021] The step cycle is the time interval from the starting point of one step to the starting point of the next step. The calculation formula is: T step =|t peak (q+1)-t peak (q)|, where q represents the peak index, t peak (q) represents the timestamp corresponding to the qth peak, t peak (q+1) represents the timestamp corresponding to the q+1th index.
[0022] Furthermore, the pressure data is obtained by:
[0023] Real-time collection of skin conductance data, heart rate variability data, and skin temperature data;
[0024] The skin conductance data, heart rate variability data, and skin temperature data are normalized to obtain a normalized data set. The local anomaly factor algorithm is used to identify outliers in the normalized data set, and the outliers are removed to obtain a preliminary data set. Based on the preliminary data set, the pressure data is predicted using the trained support vector regression model.
[0025] The specific method of using the trained support vector regression model to predict pressure data includes:
[0026] Training is performed based on historical skin conductance data, heart rate variability data, skin temperature data, and pressure data as training sets;
[0027] Initialize hyperparameters: Select radial basis function as kernel function. The SVR model includes penalty coefficient, epsilon parameter, gamma parameter and other main parameters. The grid search method is used to determine the optimal value of the parameters.
[0028] Calculate the initial loss function: Calculate the initial loss function value of the model As the starting point for optimization, represents regularization, w represents the weight vector of the input feature, b represents the bias term, represents the error term, C is the penalty coefficient, n2 represents the total number of training samples, o represents the sample index, ξ i and represents the slack variable;
[0029] Iterative optimization: Use the gradient descent method to update the model parameters w and b in each iteration, and calculate the new loss function during the update process;
[0030] Check convergence conditions: After each round of iteration, compare the change in the current loss function value with that of the previous round. When the loss change between two adjacent iterations is less than the preset error threshold, the model is considered to have converged and the iteration is stopped.
[0031] The trained support vector regression model is used to predict pressure data on the preliminary dataset.
[0032] Furthermore, the method for obtaining the preprocessed data set includes:
[0033] The merge function is used to obtain a comprehensive data set for behavioral data and environmental data. The local anomaly factor algorithm is used to identify and remove outliers in the comprehensive data set. Min-Max normalization is then performed and the timestamps are unified to obtain the preprocessed data set.
[0034] Furthermore, the specific method of the local anomaly factor algorithm includes:
[0035] Determine the k nearest neighbor values;
[0036] Calculate the k nearest neighbor distance for each sample point:
[0037] A sample point refers to each specific data value in the preprocessed data set; a sample refers to a row of data in the preprocessed data set;
[0038] Calculate the Euclidean distance between sample i and other samples in the preprocessed data set, sort the obtained Euclidean distances in ascending order, select the first k samples as the k nearest neighbors of sample i, and define the Euclidean distance farthest from sample i among the k samples as the k nearest neighbor distance k dist (x i );
[0039] Use the Euclidean distance to calculate the distance between sample i and sample j. The formula is:
[0040]
[0041] Where i and j represent the sample index in the data set, i, j = 1, 2, ..., n, n is the total number of samples, and i ≠ j, x i,qd and x j,qd Respectively represent the exercise intensity data in the i-th sample and the j-th sample, x i,bp and x j,bp Respectively represent the step frequency data in the i-th sample and the j-th sample, x i,zl and x j,zl Represent the air quality data in the i-th sample and the j-th sample respectively;
[0042] The preprocessed data set includes processed exercise intensity data, step frequency data, blood pressure data, respiratory rate data, pressure data, light intensity data, temperature data, humidity data, and air quality data;
[0043] Calculate the reachable distance of each sample point: for sample point i and sample point j, set sample point j to be the k nearest neighbors of sample point i, then compare the Euclidean distance between sample point i and sample point j and the k nearest neighbor distance, and select the largest one as the reachable distance
[0044] r-dist(x i ,x j )=max(k dist (x i ),dist(x i ,x j ), where k dist (x i ) represents the k-nearest neighbor distance between sample point i and sample point j, dist(x i ,x j ) represents the Euclidean distance between sample point i and sample point j; if sample point j does not belong to the k nearest neighbors of sample point i, the Euclidean distance is used to represent the reachable distance;
[0045] Calculate local density: Calculate local density by the reachable distance of sample point i. The formula is: Where N k (x i ) represents the set of k nearest neighbors of sample point i, l rd(x i ) represents the local density of sample point i;
[0046] Calculate the local outlier factor LOF: Calculate the local outlier factor LOF based on the local density of sample point i and the local density of two adjacent sample points, as well as the reachable distance from sample point i to k nearest neighbor points. The formula is:
[0047] Outlier identification and elimination: set an abnormal threshold. If the LOF value of a sample point is greater than or equal to the abnormal threshold, the point is an abnormal point. If the LOF value of a sample point is less than the abnormal threshold, it is a normal point. The detected abnormal points will be eliminated.
[0048] Furthermore, the method of determining the k nearest neighbor value includes:
[0049] Determine the initial range of k nearest neighbor values: Use the random search method to determine the initial range of k nearest neighbor values [k_min, k_max];
[0050] Use the cross-validation method to calculate the evaluation value of each k-nearest neighbor value within the initial range of the k-nearest neighbor value, and randomly divide the comprehensive data set into 10 subsets, each of which contains 10% of the data; for each k-nearest neighbor value within the initial range, perform 10 training and validations, each time selecting a different subset as the validation set, and the other 9 subsets as the training set. In each round of training and validation, record the evaluation value of the current k-nearest neighbor value on the validation set, and then average the evaluation values of 10 rounds as the final evaluation value of the current k-nearest neighbor value;
[0051] Calculate the difference in the final evaluation value of each pair of adjacent k-nearest neighbor values, use a fixed step size to perform refinement between the k-nearest neighbor value pairs with the smallest difference, and then use 10-fold cross-validation to calculate the final evaluation value of the k-nearest neighbor value within each fixed step size, calculate the error of the adjacent k-nearest neighbor values, and stop the refinement when the error is less than the set threshold Yz, use the grid search method to traverse and search the adjacent k-nearest neighbor values to determine the optimal k-nearest neighbor value.
[0052] The method of using the automatic encoder to fuse and output the comprehensive behavior vector includes:
[0053] Step 1: Preprocess the dataset X∈R r*ε As input, X∈R r*ε Indicates that X is a matrix of size r*ε, where each sample point is a real number, r is the total number of samples in the data set, and ε is the number of features;
[0054] Step 2: The encoder converts each original input vector X u ∈R ε Mapped to a low-dimensional vector Z u ∈R d , and d < ε, use linear transformation and activation function f1 to process the mapping step, the formula is: Z u =f1(W e X u +b e ), where u represents the sample index in the preprocessed dataset, u = 1, 2, ..., r, W e represents the weight matrix of the encoder, b e represents the bias term of the encoder, f1 represents the nonlinear activation function, and Z u A low-dimensional latent vector representing the encoder output;
[0055] Step 3: The decoder converts the low-dimensional latent vector Z u ∈R d Restore to reconstructed high-dimensional vector Use linear transformation and activation function f2 to perform the processing and restoration step. The formula is: f1 represents the nonlinear activation function, W d represents the weight matrix of the decoder, b d represents the bias term of the decoder, represents the reconstructed vector output by the decoder;
[0056] Step 4: Compare the error between the reconstructed output and the original input vector, and calculate the loss function. The root mean square error is used as the loss function. The formula is:
[0057] Step 5: Calculate the gradient of the loss function relative to the weights and biases of the encoder and decoder through back propagation; then use the gradient descent method to update the weight matrices and bias terms of the encoder and decoder through the calculated gradients;
[0058] Step 6: Repeat steps 2 to 5 until the value of the loss function converges to the minimum or reaches the preset maximum number of iterations.
[0059] Step 7: After the autoencoder is trained, extract the encoder as a feature extractor; input the preprocessed data set and convert it into a low-dimensional latent vector through the encoder, which is the comprehensive behavior vector.
[0060] Furthermore, the method of judging the current behavior state of the user based on the comprehensive behavior vector includes:
[0061] Based on the comprehensive behavior vector, a weight is set for each feature in the vector, and the comprehensive behavior score is calculated by weighted average method. Where S represents the total number of features in the comprehensive behavior vector, v represents the index in the comprehensive behavior vector, and Qz v represents the weight of the vth feature in the comprehensive behavior vector, XL v represents the value of the vth feature in the comprehensive behavior vector;
[0062] The historical comprehensive behavior vector is used to calculate the average value μ1 and standard deviation σ1 of the comprehensive behavior score to set the behavior state threshold Y z Range: Y z =[μ1-τ*σ1,μ1+τ*σ1], where τ represents the adjustment coefficient;
[0063] Compare the comprehensive behavior score with the set behavior state threshold to determine the user's current behavior state. When the comprehensive behavior score pf is within the behavior state threshold Y z When pf is within the range, it means that the user's current behavior state is normal. When pf<μ1-τ*σ1, it means that the user's current behavior state is abnormal. When pf>μ1+τ*σ1, it means that the user's current behavior state is active.
[0064] The technical effects and advantages of the user behavior dynamic data deep mining and analysis method of the present invention are as follows:
[0065] The present invention can realize efficient fusion and deep mining analysis of user behavior and environmental data, introduces a local anomaly factor algorithm to identify and eliminate outliers, uses a support vector regression model to predict pressure data, and optimizes the accuracy of data results by weight adjustment when obtaining exercise intensity data; applies the autoencoder to the comprehensive processing of multi-dimensional feature data, and extracts the comprehensive behavior vector through deep fusion of multi-source data; calculates the comprehensive behavior score based on the comprehensive behavior vector, and uses the comprehensive behavior score and dynamic threshold to judge the user's current behavior state, thereby realizing dynamic and personalized monitoring and early warning; the method not only improves the accuracy and adaptability of data processing, but also greatly enhances the sensitivity to changes in user behavior state, making the prediction of exercise state more timely and reliable, which is conducive to its wide application in the fields of intelligent health monitoring and behavior management. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A schematic diagram of a method for deep mining and analysis of user behavior dynamic data according to the present invention;
[0067] Figure 2 This is a schematic diagram of a system for deep mining and analysis of user behavior dynamic data according to the present invention. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0069] Example 1
[0070] See also Figure 1 As shown, the method for deep mining and analyzing user behavior dynamic data described in this embodiment includes:
[0071] S1. Obtain behavioral data and environmental data; behavioral data includes motion data and physiological data;
[0072] S2, preprocessing the behavior data and the environment data to obtain a preprocessed data set;
[0073] S3, based on the preprocessed data set, use the autoencoder to perform fusion and output the comprehensive behavior vector;
[0074] S4. Based on the comprehensive behavior vector, determine the user's current behavior state.
[0075] Sports data includes sports intensity data and step frequency data;
[0076] Physiological data include blood pressure data, respiratory rate data, and pressure data;
[0077] Environmental data includes light intensity data, temperature data, humidity data and air quality data.
[0078] Blood pressure data and respiratory rate data are obtained in real time through the smart watch worn by the user; the smart watch obtains real-time data provided by the Internet weather service by connecting to the mobile phone or through built-in Wi-Fi, LTE, etc., so as to obtain real-time temperature data, humidity data and air quality data.
[0079] Ways to obtain exercise intensity data include:
[0080] Install an acceleration sensor in the smart watch to collect the user's acceleration a at time t in real time. X 、a Y and a Z , and calculate the total acceleration Among them, a X is the acceleration on the X axis, a Y is the acceleration on the Y axis, a Z is the acceleration on the Z axis;
[0081] The formula for calculating the rate of change of total acceleration Δa(t) at time t is: Δa(t) = |a total (t)-a total (t-1)|;
[0082] For the total acceleration and total acceleration change rate, the weighted average method is used to calculate the exercise intensity at time t Qd(t) = w1*a total (t)+w2*Δa(t), where w1 and w2 are the weights of the total acceleration and the total acceleration rate of change, respectively;
[0083] Set the total acceleration change rate threshold θ. When the total acceleration change rate is greater than the threshold θ, adjust w1 by the dynamic weighting method. The formula is: Among them, α is the adjustment parameter, then w2=1-w1; the total acceleration change rate threshold is calculated by calculating the mean μ and standard deviation σ of the total acceleration change rate over a period of time, and the formula is: θ=μ+k1*σ, where k1 is the adjustment parameter.
[0084] When the threshold value of the acceleration is less than the threshold value θ, w1 = w2 = 0.5.
[0085] The methods for obtaining cadence data include:
[0086] The total acceleration data is obtained in real time, and the total acceleration data is visualized. The peak value is monitored in the total acceleration visualization graph, and the step cycle T is calculated by the time difference between two adjacent peak values. step , calculate the cadence based on the step cycle Where 60 means 60 seconds;
[0087] The step cycle is the time interval from the starting point of one step to the starting point of the next step. The calculation formula is: T step =|t peak (q+1)-t peak (q)|, where q represents the peak index, t peak (q) represents the timestamp corresponding to the qth peak, t peak (q+1) represents the timestamp corresponding to the q+1th index;
[0088] In the visualization graph of the total acceleration data, each start or end of a step will cause a peak. Therefore, by detecting consecutive peaks in the total acceleration, the step cycle of adjacent steps can be calculated, and thus the step frequency can be calculated.
[0089] The methods for obtaining pressure data include:
[0090] Real-time collection of skin conductance data, heart rate variability data, and skin temperature data;
[0091] The skin conductance data, heart rate variability data, and skin temperature data are normalized to obtain a normalized data set. The local anomaly factor algorithm is used to identify outliers in the normalized data set, and the outliers are removed to obtain a preliminary data set. Based on the preliminary data set, the pressure data is predicted using the trained support vector regression model.
[0092] The specific methods of using the trained support vector regression model to predict pressure data include:
[0093] Training is performed based on historical skin conductance data, heart rate variability data, skin temperature data, and pressure data as training sets;
[0094] Initialize hyperparameters: Select radial basis function as kernel function. The SVR model includes penalty coefficient, epsilon parameter, gamma parameter and other main parameters. The grid search method is used to determine the optimal value of the parameters.
[0095] Calculate the initial loss function: Calculate the initial loss function value of the model As the starting point for optimization, represents regularization, w represents the weight vector of the input feature, b represents the bias term, represents the error term, C is the penalty coefficient, n2 represents the total number of training samples, o represents the sample index, ξ i and represents the slack variable;
[0096] Iterative optimization: Use the gradient descent method to update the model parameters w and b in each iteration, and calculate the new loss function during the update process;
[0097] Check convergence conditions: After each round of iteration, compare the change in the current loss function value with that of the previous round. When the loss change between two adjacent iterations is less than the preset error threshold, the model is considered to have converged and the iteration is stopped.
[0098] The trained support vector regression model is used to predict pressure data on the preliminary dataset.
[0099] The methods for obtaining the preprocessed data set include:
[0100] The merge function is used to obtain a comprehensive data set for behavioral data and environmental data. The local anomaly factor algorithm is used to identify and remove outliers in the comprehensive data set. Min-Max normalization is then performed and the timestamps are unified to obtain the preprocessed data set.
[0101] The specific methods of the local anomaly factor algorithm include:
[0102] Determine the k nearest neighbor values;
[0103] Calculate the k nearest neighbor distance for each sample point:
[0104] A sample point refers to each specific data value in the preprocessed data set; a sample refers to a row of data in the preprocessed data set;
[0105] Calculate the Euclidean distance between sample i and other samples in the preprocessed data set, sort the obtained Euclidean distances in ascending order, select the first k samples as the k nearest neighbors of sample i, and define the Euclidean distance farthest from sample i among the k samples as the k nearest neighbor distance k dist (x i );
[0106] Use the Euclidean distance to calculate the distance between sample i and sample j. The formula is:
[0107]
[0108] Where i and j represent the sample index in the data set, i, j = 1, 2, ..., n, n is the total number of samples, and i ≠ j, x i,qd and x j,qd Respectively represent the exercise intensity data in the i-th sample and the j-th sample, xi,bp and x j,bp Respectively represent the step frequency data in the i-th sample and the j-th sample, x i,zl and x j,zl Represent the air quality data in the i-th sample and the j-th sample respectively;
[0109] The preprocessed data set includes processed exercise intensity data, step frequency data, blood pressure data, respiratory rate data, pressure data, light intensity data, temperature data, humidity data, and air quality data;
[0110] Calculate the reachable distance of each sample point: for sample point i and sample point j, set sample point j to be the k nearest neighbors of sample point i, then compare the Euclidean distance between sample point i and sample point j and the k nearest neighbor distance, and select the largest one as the reachable distance
[0111] r-dist(x i ,x j )=max(k dist (x i ),dist(x i ,x j ), where k dist (x i ) represents the k-nearest neighbor distance between sample point i and sample point j, dist(x i ,x j ) represents the Euclidean distance between sample point i and sample point j; if sample point j does not belong to the k nearest neighbors of sample point i, the Euclidean distance is used to represent the reachable distance;
[0112] Calculate local density: Calculate local density by the reachable distance of sample point i. The formula is: Where N k (x i ) represents the set of k nearest neighbors of sample point i, l rd(x i ) represents the local density of sample point i;
[0113] Calculate the local outlier factor LOF: Calculate the local outlier factor LOF based on the local density of sample point i and the local density of two adjacent sample points, as well as the reachable distance from sample point i to k nearest neighbor points. The formula is:
[0114] Outlier identification and elimination: set an abnormal threshold. If the LOF value of a sample point is greater than or equal to the abnormal threshold, the point is an abnormal point. If the LOF value of a sample point is less than the abnormal threshold, it is a normal point. The detected abnormal points will be eliminated.
[0115] Methods for determining k nearest neighbor values include:
[0116] Determine the initial range of k nearest neighbor values: Use the random search method to determine the initial range of k nearest neighbor values [k_min, k_max];
[0117] Use the cross-validation method to calculate the evaluation value of each k-nearest neighbor value within the initial range of the k-nearest neighbor value, and randomly divide the comprehensive data set into 10 subsets, each of which contains 10% of the data; for each k-nearest neighbor value within the initial range, perform 10 training and validations, each time selecting a different subset as the validation set, and the other 9 subsets as the training set. In each round of training and validation, record the evaluation value of the current k-nearest neighbor value on the validation set, and then average the evaluation values of 10 rounds as the final evaluation value of the current k-nearest neighbor value;
[0118] Calculate the difference in the final evaluation value of each pair of adjacent k-nearest neighbor values, use a fixed step size to perform refinement between the k-nearest neighbor value pairs with the smallest difference, and then use 10-fold cross-validation to calculate the final evaluation value of the k-nearest neighbor value within each fixed step size, calculate the error of the adjacent k-nearest neighbor values, and stop the refinement when the error is less than the set threshold Yz, use the grid search method to traverse and search the adjacent k-nearest neighbor values to determine the optimal k-nearest neighbor value.
[0119] The methods of using autoencoders for fusion and outputting comprehensive behavior vectors include:
[0120] Step 1: Preprocess the dataset X∈R r*ε As input, X∈R r*ε Indicates that X is a matrix of size r*ε, where each sample point is a real number, r is the total number of samples in the data set, and ε is the number of features;
[0121] Step 2: The encoder converts each original input vector X u ∈R ε Mapped to a low-dimensional vector Z u ∈R d , and d < ε, use linear transformation and activation function f1 to process the mapping step, the formula is: Z u =f1(W e X u +b e ), where u represents the sample index in the preprocessed dataset, u = 1, 2, ..., r, W e represents the weight matrix of the encoder, b e represents the bias term of the encoder, f1 represents the nonlinear activation function, and Z u A low-dimensional latent vector representing the encoder output;
[0122] Step 3: The decoder converts the low-dimensional latent vector Z u ∈R dRestore to reconstructed high-dimensional vector Use linear transformation and activation function f2 to perform the processing and restoration step. The formula is: f1 represents the nonlinear activation function, W d represents the weight matrix of the decoder, b d represents the bias term of the decoder, represents the reconstructed vector output by the decoder;
[0123] Step 4: Compare the error between the reconstructed output and the original input vector, and calculate the loss function. The root mean square error is used as the loss function. The formula is:
[0124] Step 5: Calculate the gradient of the loss function relative to the weights and biases of the encoder and decoder through back propagation; then use the gradient descent method to update the weight matrices and bias terms of the encoder and decoder through the calculated gradients;
[0125] The weight matrix and bias gradient of the encoder are: The weight matrix and bias gradient of the decoder are The gradient represents the rate of change of the loss function with respect to these parameters, helping to adjust the parameters to reduce the loss.
[0126] The encoder weight matrix and bias terms are updated as: Among them, η represents the learning rate;
[0127] The decoder weight matrix and bias terms are updated as:
[0128] The learning rate is a hyperparameter that determines the size of the step each time the parameters are updated, that is, the adjustment amplitude of the model weights and biases at each iteration. A fixed learning rate can be set based on experience, ranging from 0.001 to 0.1;
[0129] Step 6: Repeat steps 2 to 5 until the value of the loss function converges to the minimum or reaches the preset maximum number of iterations.
[0130] Step 7: After the autoencoder is trained, extract the encoder as a feature extractor; input the preprocessed data set and convert it into a low-dimensional latent vector through the encoder, which is the comprehensive behavior vector.
[0131] Based on the comprehensive behavior vector, the methods for judging the user's current behavior state include:
[0132] Based on the comprehensive behavior vector, a weight is set for each feature in the vector, and the comprehensive behavior score is calculated by weighted average method. Where S represents the total number of features in the comprehensive behavior vector, v represents the index in the comprehensive behavior vector, and Qz v represents the weight of the vth feature in the comprehensive behavior vector, XL v represents the value of the vth feature in the comprehensive behavior vector;
[0133] Among them, the feature weight is set using the entropy weight method, which reflects the contribution of each feature to the overall information volume of the data by calculating the information entropy of each feature; the lower the information entropy, the more concentrated the distribution of the feature, the less information, and the relatively lower the importance; the higher the information entropy, the more dispersed the distribution of the feature, the more information, and the higher the importance; therefore, the entropy weight method can effectively identify which features provide more information and are more discriminative;
[0134] The historical comprehensive behavior vector is used to calculate the average value μ1 and standard deviation σ1 of the comprehensive behavior score to set the behavior state threshold Y z Range: Y z =[μ1-τ*σ1,μ1+τ*σ1], where τ represents the adjustment coefficient;
[0135] Compare the comprehensive behavior score with the set behavior state threshold to determine the user's current behavior state. When the comprehensive behavior score pf is within the behavior state threshold Y z When pf is within the range, it means that the user's current behavior state is normal. When pf<μ1-τ*σ1, it means that the user's current behavior state is abnormal. When pf>μ1+τ*σ1, it means that the user's current behavior state is active.
[0136] This implementation case can achieve efficient fusion and deep mining analysis of user behavior and environmental data, introduce a local anomaly factor algorithm to identify and eliminate outliers, use a support vector regression model to predict pressure data, and optimize the accuracy of data results by weight adjustment when obtaining exercise intensity data, and obtain cadence data through acceleration; apply the autoencoder to the comprehensive processing of multi-dimensional feature data, and extract the comprehensive behavior vector through deep fusion of multi-source data; calculate the comprehensive behavior score based on the comprehensive behavior vector, and use the comprehensive behavior score and dynamic threshold to judge the user's current behavior state, realizing dynamic and personalized monitoring and early warning; this method not only improves the accuracy and adaptability of data processing, but also greatly enhances the sensitivity to changes in user behavior state, making the prediction of exercise state more timely and reliable, which is conducive to its wide application in the fields of intelligent health monitoring and behavior management.
[0137] Example 2
[0138] See also Figure 2As shown, the part not described in detail in this embodiment is described in Example 1, which provides a user behavior dynamic data deep mining and analysis system, including:
[0139] Data acquisition module: acquires behavioral data and environmental data; behavioral data includes motion data and physiological data;
[0140] Data preprocessing module: preprocess the behavior data and environment data to obtain the preprocessed data set;
[0141] Data fusion module: Based on the preprocessed data set, the autoencoder is used for fusion and the comprehensive behavior vector is output;
[0142] Data mining module: Determine the user's current behavior status based on the comprehensive behavior vector.
[0143] Example 3
[0144] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the operation mode of the above-mentioned method for deep mining and analysis of dynamic user behavior data is implemented.
[0145] Since the electronic device introduced in this embodiment is an electronic device used to implement a method for deep mining and analysis of user behavior dynamic data in the embodiment of this application, based on the method for deep mining and analysis of user behavior dynamic data introduced in the embodiment of this application, a person skilled in the art can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not described in detail here. As long as a person skilled in the art implements the electronic device used in the method for deep mining and analysis of user behavior dynamic data in the embodiment of this application, it belongs to the scope of protection of this application.
[0146] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0147] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical users in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for deep mining and analysis of user behavior dynamic data, which is characterized by: The method for deep mining and analysis of user behavior dynamic data comprises: S1, acquiring behavior data and environmental data; the behavior data comprises motion data and physiological data; S2, preprocessing the behavior data and the environment data to obtain a preprocessed data set; S3, based on the preprocessed data set, use the autoencoder to perform fusion and output the comprehensive behavior vector; S4. Based on the comprehensive behavior vector, determine the user's current behavior state.
2. A user behavior dynamic data deep mining and analysis method according to claim 1, characterized in that: The exercise data includes exercise intensity data and step frequency data; Physiological data include blood pressure data, respiratory rate data, and pressure data; Environmental data includes light intensity data, temperature data, humidity data and air quality data.
3. A user behavior dynamic data deep mining and analysis method according to claim 2, characterized in that: The exercise intensity data acquisition method includes: Install an acceleration sensor in the smart watch to collect the user's acceleration a at time t in real time. X 、a Y and a Z , and calculate the total acceleration Among them, a X is the acceleration on the X axis, a Y is the acceleration on the Y axis, a Z is the acceleration on the Z axis; The formula for calculating the rate of change of total acceleration Δa(t) at time t is: Δa(t) = |a total (t)-a total (t-1)|; For the total acceleration and total acceleration change rate, the weighted average method is used to calculate the exercise intensity at time t Qd(t) = w1*a total (t)+w2*Δa(t), where w1 and w2 are the weights of the total acceleration and the total acceleration rate of change, respectively; Set the total acceleration change rate threshold θ. When the total acceleration change rate is greater than the threshold θ, adjust w1 by the dynamic weighting method. The formula is: Where α is the adjustment parameter, then w2=1-w1; When the threshold value of the acceleration is less than the threshold value θ, w1 = w2 = 0.
5.
4. A user behavior dynamic data deep mining and analysis method according to claim 3, characterized in that: The method for obtaining the step frequency data includes: The total acceleration data is obtained in real time, and the total acceleration data is visualized. The peak value is monitored in the total acceleration visualization graph, and the step cycle T is calculated by the time difference between two adjacent peak values. step , calculate the cadence based on the step cycle Where 60 means 60 seconds; The step cycle is the time interval from the starting point of one step to the starting point of the next step. The calculation formula is: T step =|t peak (q+1)-t peak (q)|, where q represents the peak index, t peak (q) represents the timestamp corresponding to the qth peak, t peak (q+1) represents the timestamp corresponding to the q+1th index.
5. A user behavior dynamic data deep mining and analysis method according to claim 4, characterized in that: The method for obtaining the pressure data includes: Real-time collection of skin conductance data, heart rate variability data, and skin temperature data; The skin conductance data, heart rate variability data, and skin temperature data are normalized to obtain a normalized data set. The local anomaly factor algorithm is used to identify outliers in the normalized data set and remove the outliers to obtain a preliminary data set. Based on the preliminary data set, the trained support vector regression model is used to predict the pressure data. The specific method of using the trained support vector regression model to predict pressure data includes: Training is performed based on historical skin conductance data, heart rate variability data, skin temperature data, and pressure data as training sets; Initialize hyperparameters: Select radial basis function as kernel function. The SVR model includes penalty coefficient, epsilon parameter, and gamma parameter. The optimal value of the parameter is determined by grid search method. Calculate the initial loss function: Calculate the initial loss function value of the model As the starting point for optimization, represents regularization, w represents the weight vector of the input feature, b represents the bias term, represents the error term, C is the penalty coefficient, n2 represents the total number of training samples, o represents the sample index, ξ i and represents the slack variable; Iterative optimization: Use the gradient descent method to update the model parameters w and b in each iteration, and calculate the new loss function during the update process; Check convergence conditions: After each round of iteration, compare the change in the current loss function value with that of the previous round. When the loss change between two adjacent iterations is less than the preset error threshold, the model is considered to have converged and the iteration is stopped. The trained support vector regression model is used to predict pressure data on the preliminary dataset.
6. A user behavior dynamic data deep mining and analysis method according to claim 5, characterized in that: The method for obtaining the preprocessed data set includes: The merge function is used to obtain a comprehensive data set for behavioral data and environmental data. The local anomaly factor algorithm is used to identify and remove outliers in the comprehensive data set. Min-Max normalization is then performed and the timestamps are unified to obtain the preprocessed data set.
7. A user behavior dynamic data deep mining and analysis method according to claim 6, characterized in that: The specific method of the local anomaly factor algorithm includes: Determine the k nearest neighbor values; Calculate the k nearest neighbor distance for each sample point: A sample point refers to each specific data value in the preprocessed data set; a sample refers to a row of data in the preprocessed data set; Calculate the Euclidean distance between sample i and other samples in the preprocessed data set, sort the obtained Euclidean distances in ascending order, select the first k samples as the k nearest neighbors of sample i, and define the Euclidean distance farthest from sample i among the k samples as the k nearest neighbor distance k dist (x i ); Use the Euclidean distance to calculate the distance between sample i and sample j. The formula is: Where i and j represent the sample index in the data set, i, j = 1, 2, ..., n, n is the total number of samples, and i ≠ j, x i,qd and x j,qd Respectively represent the exercise intensity data in the i-th sample and the j-th sample, x i,bp and x j,bp Respectively represent the step frequency data in the i-th sample and the j-th sample, x i,zl and x j,zl Represent the air quality data in the i-th sample and the j-th sample respectively; The preprocessed data set includes processed exercise intensity data, step frequency data, blood pressure data, respiratory rate data, pressure data, light intensity data, temperature data, humidity data, and air quality data; Calculate the reachable distance of each sample point: for sample point i and sample point j, set sample point j to be the k nearest neighbors of sample point i, then compare the Euclidean distance between sample point i and sample point j and the k nearest neighbor distance, and select the largest one as the reachable distance r-dist(x i ,x j )=max(k dist (x i ),dist(x i ,x j ), where k dist (x i ) represents the k-nearest neighbor distance between sample point i and sample point j, dist(x i ,x j ) represents the Euclidean distance between sample point i and sample point j; if sample point j does not belong to the k nearest neighbors of sample point i, the Euclidean distance is used to represent the reachable distance; Calculate local density: Calculate local density by the reachable distance of sample point i. The formula is: Where N k (x i ) represents the set of k nearest neighbors of sample point i, lrd(x i ) represents the local density of sample point i; Calculate the local outlier factor LOF: Calculate the local outlier factor LOF based on the local density of sample point i and the local density of two adjacent sample points, as well as the reachable distance from sample point i to k nearest neighbor points. The formula is: Outlier identification and elimination: set an abnormal threshold. If the LOF value of a sample point is greater than or equal to the abnormal threshold, the point is an abnormal point. If the LOF value of a sample point is less than the abnormal threshold, it is a normal point. The detected abnormal points will be eliminated.
8. A user behavior dynamic data deep mining and analysis method according to claim 7, characterized in that: The method of determining the k nearest neighbor value includes: Determine the initial range of k nearest neighbor values: Use the random search method to determine the initial range of k nearest neighbor values [k_min, k_max]; Use the cross-validation method to calculate the evaluation value of each k-nearest neighbor value within the initial range of the k-nearest neighbor value, and randomly divide the comprehensive data set into 10 subsets, each of which contains 10% of the data; for each k-nearest neighbor value within the initial range, perform 10 training and validations, each time selecting a different subset as the validation set, and the other 9 subsets as the training set. In each round of training and validation, record the evaluation value of the current k-nearest neighbor value on the validation set, and then average the evaluation values of 10 rounds as the final evaluation value of the current k-nearest neighbor value; Calculate the difference in the final evaluation value of each pair of adjacent k-nearest neighbor values, use a fixed step size to perform refinement between the k-nearest neighbor value pairs with the smallest difference, and then use 10-fold cross-validation to calculate the final evaluation value of the k-nearest neighbor value within each fixed step size, calculate the error of the adjacent k-nearest neighbor values, and stop the refinement when the error is less than the set threshold Yz, use the grid search method to traverse and search the adjacent k-nearest neighbor values to determine the optimal k-nearest neighbor value.
9. A user behavior dynamic data deep mining and analysis method according to claim 8, characterized in that: The method of using the automatic encoder to fuse and output the comprehensive behavior vector includes: Step 1: Preprocess the dataset X∈R r*ε As input, X∈R r*ε Indicates that X is a matrix of size r*ε, where each sample point is a real number, r is the total number of samples in the data set, and ε is the number of features; Step 2: The encoder converts each original input vector X u ∈R ε Mapped to a low-dimensional vector Z u ∈R d , and d < ε, use linear transformation and activation function f1 to process the mapping step, the formula is: Z u =f1(W e X u +b e ), where u represents the sample index in the preprocessed dataset, u = 1, 2, ..., r, W e represents the weight matrix of the encoder, b e represents the bias term of the encoder, f1 represents the nonlinear activation function, and Z u A low-dimensional latent vector representing the encoder output; Step 3: The decoder converts the low-dimensional latent vector Z u ∈R d Restore to reconstructed high-dimensional vector Use linear transformation and activation function f2 to perform the processing and restoration step. The formula is: f1 represents the nonlinear activation function, W d represents the weight matrix of the decoder, b d represents the bias term of the decoder, represents the reconstructed vector output by the decoder; Step 4: Compare the error between the reconstructed output and the original input vector, and calculate the loss function. The root mean square error is used as the loss function. The formula is: Step 5: Calculate the gradient of the loss function relative to the weights and biases of the encoder and decoder through back propagation; then use the gradient descent method to update the weight matrices and bias terms of the encoder and decoder through the calculated gradients; Step 6: Repeat steps 2 to 5 until the loss function converges to a minimum or reaches a preset maximum number of iterations; Step 7: After the autoencoder is trained, extract the encoder as a feature extractor; input the preprocessed data set and convert it into a low-dimensional latent vector through the encoder, which is the comprehensive behavior vector.
10. A user behavior dynamic data deep mining and analysis method according to claim 9, characterized in that: The method of judging the current behavior state of the user based on the comprehensive behavior vector includes: Based on the comprehensive behavior vector, a weight is set for each feature in the vector, and the comprehensive behavior score is calculated by weighted average method. Where S represents the total number of features in the comprehensive behavior vector, v represents the index in the comprehensive behavior vector, and Qz v represents the weight of the vth feature in the comprehensive behavior vector, XL v represents the value of the vth feature in the comprehensive behavior vector; The historical comprehensive behavior vector is used to calculate the average value μ1 and standard deviation σ1 of the comprehensive behavior score to set the behavior state threshold Y z Range: Y z =[μ1-τ*σ1,μ1+τ*σ1], where τ represents the adjustment coefficient; Compare the comprehensive behavior score with the set behavior state threshold to determine the user's current behavior state. When the comprehensive behavior score pf is within the behavior state threshold Y z When pf is within the range, it means that the user's current behavior state is normal. When pf<μ1-τ*σ1, it means that the user's current behavior state is abnormal. When pf>μ1+τ*σ1, it means that the user's current behavior state is active.
Citation Information
Patent Citations
Social media user behavior pattern mining method
CN115687429A
Continuous dynamic movement and physiological data processing and analyzing system and method
CN107785076A
Behavior trajectory data mining method and system based on UCT
CN111797292A
Sleep rhythm quantification and intervention method, system and device
CN115862873A
Sensor integrated nursing system of Internet of Things
CN117197998A
Cited By
Service management system based on CSTS
CN120525573A