A user behavior dynamic data deep mining analysis method
By fusing multi-dimensional feature data through an autoencoder and combining it with the local anomaly factor algorithm and support vector regression model, the problems of computational complexity and outlier processing in user behavior mining are solved, and efficient and accurate user behavior status monitoring and early warning are achieved.
Patent Information
- Application Number
- CN202411855429.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-16
AI Technical Summary
Existing technologies have high computational complexity and heavy computational burden in user behavior mining, and insufficient outlier processing, which leads to distorted or inaccurate similarity calculation results. Unreasonable weight setting affects the accuracy and reliability of the results.
By acquiring motion data, physiological data, and environmental data, and fusing them using autoencoders, and combining them with local anomaly factor algorithms to identify and eliminate outliers, the support vector regression model is used to predict stress data, and the comprehensive behavioral score is calculated using the weighted average method. The weights are dynamically adjusted to achieve in-depth mining and fusion of multi-dimensional feature data.
It improves the accuracy and adaptability of data processing, enhances the sensitivity to changes in user behavior status, realizes dynamic and personalized monitoring and early warning, and is suitable for intelligent health monitoring and behavior management.
Smart Images

Figure CN119807651B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data mining, in particular to a user behavior dynamic data deep mining analysis method. BACKGROUND
[0002] The patent with the application publication number CN115687429A discloses a social media user behavior pattern mining method, which comprises: a user behavior trajectory similarity measurement method integrating time-space semantics, which decomposes the user behavior trajectory similarity into time, space and semantic dimensions, and distributes the time similarity, space similarity and semantic similarity of the user trajectory to obtain the final TGS similarity by weighted integration, so as to balance the multi-dimensional features of the user behavior trajectory. The present application realizes a user behavior trajectory similarity measurement method integrating time, space and semantic elements, performs trajectory clustering based on a spectral clustering method, and clusters according to the similarity of semantic topics between users, the proximity of spatial positions and the proximity of time stages, and finds out user groups with similar behavior changes.
[0003] However, in user behavior mining, the time-space semantic similarity measurement method involves weighting integration of multi-dimensional features of user behavior. In the calculation process, the similarity of each dimension needs to be calculated respectively, and the final comprehensive similarity is obtained by weighted synthesis on this basis. This process increases the complexity of calculation, especially when a large amount of user data needs to be processed, the calculation burden is very heavy, which may greatly reduce the efficiency of the algorithm. In addition, insufficient processing of abnormal values may affect the calculation of similarity, especially for behavior data with large fluctuations or extreme values. These abnormal data may cause distortion or inaccuracy of the similarity calculation result. Finally, in the weighted integration, the weight of the dimension needs to be set to a specific value. Although the appropriate weight can be selected through experiments or data analysis, in actual application, unreasonable weight setting may cause some dimensions to have too great an impact on the final result, thereby affecting the accuracy and reliability of the overall result.
[0004] In view of this, the present application provides a user behavior dynamic data deep mining analysis method to solve the above problems. SUMMARY
[0005] In order to overcome the above-mentioned defects of the prior art, in order to achieve the above-mentioned purpose, the present application provides the following technical scheme, a user behavior dynamic data deep mining analysis method, comprising:
[0006] S1, acquiring behavior data and environment data; the behavior data comprises 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 pre-processed data set, using an auto-encoder for fusion, outputting a comprehensive behavior vector;
[0009] S4, based on the comprehensive behavior vector, determining the current behavior state of the user.
[0010] Further, the motion data includes motion intensity data and step frequency data;
[0011] The physiological data includes blood pressure data, respiratory rate data, and stress data;
[0012] The environmental data includes illumination intensity data, temperature data, humidity data, and air quality data.
[0013] Further, the motion intensity data acquisition method includes:
[0014] An acceleration sensor is installed in the smart watch, and the acceleration a X , a Y , and a Z of the user at time t is collected in real time Wherein, a X is the acceleration on the X axis, a Y is the acceleration on the Y axis, and a Z is the acceleration on the Z axis;
[0015] The formula for calculating the change rate Δa(t) of the total acceleration at time t is: Δa(t) = |a total (t) - a total (t-1)|
[0016] For the total acceleration and the total acceleration change rate, the motion intensity Qd(t) at time t is calculated using the weighted average method: Qd(t) = w1*a total (t) + w2*Δa(t), wherein w1 and w2 are the weights of the total acceleration and the total acceleration change rate, respectively;
[0017] Set the total acceleration change rate threshold θ, when the total acceleration change rate is greater than the threshold θ, adjust w1 by dynamic weighting method, the formula is: Wherein, α is the adjustment parameter, then w2 = 1-w1;
[0018] When the acceleration threshold is less than the threshold θ, then w1 = w2 = 0.5.
[0019] Further, the step frequency data acquisition method includes:
[0020] The total acceleration data is visualized by real-time acquisition of the total acceleration data, the peak value is monitored in the total acceleration visualization diagram, and the step cycle T step, calculate the step frequency according to the step cycle where 60 is 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, and 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, and t peak (q+1) represents the timestamp corresponding to the q+1th index.
[0022] Further, the pressure data acquisition method comprises:
[0023] Real-time acquisition 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 outlier 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, a trained support vector regression model is used to predict the pressure data;
[0025] The specific way of predicting the pressure data by using the trained support vector regression model comprises:
[0026] Based on historical skin conductance data, heart rate variability data, skin temperature data, and pressure data as a training set for training;
[0027] Initialize hyperparameters: select a radial basis function as a kernel function, and the SVR model includes penalty coefficient, epsilon parameter, and gamma parameter main parameters, and the best value of the parameters is determined by grid search method;
[0028] Calculate the initial loss function: calculate the initial loss function value of the model as the starting point of optimization, wherein, represents regularization, w represents the weight vector of input features, and 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, and i and represent the slack variable;
[0029] Iterative optimization: in each iteration process, the gradient descent method is used to update the model parameters w and b, and the new loss function is calculated in the updating process;
[0030] Check the convergence condition: after each iteration, compare the current loss function value with the change of the last round, when the loss change between adjacent two iterations is less than the preset error threshold, consider that the model has converged, stop iteration;
[0031] Using the trained support vector regression model to predict stress data on the preliminary data set.
[0032] Further, the acquisition method of the preprocessed data set comprises:
[0033] The behavior data and the environment data are used to obtain a comprehensive data set using a merge function, the local outlier factor algorithm is used to identify and eliminate outliers in the comprehensive data set, Min-Max normalization processing is performed, and a unified timestamp is obtained to obtain the preprocessed data set.
[0034] Further, the specific method of the local outlier factor algorithm comprises:
[0035] Determine the k-nearest neighbor value;
[0036] Calculate the k-nearest neighbor distance of each sample point:
[0037] The sample point refers to each specific data value in the preprocessed data set; the sample refers to a row of data in the preprocessed data set;
[0038] Calculate the Euclidean distance between the i sample and other samples in the preprocessed data set, arrange the obtained Euclidean distances in ascending order, select the first k samples as the k nearest neighbors of the i sample, and define the Euclidean distance farthest from the i sample in the k samples as the k-nearest neighbor distance k dist (x i );
[0039] Use the Euclidean distance to calculate the distance between the i sample and the j sample, and 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 represent the motion intensity data in the i-th sample and the j-th sample, x i,bp and x j,bp 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;
[0042] The preprocessed data set includes processed exercise intensity data, cadence 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 and k nearest neighbor distance between sample point i and sample point j, 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; assuming that 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: The local outlier factor LOF is calculated based on the local density of sample point i and the local densities of the two adjacent sample points, as well as the reachable distance from sample point i to the 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 k-nearest neighbor values. Randomly divide the comprehensive data set into 10 subsets, each containing 10% of the data. For each k-nearest neighbor value within the initial range, perform 10 training and validation cycles, 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 the 10 cycles 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 the adjacent k-nearest neighbor values to determine the optimal k-nearest neighbor value.
[0052] The method of using the autoencoder 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 dataset, 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, 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: f1represents a nonlinear activation function, W d represents a weight matrix of the decoder, b d represents a bias term of the decoder, represents a reconstruction vector of the decoder output;
[0056] Step four, compare the error between the reconstruction output and the original input vector, and calculate the loss function, using the root mean square error as the loss function, the formula is:
[0057] Step five, calculate the gradient of the loss function with respect to the weights and biases of the encoder and decoder by backpropagation; then use the gradient descent method to update the weight matrix and bias term of the encoder and decoder by calculating the gradient;
[0058] Step six, repeat steps two to five until the value of the loss function converges to a minimum or reaches a preset maximum number of iterations.
[0059] Step seven, after the autoencoder training is completed, extract the encoder as a feature extractor; input the preprocessed data set, and convert it to a low-dimensional latent vector through the encoder, which is the comprehensive behavior vector.
[0060] Further, the manner of judging the current behavior state of the user based on the comprehensive behavior vector comprises:
[0061] Based on the comprehensive behavior vector, set a weight for each feature in the vector, and calculate the comprehensive behavior score 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, 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 average value μ1 and the standard deviation σ1 of the comprehensive behavior score calculated by the historical comprehensive behavior vector are used 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 judge the current behavior state of the user. When the comprehensive behavior score pf is within the behavior state threshold Y z , it indicates that the current behavior state of the user is normal, when pf<μ1-τ*σ1, it indicates that the current behavior state of the user is abnormal, and when pf>μ1+τ*σ1, it indicates that the current behavior state of the user is active.
[0064] The technical effects and advantages of the user behavior dynamic data deep mining analysis method of the present application are as follows:
[0065] The present application 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 stress data, and optimizes the accuracy of data results through weight adjustment when obtaining motion intensity data; applies an autoencoder to the comprehensive processing of multidimensional feature data, extracts a comprehensive behavior vector through deep fusion of multiple source data; calculates a comprehensive behavior score based on the comprehensive behavior vector, uses the comprehensive behavior score and a dynamic threshold to judge the current behavior state of the user, and realizes 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 the user's behavior state, making the prediction of the motion state more timely and reliable, and is helpful for wide application in the field of intelligent health monitoring and behavior management. BRIEF DESCRIPTION OF DRAWINGS
[0066] Figure 1 A user behavior dynamic data deep mining analysis method of the present application is shown in the figure;
[0067] Figure 2 A user behavior dynamic data deep mining analysis system of the present application is shown in the figure. DETAILED DESCRIPTION
[0068] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0069] Embodiment 1
[0070] Please refer to Figure 1 The user behavior dynamic data deep mining analysis method described in the present embodiment includes:
[0071] S1, obtaining behavior data and environmental data; the behavior data includes motion data and physiological data;
[0072] S2, preprocessing the behavior data and environmental data to obtain a preprocessed data set;
[0073] S3, based on the preprocessed data set, using an autoencoder for fusion to output a comprehensive behavior vector;
[0074] S4, judging the current behavior state of the user based on the comprehensive behavior vector.
[0075] The motion data includes motion intensity data and step frequency data;
[0076] The physiological data includes blood pressure data, respiratory rate data and stress data;
[0077] The environmental data includes illumination intensity data, temperature data, humidity data and air quality data.
[0078] The blood pressure data and the respiratory rate data are acquired in real time by a smart watch worn by the user; the smart watch acquires real-time data provided by an internet weather service through connection with a mobile phone or through built-in Wi-Fi, LTE, etc., so as to obtain the temperature data, the humidity data and the air quality data in real time.
[0079] The motion intensity data is acquired in the following manner:
[0080] An acceleration sensor is installed in the smart watch to collect the accelerations a X , a Y and a Z of the user at time t in real time, and to calculate the total acceleration wherein a X is the acceleration on the X axis, a Y is the acceleration on the Y axis, and a Z is the acceleration on the Z axis.
[0081] The change rate Δa(t) of the total acceleration at time t is calculated according to the formula: Δa(t) = |a total (t) - a total (t-1) |.
[0082] The motion intensity Qd(t) at time t is calculated using a weighted average method with respect to the total acceleration and the change rate of the total acceleration, i.e., Qd(t) = w1*a total (t) + w2*Δa(t), wherein w1 and w2 are the weights of the total acceleration and the change rate of the total acceleration, respectively.
[0083] A threshold θ of the change rate of the total acceleration is set, and when the change rate of the total acceleration is greater than the threshold θ, the weight w1 is adjusted by a dynamic weighting method according to the formula: wherein α is an adjustment parameter, and w2 = 1 - w1; wherein the threshold θ of the change rate of the total acceleration is calculated by calculating the mean μ and the standard deviation σ of the change rate of the total acceleration over a period of time, i.e., θ = μ + k1*σ, wherein k1 is an adjustment parameter.
[0084] When the acceleration is less than the threshold θ, then w1 = w2 = 0.5.
[0085] The step frequency data is acquired in the following manner:
[0086] The total acceleration data is visualized by real-time acquisition, peaks are monitored in the total acceleration visualization diagram, and the step cycle T is calculated by the time difference between two adjacent peaks step , and the step frequency is calculated according to the step cycle , wherein 60 is 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, and the calculation formula is: T step = |t peak (q+1)-t peak (q) |, wherein q represents the peak index, t peak (q) represents the timestamp corresponding to the qth peak, and t peak (q+1) represents the timestamp corresponding to the q+1th index;
[0088] On the visualization diagram of the total acceleration data, each starting or landing of the step will cause a peak, so by detecting the consecutive peaks in the total acceleration, the step cycle of adjacent steps can be calculated, and the step frequency can be calculated.
[0089] The acquisition method of the pressure data includes:
[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 outlier 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, a trained support vector regression model is used to predict the pressure data;
[0092] The specific method of predicting the pressure data using the trained support vector regression model includes:
[0093] Based on historical skin conductance data, heart rate variability data, skin temperature data, and pressure data as a training set for training;
[0094] Initialize hyperparameters: select a radial basis function as a kernel function, the SVR model includes penalty coefficient, epsilon parameter, and gamma parameter main parameters, and the best value of the parameters is determined by a grid search method;
[0095] Calculate the initial loss function: calculate the initial loss function value of the model as the starting point of optimization, wherein, represents regularization, w represents the weight vector of the input features, and b represents the bias term, represents an error term, C is a penalty coefficient, n2 represents the total number of training samples, o represents a sample index, and ξ i and represents a slack variable;
[0096] Iterative optimization: update the model parameters w and b using the gradient descent method in each iteration process, and calculate the new loss function in the process of updating;
[0097] Check the convergence condition: after each round of iteration, compare the current loss function value with the change of the last round, when the loss change between the adjacent two iterations is less than the preset error threshold, it is considered that the model has converged, and the iteration is stopped;
[0098] Using the trained support vector regression model to predict the stress data of the preliminary data set.
[0099] The acquisition method of the preprocessed data set includes:
[0100] The behavior data and environmental data are used to obtain a comprehensive data set using a merge function, the local outlier factor algorithm is used to identify and eliminate outliers in the comprehensive data set, then Min-Max normalization processing is performed, and the time stamp is unified to obtain the preprocessed data set.
[0101] The specific method of the local outlier factor algorithm includes:
[0102] Determine the k-nearest neighbor value;
[0103] Calculate the k-nearest neighbor distance of each sample point:
[0104] The sample point refers to each specific data value in the preprocessed data set; the sample refers to a row of data in the preprocessed data set;
[0105] Calculate the Euclidean distance between the i sample and other samples in the preprocessed data set, arrange the obtained Euclidean distances in ascending order, select the first k samples as the k nearest neighbors of the i sample, and define the Euclidean distance between the k samples and the i sample as the k-nearest neighbor distance k dist (x i );
[0106] Calculate the distance between the i sample and the j sample using the Euclidean distance, and 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 represent the exercise intensity data in the i-th sample and the j-th sample, respectively,i,bp and x j,bp Represents the step frequency data in the i-th sample and the j-th sample, respectively, 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, cadence 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 and k nearest neighbor distance between sample point i and sample point j, 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; assuming that 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: The local outlier factor LOF is calculated based on the local density of sample point i and the local densities of the two adjacent sample points, as well as the reachable distance from sample point i to the 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-neighbor value: determine the initial range of k-neighbor value [k_min, k_max] by random search method;
[0117] Calculate the evaluation value of each k-neighbor value in the initial range of k-neighbor value using cross-validation method, randomly divide the comprehensive data set into 10 subsets, each containing 10% of the data; for each k-neighbor value in the initial range, perform 10 training and validation, each time select 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-neighbor value on the validation set, and then average the evaluation values of the 10 rounds to obtain the final evaluation value of the current k-neighbor value;
[0118] Calculate the difference of the final evaluation value of each pair of adjacent k-neighbor values, between the pair of k-neighbor values with the smallest difference, use fixed step to refine the division, and then calculate the final evaluation value of the k-neighbor value in each fixed step using 10-fold cross-validation, when the error is less than the set threshold Yz, stop refining the division, and use grid search method to search the optimal k-neighbor value.
[0119] Fusion using automatic encoder, the output comprehensive behavior vector includes:
[0120] Step one, the preprocessed data set X ∈ R r*ε is input, X ∈ R r*ε , which represents that X is a matrix with 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 two, the encoder maps each original input vector X u ∈ R ε to a low-dimensional vector Z u ∈ R d , and d<ε, the mapping step is processed using linear transformation and activation function f1, the formula is: Z u = f1(W e X u +b e ), where u represents the sample index in the preprocessed data set, 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 represents the low-dimensional latent vector output by the encoder;
[0122] Step three, the decoder maps the low-dimensional latent vector Z u ∈ R dreduction to the reconstructed high-dimensional vector The processing reduction step is performed using a linear transformation and an activation function f2, with the formula: f1 represents a 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 four, compare the error between the reconstructed output and the original input vector, and calculate the loss function, using the root mean square error as the loss function, with the formula:
[0124] Step five, calculate the gradient of the loss function with respect to the weights and biases of the encoder and decoder through backpropagation; then use gradient descent to update the weight matrix and bias term of the encoder and decoder using the calculated gradient;
[0125] Where the gradient of the weight matrix and bias term of the encoder is: The gradient of the weight matrix and bias term of the decoder is 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 updated weight matrix and bias term of the encoder are: Where η represents the learning rate;
[0127] The updated weight matrix and bias term of the decoder are:
[0128] The learning rate is a hyperparameter that determines the size of the step in updating the parameters each time, that is, the adjustment amplitude of the model weights and biases in each iteration. It can be set to a fixed learning rate according to the experience method, ranging from 0.001 to 0.1;
[0129] Step six, repeat steps two to five until the value of the loss function converges to a minimum or reaches the preset maximum number of iterations.
[0130] Step seven, after the autoencoder training is completed, extract the encoder as a feature extractor; input the preprocessed data set and convert it to a low-dimensional latent vector through the encoder, which is the comprehensive behavior vector.
[0131] Based on the comprehensive behavior vector, the ways to determine the user's current behavior state include:
[0132] Based on the comprehensive behavior vector, set weights for each feature in the vector and calculate the comprehensive behavior score using the weighted average method wherein S represents the total number of features in the comprehensive behavior vector, v represents the index in the comprehensive behavior vector, 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] wherein the feature weight is set by using the entropy weight method, which reflects the contribution of each feature to the overall information amount 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 the information amount, and the relatively lower the importance; the higher the information entropy, the more dispersed the distribution of the feature, the more the information amount, and the higher the importance; therefore, the entropy weight method can effectively identify which features provide more information and are more discriminative;
[0134] The average value μ1 and the standard deviation σ1 of the comprehensive behavior score calculated using the historical comprehensive behavior vector are used to set the behavior state threshold Y z range: Y z =[μ1-τ*σ1, μ1+τ*σ1], wherein τ represents the adjustment coefficient.
[0135] The comprehensive behavior score is compared with the set behavior state threshold to determine the current behavior state of the user; when the comprehensive behavior score pf is within the behavior state threshold Y z range, it indicates that the current behavior state of the user is normal, when pf<μ1-τ*σ1, it indicates that the current behavior state of the user is abnormal, and when pf>μ1+τ*σ1, it indicates that the current behavior state of the user is active.
[0136] The embodiment 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 stress data, and uses weight adjustment to optimize the accuracy of data results when obtaining motion intensity data, and uses acceleration to obtain step frequency data; the autoencoder is applied to the comprehensive processing of multi-dimensional feature data, and the comprehensive behavior vector is extracted through deep fusion of multi-source data; the comprehensive behavior score is calculated based on the comprehensive behavior vector, and the current behavior state of the user is determined by using the comprehensive behavior score and the dynamic threshold, thereby 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 the behavior state of the user, making the prediction of the motion state more timely and reliable, and is helpful for wide application in the field of intelligent health monitoring and behavior management.
[0137] Example 2
[0138] Please refer to Figure 2As shown, the embodiment does not describe part of the embodiment 1, provides a user behavior dynamic data deep mining analysis system, comprising:
[0139] Data acquisition module: acquire behavior data and environment data; the behavior data includes motion data, physiological data;
[0140] Data preprocessing module: preprocessing behavior data and environment data, obtaining preprocessed data set;
[0141] Data fusion module: based on the preprocessed data set, using automatic encoder for fusion, output comprehensive behavior vector;
[0142] Data mining module: based on the comprehensive behavior vector, judge the current behavior state of the user.
[0143] Embodiment 3
[0144] The embodiment discloses an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to realize the running mode of the user behavior dynamic data deep mining analysis method provided above.
[0145] Since the electronic device introduced in the embodiment is the electronic device used to implement the user behavior dynamic data deep mining analysis method in the embodiment, the specific implementation of the electronic device and its various forms can be understood by those skilled in the art based on the user behavior dynamic data deep mining analysis method introduced in the embodiment, so the method of the electronic device is not introduced in detail. As long as the electronic device used to implement the user behavior dynamic data deep mining analysis method in the embodiment is implemented by those skilled in the art, it belongs to the scope of the present application.
[0146] The above formulas are dimensionless values, and the formulas are obtained by collecting a large amount of data to simulate the latest real situation, and the preset parameters and threshold values in the formula are set by the person skilled in the art according to the actual situation.
[0147] The above only describes the preferred embodiments of the present application, and the protection scope of the present application is not limited to the above embodiments. Any technical solution falling within the scope of the present application is also within the protection scope of the present application. It should be noted that for ordinary technical users in the technical field, some improvements and decorations without departing from the principles of the present application are also considered as the protection scope of the present application.
Claims
1. A method for dynamic data mining analysis of user behavior, characterized in that, The user behavior dynamic data deep mining analysis method comprises the following steps: S1, acquiring behavior data and environment 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, fusing by using an automatic encoder to output a comprehensive behavior vector; The way of fusing by using the automatic encoder to output the comprehensive behavior vector comprises: Step one, the pre-processed dataset X ∈ R r*ε as input; Step two, the encoder maps each original input vector X u ∈ R ε to a low-dimensional vector Z u ∈ R d , and d < ε, using linear transformation and activation function f1 to process the mapping step; Step three, the decoder restores the low-dimensional latent vector Z u ∈ R d to a reconstructed high-dimensional vector using linear transformation and activation function f2 to process the restoration step; Step four, compare the error between the reconstructed output and the original input vector, and calculate the loss function, using the root mean square error as the loss function; Step five, calculate the gradient of the loss function with respect to the weights and biases of the encoder and decoder by backpropagation; then update the weight matrix and bias term of the encoder and decoder using the gradient obtained by gradient descent method; Step six, repeat steps two to five until the value of the loss function converges to a minimum or reaches a preset maximum number of iterations; Step seven, after the autoencoder training is completed, the encoder is extracted as a feature extractor; input the pre-processed dataset, and convert it to a low-dimensional latent vector through the encoder, which is the comprehensive behavior vector; S4, judging a current behavior state of a user based on the comprehensive behavior vector; The way of judging the current behavior state of the user based on the comprehensive behavior vector comprises: Based on the comprehensive behavior vector, weights are set for each feature in the vector, and a comprehensive behavior score is calculated by a 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, 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 behavior state threshold value Y is set using the average μ1 and the standard deviation σ1 of the comprehensive behavior score calculated using the historical comprehensive behavior vector z Range: Y z = [μ1 - τ * σ1, μ1 + τ * σ1], where τ denotes an adjustment coefficient The comprehensive behavior score is compared with a set behavior state threshold value to determine the current behavior state of the user. When the comprehensive behavior score pf is within the behavior state threshold value Y z , it indicates that the current behavior state of the user is normal, when pf < μ1-τ*σ1, it indicates that the current behavior state of the user is abnormal, and when pf > μ1+τ*σ1, it indicates that the current behavior state of the user is active.
2. The user behavior dynamic data deep mining analysis method according to claim 1, characterized in that, The motion data comprises motion intensity data and step frequency data; The physiological data comprises blood pressure data, respiratory rate data and stress data; The environment data comprises illumination intensity data, temperature data, humidity data and air quality data.
3. The user behavior dynamic data deep mining analysis method according to claim 2, characterized in that, The motion intensity data acquisition method comprises: An acceleration sensor is installed in the smart watch to collect acceleration a of the user at time t in real time X 、 a Y and a Z , and calculate total acceleration wherein a X is acceleration on the X axis, a Y is acceleration on the Y axis, and a Z is acceleration on the Z axis The formula for calculating the rate of change of the total acceleration at time t, Δa(t), is: Δa(t) = |a total (t) - a total (t-1) |; For the total acceleration and the total acceleration rate of change, the weighted average method is used to calculate the motion intensity 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. A total acceleration change rate threshold θ is set, and when the total acceleration change rate is greater than the threshold θ, w1 is adjusted by a dynamic weighting method, and the formula is: wherein α is an adjustment parameter, and w2 = 1-w1. When the threshold value of the acceleration is less than the threshold value theta, then w1 = w2 = 0.
5.
4. The user behavior dynamic data deep mining analysis method according to claim 3, characterized in that, The step frequency data acquisition method comprises: By means of the total acceleration data acquired in real time, the total acceleration data is visualized, peaks are monitored in the total acceleration visualization, and the step period T is calculated from the time difference between two adjacent peaks step , the step frequency is calculated from the step period where 60 is 60 seconds; The step cycle is the time interval from the start of one step to the start of the next step, calculated as: 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, and t peak (q+1) represents the timestamp corresponding to the q+1th index.
5. The user behavior dynamic data deep mining analysis method according to claim 4, characterized in that, The stress data acquisition method comprises: Real-time collection of skin conductance data, heart rate variability data and skin temperature data; The skin conductance data, the heart rate variability data and the skin temperature data are normalized to obtain a normalized data set, a local outlier factor algorithm is used to identify abnormal values in the normalized data set, and the abnormal values are removed to obtain a preliminary data set, and based on the preliminary data set, a trained support vector regression model is used to predict stress data; The specific way of predicting the stress data by using the trained support vector regression model comprises: Based on historical skin conductance data, heart rate variability data, skin temperature data and stress data as a training set for training; Initializing hyperparameters: selecting a radial basis function as a kernel function, the SVR model includes a penalty coefficient, an epsilon parameter and a gamma parameter, and the best values of the parameters are determined by a grid search method; Compute initial loss function: Compute the initial loss function value for the model As a starting point for optimization, where, denotes regularization, w denotes a weight vector for input features, b denotes a bias term, denotes an error term, C is a penalty coefficient, n2 denotes the total number of training samples, o denotes a sample index, ξ i and denotes a slack variable; Iterative optimization: in each iteration process, the gradient descent method is used to update the model parameters w and b, and a new loss function is calculated in the updating process; Checking convergence conditions: after each iteration, the current loss function value is compared with the change of the last round, when the loss change between adjacent two iterations is less than a preset error threshold, it is considered that the model has converged, and the iteration is stopped; Using the trained support vector regression model to predict the stress data of the preliminary data set.
6. The user behavior dynamic data deep mining analysis method according to claim 5, characterized in that, The preprocessed data set acquisition method comprises: The comprehensive data set is obtained by using a merge function for the behavior data and the environment data, the local outlier factor algorithm is used to identify abnormal values in the comprehensive data set and remove them, then Min-Max normalization processing is performed, and a time stamp is unified to obtain the preprocessed data set.
7. The user behavior dynamic data deep mining analysis method according to claim 6, characterized in that, The specific way of the local outlier factor algorithm comprises: Determining a k-neighbor value; Calculating the k-neighbor distance of each sample point: The sample point refers to each specific data value in the preprocessed data set; the sample refers to one row of data in the preprocessed data set; Euclidean distances between the i-th sample and other samples in the pre-processed data set are calculated, the obtained Euclidean distances are arranged in ascending order, k nearest neighbors of the i-th sample are selected as the first k samples, and the Euclidean distance farthest from the i-th sample in the k samples is defined as a k nearest neighbor distance k dist (x i ). The distance between the i sample and the j sample is calculated by using the Euclidean distance, and the formula is: where i and j represent sample indexes in the dataset, 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 motion 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 respectively represent the air quality data in the i-th sample and the j-th sample. The preprocessed dataset includes processed motion intensity data, step frequency data, blood pressure data, respiratory rate data, stress 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 and k nearest neighbor distance between sample point i and sample point j, 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; assuming that 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; Local density is calculated by the reachable distance of sample point i, formula is: where N k (x i ) represents the set of k nearest neighbors of sample point i, and lrd(x i ) represents the local density of sample point i. Computing Local Outlier Factor LOF: The Local Outlier Factor LOF is computed based on the local density of the sample point i and the local density of the two neighboring sample points, and the reachable distance of the sample point i to the k-neighbor points, and the formula is: Abnormal value 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, and if the LOF value of a sample point is less than the abnormal threshold, the point is a normal point; the detected abnormal points are eliminated.
8. The user behavior dynamic data deep mining analysis method according to claim 7, characterized in that, The manner of determining the k-neighbor value includes: Determining an initial range of the k-neighbor value: determining the initial range [k_min, k_max] of the k-neighbor value by using a random search method; Using a cross-validation method to calculate the evaluation value of each k-neighbor value in the initial range of the k-neighbor value, randomly dividing the comprehensive dataset into 10 subsets, each containing 10% of the data; for each k-neighbor value in the initial range, 10 training and verification are performed respectively, each time selecting a different subset as the verification set and the other 9 subsets as the training set, in each round of training and verification, recording the evaluation value of the current k-neighbor value on the verification set, and then averaging the evaluation values of the 10 rounds to obtain the final evaluation value of the current k-neighbor value; Calculating the difference between the final evaluation values of each pair of adjacent k-neighbor values, between the pair of k-neighbor values with the smallest difference, using fixed steps for refined division, and using the final evaluation value of the k-neighbor value in each fixed step calculated by the 10-fold cross-validation to calculate the error of adjacent k-neighbor values, when the error is less than a set threshold Yz, stopping the refined division, using a grid search method to search the adjacent k-neighbor values to determine the optimal k-neighbor value.
9. The user behavior dynamic data deep mining analysis method of claim 8, wherein, The manner of using an automatic encoder for fusion and outputting a comprehensive behavior vector further includes: In step one, X ∈ R r*ε represents X is a matrix of size r*ε, where each sample point is a real number, r is the total number of samples in the dataset, and ε is the number of features. The formula of step two is expressed as: Z u = f1(W e X u + b e ), where u represents the sample index in the preprocessed data set, u = 1, 2, …, r, W e represents the weight matrix of the encoder, b e represents the bias term of the encoder, f1 represents a nonlinear activation function, and Z u represents the low-dimensional latent vector output by the encoder. The formula of step three is expressed as: f1represents a nonlinear activation function, W d represents a weight matrix of the decoder, b d represents a bias term of the decoder, represents a reconstruction vector of the decoder output; The formula of the loss function in step four is:
Citation Information
Patent Citations
Social media user behavior pattern mining method
CN115687429A
Sensor integrated nursing system of Internet of Things
CN117197998A
Intelligent interaction method based on robot
CN118098234A