Customer repurchase intention prediction method and system based on cluster analysis and attention mechanism

Through cluster analysis and attention mechanism, the time series characteristics of B2B customers are extracted, and the problem of poor prediction results under large-scale data is solved, and accurate prediction and efficient monitoring of B2B customers' willingness to repurchase are achieved.

CN118628162BActive Publication Date: 2024-12-03SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411105564.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-03
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

Existing customer repurchase intention prediction algorithms are not effective when facing large-scale data distributions across time and highly sparse data, and ignore potential connections between customers, especially in B2B scenarios, which are difficult to achieve accurate modeling.

Method used

Using a method based on clustering analysis and attention mechanism, the time series is constructed by obtaining user historical purchase information, clustering user behavior characteristics, dividing user groups, and using deep learning models to extract time series features, and combining attention mechanisms to capture timeliness Features: Finally, the list of customers with the intention to repurchase is output through the decision strategy model.

Benefits of technology

It realizes accurate prediction of B2B customers' willingness to repurchase, provides an efficient and energy-saving prediction system, which can make intelligent decisions and efficient monitoring, and is suitable for B2B scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628162B_ABST
    Figure CN118628162B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for predicting customer repurchase intention based on cluster analysis and attention mechanism, which obtains the user's historical purchase information, constructs a time series according to the historical purchase information, clusters the user's purchase behavior characteristics based on the time series, and divides the users into different user groups according to the clustering results; constructs a time series feature extraction model based on a deep learning method, trains the user groups obtained after clustering respectively, and extracts user portrait features in different user groups through the time series feature extraction model; and outputs users whose prediction probability exceeds a threshold as a list of customers with repurchase intention according to a decision strategy model. The present invention can effectively realize the accurate prediction of customer repurchase intention, and provides a set of efficient and energy-saving B2B customer repurchase intention prediction system to realize intelligent decision-making and efficient monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of big data intelligent analysis and e-commerce, and more specifically, to a method and system for predicting customer repurchase intention based on cluster analysis and attention mechanism. Background Art

[0002] Customer repurchase intention prediction aims to predict whether a customer will repurchase in the future. In recent years, with the rapid development of the Internet, competition in the e-commerce industry has become increasingly fierce. How to effectively predict customer purchase intention has become a key factor for companies to enhance their competitiveness and achieve sustainable development. Through data analysis and customer behavior prediction, companies can better grasp market trends and customer needs, adjust products and services in a timely manner, and maintain market competitiveness. In addition, predicting customer repurchase intention can also help companies identify potential risks, such as lost customers or declining sales, so that they can take preventive measures to reduce the impact of risks on their business. However, since customers' purchasing decisions are easily affected by multiple factors such as market activities, seasonal changes, personal interests, and the long-tail effect of customer behavior, how to accurately model customers faces great challenges.

[0003] With the rapid development of artificial intelligence technology, the research on customer repurchase intention is becoming more and more in-depth. The existing customer repurchase intention algorithms can be summarized as machine learning models and deep learning models. Machine learning models can predict customers' repurchase intention through relevant algorithms, such as random forests and gradient boosting trees. However, this is more dependent on artificial feature engineering and has high data quality requirements. It cannot achieve good results when facing data imbalance problems such as cross-time and highly sparse data distribution in large-scale data sets, and it takes a long time. Deep learning models use neural network structures, especially recurrent neural networks (RNNs) and RNN variants (such as LSTM, GRU, etc.), which can handle complex nonlinear relationships and time dependencies, and capture subtle changes and long-term patterns in customer behavior. This type of model can exceed traditional machine learning models in prediction accuracy through efficient processing of big data and complex features. However, the above models rarely pay attention to the potential connections between customers, ignore the multi-dimensional relationships of customers themselves, and do not take B2B scenarios into account when modeling customers.

[0004] Time series clustering is a method of analyzing and grouping high-dimensional data with time dependence. It involves data preprocessing techniques such as normalization, smoothing, and missing value filling. It uses similarity metrics such as Euclidean distance and dynamic time warping, and uses algorithms such as K-means, hierarchical clustering, and density clustering for clustering, combined with feature extraction techniques such as Fourier transform, wavelet transform, and principal component analysis. Time series prediction algorithms based on deep learning use neural network structures to capture complex patterns and long-term and short-term dependencies in data. The attention mechanism is used to capture the importance of sequence positions and improve prediction performance by focusing on key timeliness features. These technologies not only show wide application potential in fields such as climate prediction, healthcare, and financial analysis, but are also particularly suitable for improving the accuracy and timeliness of customer repurchase intention prediction in B2B scenarios. Therefore, how to integrate time series clustering analysis to model customers based on the characteristics of B2B customers and how to capture time series features by introducing a time series prediction algorithm with an attention mechanism to improve the prediction performance of customer repurchase intention is an urgent problem to be solved. Summary of the invention

[0005] The present invention overcomes the defects of the prior art and proposes a method and system for predicting customer repurchase intention based on cluster analysis and attention mechanism.

[0006] The first aspect of the present invention provides a method for predicting customer repurchase intention based on cluster analysis and attention mechanism, comprising:

[0007] Acquire the user's historical purchase information, construct a time series based on the historical purchase information, cluster the user's purchase behavior characteristics based on the time series, and divide the user into different user groups based on the clustering results;

[0008] Construct a time series data set based on the user information features corresponding to different user groups, and extract the user time series features in the time series data set as user portrait representation through a preset neural network;

[0009] Based on the obtained user portrait representation, the predicted probability of the user's final repurchase intention is calculated through the activation function and linear projection function;

[0010] According to the preset decision strategy model, the output of users whose predicted probability exceeds the threshold is used as the list of customers with repurchase intention.

[0011] In this solution, the user's historical purchase information is obtained, a time series is constructed according to the historical purchase information, and the user's purchase behavior characteristics are clustered based on the time series. The user is divided into different user groups according to the clustering results, specifically:

[0012] Obtain the user's daily purchase information in each company during the historical period, and build a user-company interaction matrix based on the user's transaction information for each company;

[0013] Obtaining a user-company interaction matrix of all users within a period of time, encoding the user-company interaction matrix through an encoder to obtain a user's pattern behavior matrix;

[0014] Generate a user's pattern behavior time series in a historical time period according to the user pattern behavior matrix, and cluster the user's pattern behavior time series based on a time series clustering algorithm;

[0015] According to the clustering results, users with similar pattern behaviors are aggregated and different cluster labels are obtained. Users are divided according to the cluster labels to obtain different user groups.

[0016] In this solution, a time series data set is constructed based on user information features corresponding to different user groups, and the user time series features in the time series data set are extracted as user portrait representations through a preset neural network; based on the obtained user portrait representation, the user's final repurchase intention prediction probability is calculated through an activation function and a linear projection function, specifically:

[0017] Acquire the purchase information of the user in a historical time period, build a customer information database based on the purchase information of the user, and build user information features based on the customer information database;

[0018] Obtain user information features corresponding to different user groups, construct a time series data set based on user information features and user basic information, train different user groups separately through the gated recurrent neural network GRU, and extract user time series features in different user groups as user portrait representation;

[0019] The key position features of the user time series are captured through the self-attention mechanism network, and the user portrait representation is enhanced by combining the extracted user time series features;

[0020] According to the obtained user portrait representation, the user's final repurchase intention prediction probability is obtained through activation function and linear projection function.

[0021] In this solution, the output of users whose predicted probability exceeds the threshold according to the preset decision strategy model is used as a list of customers with repurchase intention, specifically:

[0022] Build a decision-making strategy model based on preset statistical methods, calculate the company's average daily user traffic based on historical user purchase records, and determine the threshold based on the user traffic ratio;

[0023] The predicted probabilities of repurchase intention of all users are sorted, and based on the above decision strategy model, the output of users whose predicted values ​​exceed the threshold is used as the list of customers with repurchase intention.

[0024] The second aspect of the present invention also provides a customer repurchase intention prediction system based on cluster analysis and attention mechanism, the system includes a user information module, a user feature module, a clustering module, a user repurchase intention prediction module, a decision module and a monitoring and evaluation module, specifically:

[0025] The user information module is used to obtain the user's recent purchase records from the database, process and filter out abnormal values, and then build a user information transaction network based on the user's recent purchase records;

[0026] The user feature module is used to obtain the user's feature information, and obtain the user's features based on the user's basic information and the user information trading network;

[0027] The clustering module is used to divide different user groups, construct the user's purchase information into a time series, and cluster the user's purchase behavior characteristics based on the time series to divide them into different clusters. According to the clustering of the sequence, the corresponding users are divided to obtain different user groups with similar characteristics;

[0028] The user feature module is also used to obtain time series feature information of different user groups, train the user groups separately and extract time series features, capture sequence position information according to the attention mechanism, and combine the extracted time series features and sequence position information to form user portrait features;

[0029] The user repurchase intention prediction module is used to obtain the final list of customers with repurchase intention, output the repurchase intention probability for each customer, and output the customers whose predicted probability exceeds the threshold as the list of customers with repurchase intention;

[0030] The monitoring and evaluation module is used to monitor the final output results, ensure the normal operation of the system, monitor the number of customers with repurchase intention and the average willingness value, and ensure that the evaluation values ​​tend to be stable over a long period of time.

[0031] In this solution, the customer repurchase intention prediction system based on cluster analysis and attention mechanism implements the following steps during operation:

[0032] Acquire the user's historical purchase information, construct a time series based on the historical purchase information, cluster the user's purchase behavior characteristics based on the time series, and divide the user into different user groups based on the clustering results;

[0033] Construct a time series data set based on the user information features corresponding to different user groups, and extract the user time series features in the time series data set as user portrait representation through a preset neural network;

[0034] Based on the obtained user portrait representation, the predicted probability of the user's final repurchase intention is calculated through the activation function and linear projection function;

[0035] According to the preset decision strategy model, the output of users whose predicted probability exceeds the threshold is used as the list of customers with repurchase intention.

[0036] In this solution, the user's historical purchase information is obtained, a time series is constructed according to the historical purchase information, and the user's purchase behavior characteristics are clustered based on the time series. The user is divided into different user groups according to the clustering results, specifically:

[0037] Obtain the user's daily purchase information in each company during the historical period, and build a user-company interaction matrix based on the user's transaction information for each company;

[0038] Obtaining a user-company interaction matrix of all users within a period of time, encoding the user-company interaction matrix through an encoder to obtain a user's pattern behavior matrix;

[0039] Generate a user's pattern behavior time series in a historical time period according to the user pattern behavior matrix, and cluster the user's pattern behavior time series based on a time series clustering algorithm;

[0040] According to the clustering results, users with similar pattern behaviors are aggregated and different cluster labels are obtained. Users are divided according to the cluster labels to obtain different user groups.

[0041] In this solution, a time series data set is constructed based on user information features corresponding to different user groups, and the user time series features in the time series data set are extracted as user portrait representations through a preset neural network; based on the obtained user portrait representation, the user's final repurchase intention prediction probability is calculated through an activation function and a linear projection function, specifically:

[0042] Acquire the purchase information of the user in a historical time period, build a customer information database based on the purchase information of the user, and build user information features based on the customer information database;

[0043] Obtain user information features corresponding to different user groups, construct a time series data set based on user information features and user basic information, train different user groups separately through the gated recurrent neural network GRU, and extract user time series features in different user groups as user portrait representation;

[0044] The key position features of the user time series are captured through the self-attention mechanism network, and the user portrait representation is enhanced by combining the extracted user time series features;

[0045] According to the obtained user portrait representation, the user's final repurchase intention prediction probability is obtained through activation function and linear projection function.

[0046] In this solution, the output of users whose predicted probability exceeds the threshold according to the preset decision strategy model is used as a list of customers with repurchase intention, specifically:

[0047] Build a decision-making strategy model based on preset statistical methods, calculate the company's average daily user traffic based on historical user purchase records, and determine the threshold based on the user traffic ratio;

[0048] The predicted probabilities of repurchase intention of all users are sorted, and based on the above decision strategy model, the output of users whose predicted values ​​exceed the threshold is used as the list of customers with repurchase intention.

[0049] The third aspect of the present invention also provides a computer-readable storage medium, which includes a customer repurchase intention prediction program based on cluster analysis and attention mechanism. When the customer repurchase intention prediction program based on cluster analysis and attention mechanism is executed by a processor, the steps of the customer repurchase intention prediction method based on cluster analysis and attention mechanism as described in any one of the above items are implemented.

[0050] The present invention discloses a method and system for predicting customer repurchase intention based on cluster analysis and attention mechanism, which obtains the user's historical purchase information, constructs a time series according to the historical purchase information, clusters the user's purchase behavior characteristics based on the time series, and divides the customers into different user groups according to the clustering results; constructs a time series feature extraction model based on a deep learning method, trains the user groups obtained after clustering respectively, and extracts the user portrait features in different user groups through the time series feature extraction model; and outputs the customers whose prediction probability exceeds the threshold as a list of customers with repurchase intention according to the decision strategy model. The present invention can effectively realize the accurate prediction of customer repurchase intention, and provides a set of efficient and energy-saving B2B customer repurchase intention prediction system to realize intelligent decision-making and efficient monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flowchart of a method for predicting customer repurchase intention based on cluster analysis and attention mechanism of the present invention is shown;

[0052] Figure 2 A flow chart of a method for clustering user behavior features based on a clustering algorithm of the present invention is shown;

[0053] Figure 3A flow chart of a method for constructing a user portrait based on a deep learning model of the present invention is shown;

[0054] Figure 4 The following is an architecture diagram of a customer repurchase intention prediction system based on cluster analysis and attention mechanism according to the present invention. DETAILED DESCRIPTION

[0055] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0056] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0057] Figure 1 A flow chart of a method for predicting customer repurchase intention based on cluster analysis and attention mechanism of the present invention is shown.

[0058] like Figure 1 As shown, the first aspect of the present invention provides a method for predicting customer repurchase intention based on cluster analysis and attention mechanism, which specifically includes:

[0059] S102, obtaining historical purchase information of the user, constructing a time series according to the historical purchase information, clustering the purchase behavior characteristics of the user based on the time series, and dividing the user into different user groups according to the clustering results;

[0060] S104, constructing a time series data set based on user information features corresponding to different user groups, and extracting user time series features in the time series data set as user portrait representations through a preset neural network;

[0061] S106, according to the obtained user portrait representation, the user's final repurchase intention prediction probability is calculated through activation function and linear projection function;

[0062] S108, according to the preset decision strategy model, output the users whose predicted probability exceeds the threshold as a list of customers with repurchase intention.

[0063] It should be noted that, in the present invention, customers and users refer to the same object, and customer analysis is the same as user analysis.

[0064] The present invention includes user information processing:

[0065] The customer's attendance sequence can be extracted from the customer information transaction network. Formally, the transaction information of customer u and company c on day t is represented as The information set of the company with which customer u transacted on day t and the transaction information of customer u on day t is expressed as follows:

[0066] ;

[0067] ;

[0068] ;

[0069] in, It represents that customer u has a transaction in company i on day t. For the corresponding The set of represents, k is the total number of companies. Indicates whether customer u has conducted transactions with the i-th company, with values ​​of 0 or 1. It represents a list of whether the customer has a transaction with each company on the tth day, so that the company transaction behavior sequence of all customers every day can be obtained. The company transaction behavior sequence is the user-company interaction matrix.

[0070] According to an embodiment of the present invention, the user's historical purchase information is obtained, a time series is constructed according to the historical purchase information, and the user's purchase behavior characteristics are clustered based on the time series, and the user is divided into different user groups according to the clustering results, specifically:

[0071] Obtain the user's daily purchase information in each company during the historical period, and build a user-company interaction matrix based on the user's transaction information for each company;

[0072] Obtaining a user-company interaction matrix of all users within a period of time, encoding the user-company interaction matrix through an encoder to obtain a user's pattern behavior matrix;

[0073] Generate a user's pattern behavior time series in a historical time period according to the user pattern behavior matrix, and cluster the user's pattern behavior time series based on a time series clustering algorithm;

[0074] According to the clustering results, users with similar pattern behaviors are aggregated and different cluster labels are obtained. Users are divided according to the cluster labels to obtain different user groups.

[0075] According to an embodiment of the present invention, a time series data set is constructed based on user information features corresponding to different user groups, and user time series features in the time series data set are extracted as user portrait representations through a preset neural network; based on the obtained user portrait representation, the user's final repurchase intention prediction probability is calculated through an activation function and a linear projection function, specifically:

[0076] Acquire the purchase information of the user in a historical time period, build a customer information database based on the purchase information of the user, and build user information features based on the customer information database;

[0077] Obtain user information features corresponding to different user groups, construct a time series data set based on user information features and user basic information, train different user groups separately through the gated recurrent neural network GRU, and extract user time series features in different user groups as user portrait representation;

[0078] The key position features of the user time series are captured through the self-attention mechanism network, and the user portrait representation is enhanced by combining the extracted user time series features;

[0079] According to the obtained user portrait representation, the user's final repurchase intention prediction probability is obtained through activation function and linear projection function.

[0080] According to an embodiment of the present invention, the output of users whose predicted probability exceeds a threshold value according to a preset decision strategy model as a list of customers with repurchase intention is specifically as follows:

[0081] Build a decision-making strategy model based on preset statistical methods, calculate the company's average daily user traffic based on historical user purchase records, and determine the threshold based on the user traffic ratio;

[0082] The predicted probabilities of repurchase intention of all users are sorted, and based on the above decision strategy model, the output of users whose predicted values ​​exceed the threshold is used as the list of customers with repurchase intention.

[0083] Figure 2 The flowchart of the method for clustering user behavior features based on a clustering algorithm of the present invention is shown.

[0084] S202, obtaining user purchase information within a period of time, and constructing a user-company transaction matrix based on the user purchase information;

[0085] S204, constructing a pattern behavior time series from the user-company transaction matrix through a sequence encoder;

[0086] S206, clustering the user's pattern behavior time series by a clustering algorithm and generating cluster labels;

[0087] S208: Divide different user groups based on the generated cluster labels.

[0088] Transaction Matrix Encoder:

[0089] For all user’s company transaction behavior sequences, we use the sequence encoder function g(·) to encode the user’s behavior pattern. The pattern corresponding to customer u every day It is expressed as follows:

[0090]

[0091] In this way, the behavior pattern encoding dictionary of all customers, that is, the pattern behavior matrix, is generated, and finally the pattern sequence of customer u in n days can be obtained. The pattern sequence is used as the pattern behavior time series and is expressed as follows:

[0092] ;

[0093] represents the pattern sequence of customer u in n days, , represents the behavior pattern on the i-th day.

[0094] Clustering generates cluster labels:

[0095] Through the encoder above, based on the pattern behavior time series of all users, a data set of purchase behavior pattern sequences of all users can be constructed. The characteristics and similarities of attendance patterns between customers are further analyzed, and k-shape (time series clustering algorithm) is used to cluster the pattern behavior time series of users. For the pattern behavior time series of customer u, it is first standardized, expressed as follows:

[0096] ,

[0097] in, is the standardized sequence data, is the original sequence data, is the mean of the sequence data, is the standard deviation of the data, and then the standardized data is converted into complex form, expressed as:

[0098] ;

[0099] in, is the data in complex form. Then, the distance matrix between samples is calculated, and the k-shape algorithm uses shape similarity to measure the similarity between two time series. Given two normalized time series E and F, their shape similarity is calculated by normalized cross-correlation:

[0100] ;

[0101] in, is the time lag of the time series, n is the length of the time series, the center of the cluster is also called the shape center; S is the similarity, E[ ],F[ ] is the first of two sequences Values;

[0102] Given a normalized time series in a cluster C ; Shape center It can be calculated by the following formula:

[0103] ;

[0104] in, Represents similarity, and finally groups all sequences into k clusters, m is the given sequence length, given k clusters , the clustering objective function can be expressed as:

[0105] ;

[0106] k is a given number, Cluster The mean of .

[0107] User feature construction process:

[0108] User attributes include personal information, purchase patterns, and recent transactions. For a user, its user characteristics can be aggregated through the user transaction network as follows:

[0109] ;

[0110] in, Indicates the transaction characteristics of the user, Indicates the personal characteristics of the customer, Indicates company characteristics, Represents the aggregation operation. After preprocessing these features, the input of the model is obtained . is the i-th input channel data, Represents the entire input data set, and analyzes the user characteristics of different user groups based on the above user feature construction process.

[0111] User feature embedding:

[0112] Each input sequence is represented by user feature embedding and position embedding. Given a sequence channel The sequence is embedded with the final user features through a learnable linear projection. Position embedding first introduces the embedding method of relative position, as shown below:

[0113] ;

[0114] Among them, d is the dimension of the model, L is the maximum length of the sequence (i.e. max_len), i is the position index, and j is the dimension index. is the embedding representation of the relative position; then the timeliness weight is added to the position encoding of the sequence. Here, the final sequence position embedding is obtained by multiplying the relative position embedding of the sequence by the time decay factor, as shown below:

[0115] ;

[0116] Figure 3 A flow chart of the method for constructing a user portrait based on a deep learning model of the present invention is shown.

[0117] S302, obtaining user purchase information within a period of time, constructing a user information network based on the user purchase information, and constructing user features based on different user groups from the user information network;

[0118] S304, constructing a time series data set of the user according to the user characteristics, and using the time series data set as the input of the GRU model based on the deep learning method to generate a user portrait representation;

[0119] S306, capturing key position features of the user portrait representation sequence through an attention mechanism model to enhance the customer portrait representation;

[0120] S308, generating the customer's repurchase intention probability according to the user portrait representation using linear projection and activation function sigmoid.

[0121] User portrait representation generation:

[0122] Aggregate user embedding and position embedding to get the input of GRU. GRU is a gated recurrent unit, which implements temporal feature extraction through a gating mechanism, which includes an update gate and a reset gate. Specifically, for the input sequence , assuming the hidden state at the previous moment is , the hidden state at the current moment is , then the entire process within the GRU unit can be formulated as:

[0123] ;

[0124] ;

[0125] ;

[0126] ;

[0127] in represents the update gate, Represents the reset gate, represents the weight matrix, represents the bias vector, is the sigmoid activation function, represents element-by-element multiplication, tanh is the activation function, is a candidate hidden state.

[0128] After iteration, the final hidden layer state features can be obtained , which contains the historical features of the original sequence and serves as a representation of the user portrait. This part of the features will be passed to the attention mechanism module for the final reasoning and prediction steps.

[0129] The attention mechanism module uses self-attention to calculate the relevance of different elements in the input sequence (sequence represented by user portraits) and generates a context vector to enhance the model's understanding of the sequence. This module consists of linear transformation layers for query Q, key K, and value V. It uses the softmax function to calculate the attention weights, and then performs a weighted summation of the value vectors based on these weights to obtain the context vector. Finally, the output is obtained through compression operation:

[0130] ;

[0131] Among them, q represents the query information of the input sequence, T represents the transposition operation, k represents the key information of the input sequence, v represents the value information of the input sequence, and c represents the generated sequence context information.

[0132] Finally, after a linear transformation layer and a sigmoid layer, the final customer repurchase intention probability p is obtained.

[0133] Decision output customer list:

[0134] Here, we use a preset statistical method to calculate the company's average daily user traffic based on the customer's historical purchase records, and determine the threshold y based on the user traffic ratio. If p>=y, then the customer information is output, otherwise it is not output.

[0135] Figure 4 A block diagram of a customer repurchase intention prediction system based on cluster analysis and attention mechanism of the present invention is shown.

[0136] The second aspect of the present invention also provides a customer repurchase intention prediction system based on cluster analysis and attention mechanism, the system includes a user information module, a user feature module, a clustering module, a user repurchase intention prediction module, a decision module and a monitoring and evaluation module, specifically:

[0137] The user information module is used to obtain the user's recent purchase records from the database, process and filter out abnormal values, and then build a user information transaction network based on the user's recent purchase records;

[0138] The user feature module is used to obtain the user's feature information, and obtain the user's features based on the user's basic information and the user information trading network;

[0139] The clustering module is used to divide different user groups, construct the user's purchase information into a time series, and cluster the user's purchase behavior characteristics based on the time series to divide them into different clusters. According to the clustering of the sequence, the corresponding users are divided to obtain different user groups with similar characteristics;

[0140] The user feature module is also used to obtain time series feature information of different user groups, train the user groups separately and extract time series features, capture sequence position information according to the attention mechanism, and combine the extracted time series features and sequence position information to form user portrait features;

[0141] The user repurchase intention prediction module is used to obtain the final list of customers with repurchase intention, output the repurchase intention probability for each customer, and output the customers whose predicted probability exceeds the threshold as the list of customers with repurchase intention;

[0142] The monitoring and evaluation module is used to monitor the final output results, ensure the normal operation of the system, monitor the number of customers with repurchase intention and the average willingness value, and ensure that the evaluation values ​​tend to be stable over a long period of time.

[0143] The system implements the following steps when it is running:

[0144] Acquire the user's historical purchase information, construct a time series based on the historical purchase information, cluster the user's purchase behavior characteristics based on the time series, and divide the user into different user groups based on the clustering results;

[0145] Construct a time series data set based on the user information features corresponding to different user groups, and extract the user time series features in the time series data set as user portrait representation through a preset neural network;

[0146] Based on the obtained user portrait representation, the predicted probability of the user's final repurchase intention is calculated through the activation function and linear projection function;

[0147] According to the preset decision strategy model, the output of users whose predicted probability exceeds the threshold is used as the list of customers with repurchase intention.

[0148] The third aspect of the present invention also provides a computer-readable storage medium, which includes a customer repurchase intention prediction program based on cluster analysis and attention mechanism. When the customer repurchase intention prediction program based on cluster analysis and attention mechanism is executed by a processor, the steps of the customer repurchase intention prediction method based on cluster analysis and attention mechanism as described in any one of the above items are implemented.

[0149] The present invention relates to the field of big data intelligent analysis and the field of e-commerce, and discloses a B2B customer repurchase intention time series prediction method and system based on cluster analysis and attention mechanism. The specific process is as follows: first, different user groups are divided according to the characteristics of customer historical purchase behavior based on clustering technology. Specifically, the customer's purchase history information is constructed into a time series, and the user's purchase behavior characteristics are clustered based on the time series, and the purchase behavior characteristics of the user are divided into different clusters, and the corresponding customers are divided according to the clusters of the sequence to obtain different user groups with similar characteristics; secondly, user portrait representations are constructed for different user groups based on a deep learning model. Specifically, a customer information database is constructed based on the customer's purchase history information, and the customer's sequence characteristics are constructed based on the customer information database. The customer's sequence characteristics are used to generate customer portrait representations through a GRU model, and the timeliness information of the customer's purchase behavior characteristics is captured based on the attention mechanism to enhance the customer portrait representation; finally, a list of customers with repurchase intention is output based on a decision strategy model. Specifically, the customer intentions of different user groups are predicted respectively, and a decision strategy model is constructed based on a statistical method, and the customer output with a predicted probability exceeding a threshold is used as a list of customers with repurchase intention; customer data is updated daily according to a monitoring platform to ensure stable system operation. The present invention can realize accurate prediction of B2B customers' repurchase intention, implement systematic management of customers, realize reasonable allocation of enterprise resources and reduce the operating costs of enterprises.

[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0151] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0152] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0153] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0154] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0155] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for predicting customer repurchase intention based on cluster analysis and attention mechanism, characterized in that: include: Acquire the user's historical purchase information, construct a time series based on the historical purchase information, cluster the user's purchase behavior characteristics based on the time series, and divide the user into different user groups based on the clustering results; Construct a time series data set based on the user information features corresponding to different user groups, and extract the user time series features in the time series data set as user portrait representation through a preset neural network; Based on the obtained user portrait representation, the predicted probability of the user's final repurchase intention is calculated through the activation function and linear projection function; According to the preset decision strategy model, the output of users whose predicted probability exceeds the threshold is used as the list of customers with repurchase intention; The method of obtaining the user's historical purchase information, constructing a time series based on the historical purchase information, clustering the user's purchase behavior characteristics based on the time series, and dividing the user into different user groups based on the clustering results is specifically as follows: Obtain the user's daily purchase information in each company during the historical period, and build a user-company interaction matrix based on the user's transaction information for each company; Obtaining a user-company interaction matrix of all users within a period of time, encoding the user-company interaction matrix through an encoder to obtain a user pattern behavior matrix; Generate a user's pattern behavior time series in a historical time period according to the user pattern behavior matrix, and cluster the user's pattern behavior time series based on a time series clustering algorithm; According to the clustering results, users with similar pattern behaviors are aggregated and different cluster labels are obtained. Users are divided according to the cluster labels to obtain different user groups. The user-company interaction matrix is ​​as follows: The company with which customer u transacts on day t and the transaction information set of customer u on day t are expressed as follows: , , , in, It represents that customer u has a transaction in company i on day t. For the corresponding The set of represents, k is the total number of companies; Indicates whether customer u has conducted transactions with the i-th company, with values ​​of 0 or 1; A list indicating whether a customer has made a transaction with each company on day t. This way, we can get the company transaction behavior sequence of all customers every day. The company transaction behavior sequence is the user-company interaction matrix. The mode behavior time series is specifically: For all user’s company transaction behavior sequences, we use the sequence encoder function g(·) to encode the user’s behavior pattern. The pattern corresponding to customer u every day is It is expressed as follows: ; In this way, the behavior pattern encoding dictionary of all customers, that is, the pattern behavior matrix, is generated, and finally the pattern sequence of customer u in n days can be obtained. The pattern sequence is used as the pattern behavior time series and is expressed as follows: ; represents the pattern sequence of customer u in n days; Clustering generates cluster labels: Through the above encoder, based on the pattern behavior time series of all users, a data set of purchase behavior pattern sequences of all users can be constructed; and the characteristics and similarities of attendance patterns between customers are further analyzed, and the k-shape time series clustering algorithm is used to cluster the pattern behavior time series of users; for the pattern behavior time series of customer u, it is first standardized, as shown below: ; in, is the standardized sequence data, is the original sequence data, is the mean of the sequence data, is the standard deviation of the data, and then the standardized data is converted into complex form, expressed as: , in, is the data in complex form; then, the distance matrix between samples is calculated, and the k-shape algorithm uses shape similarity to measure the similarity between two time series; given two normalized time series E and F, their shape similarity is calculated by normalized cross-correlation: , in, is the time lag of the time series, n is the length of the time series, the center of the cluster is also called the shape center; S is the similarity, E[ ],F[ ] is the first of two sequences Values; Given a normalized time series in a cluster C ; Shape center It can be calculated by the following formula: , in, Represents similarity, and finally groups all sequences into k clusters, m is the given sequence length, given k clusters , the clustering objective function can be expressed as: , k is a given number, Cluster The mean of Among them, the time series data set is constructed based on the user information features corresponding to different user groups, and the user time series features in the time series data set are extracted as user portrait representations through a preset neural network; according to the obtained user portrait representation, the user's final repurchase intention prediction probability is calculated through an activation function and a linear projection function, specifically: Acquire the purchase information of the user in a historical time period, build a customer information database based on the purchase information of the user, and build user information features based on the customer information database; Obtain user information features corresponding to different user groups, construct a time series data set based on user information features and user basic information, train different user groups separately through the gated recurrent neural network GRU, and extract user time series features in different user groups as user portrait representation; The key position features of the user time series are captured through the self-attention mechanism network, and the user portrait representation is enhanced by combining the extracted user time series features; Based on the obtained user portrait representation, the user's final repurchase intention prediction probability is obtained through activation function and linear projection function; The GRU is specifically: GRU is a gated recurrent unit, which implements time series feature extraction through a gating mechanism, which includes an update gate and a reset gate. Specifically, for the input sequence , assuming the hidden state at the previous moment is , the hidden state at the current moment is , then the entire process within the GRU unit can be formulated as: ; ; ; ; in represents the update gate, Represents the reset gate, represents the weight matrix, represents the bias vector, is the sigmoid activation function, represents element-by-element multiplication, tanh is the activation function, is the candidate hidden state; after iteration, the final hidden layer state feature can be obtained , which contains the historical features of the original sequence and serves as a representation of the user profile. This part of the features will be passed to the attention mechanism module for the final reasoning and prediction steps; The attention mechanism module uses self-attention to calculate the relevance of different elements in the sequence represented by the input user portrait and generates a context vector to enhance the model's understanding of the sequence. The module consists of a linear transformation layer of query Q, key K, and value V. It uses the softmax function to calculate the attention weights, and then performs a weighted summation of the value vectors according to these weights to obtain the context vector. Finally, the output is obtained through compression operation: ; Where q represents the query information of the input sequence, T represents the transposition operation, k represents the key information of the input sequence, v represents the value information of the input sequence, and c represents the generated sequence context information; Finally, after a linear transformation layer and a sigmoid layer, the final customer repurchase intention probability p is obtained.

2. According to claim 1, a method for predicting customer repurchase intention based on cluster analysis and attention mechanism is characterized in that: The output of users whose predicted probability exceeds the threshold according to the preset decision strategy model is used as a list of customers with repurchase intention, specifically: Build a decision-making strategy model based on preset statistical methods, calculate the company's average daily user traffic based on historical user purchase records, and determine the threshold based on the user traffic ratio; The predicted probabilities of repurchase intention of all users are sorted, and based on the above decision strategy model, the users whose predicted values ​​exceed the threshold are output as the list of customers with repurchase intention.

3. A customer repurchase intention prediction system based on cluster analysis and attention mechanism, characterized in that: When the system is running, the steps of a method for predicting customer repurchase intention based on cluster analysis and attention mechanism as described in any one of claims 1 to 2 are implemented, and the system includes a user information module, a user feature module, a clustering module, a user repurchase intention prediction module, a decision module and a monitoring and evaluation module, specifically: The user information module is used to obtain the user's recent purchase records from the database, process and filter out abnormal values, and then build a user information transaction network based on the user's recent purchase records; The user feature module is used to obtain the user's feature information, and obtain the user's features based on the user's basic information and the user information trading network; The clustering module is used to divide different user groups, construct the user's purchase information into a time series, and cluster the user's purchase behavior characteristics based on the time series to divide them into different clusters. According to the clustering of the sequence, the corresponding users are divided to obtain different user groups with similar characteristics; The user feature module is also used to obtain time series feature information of different user groups, train the user groups separately and extract time series features, capture sequence position information according to the attention mechanism, and combine the extracted time series features and sequence position information to form user portrait features; The user repurchase intention prediction module is used to obtain the final list of customers with repurchase intention, output the repurchase intention probability for each customer, and output the customers whose predicted probability exceeds the threshold as the list of customers with repurchase intention; The monitoring and evaluation module is used to monitor the final output results, ensure the normal operation of the system, monitor the number of customers with repurchase intention and the average willingness value, and ensure that the evaluation values ​​tend to be stable over a long period of time.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a customer repurchase intention prediction program based on cluster analysis and attention mechanism. When the customer repurchase intention prediction program based on cluster analysis and attention mechanism is executed by a processor, the steps of the customer repurchase intention prediction method based on cluster analysis and attention mechanism as described in any one of claims 1 to 2 are implemented.